Nbdev v2 launched

Thanks for your reply, but the image above is all I got from nbdev after running nbdev_docs. How do I dig more about the info related to URI malformed? Where should I look?

This line suggests its a deno error, which would be happening inside Quarto preview, and I suspect not due to nbdev (I could be wrong).

I’d be happy to take a look but I get a 404 error when I follow your repo link, it might be private. Trying the latest Quarto prerelease might also help. Looking through their changelog, they’ve been making quite a few deno-related changes lately e.g. upgrading its version.

You might also have luck posting in a Quarto support forum?

Thanks a lot. You are right, it was private, my bad. Now it is public.

I have downloaded and installed the latest prerelease, there is some progress here, as there is more info given instead of URI malformed. But I don’t know what to do with it.

If I remove the first table of contents cell from utils.ipynb, the error goes away.

I’m curious why you’re opting for that? The Quarto docs should have its own table of contents on the right (and you can control it with the Quarto toc frontmatter options described here). And in Jupyter, I recommend using the table of contents extension available here.

BTW, if a markdown header ends in a - (e.g. ## Export -) it will be hidden, no need for #|hide in that case.

I also get that in the latest prerelease - it’s being tracked here by the Quarto team: rust launcher: crash on retrieving exit code from deno · Issue #2296 · quarto-dev/quarto-cli · GitHub

Best to revert to the released version in the meantime.

1 Like

Yeah, the toc cell is annoying. Every time I use the classic notebook, the toc cell will automatically generated for me. I don’t know how to turn it off without keeping TOC2 extension. Also when I move from Jupyter Notebook to Jupyter lab, if I don’t turn off TOC2 from classic Notebook, when I open Jupyter lab I will still get the toc cell.

So, these days I mainly stay with Jupyter lab without using toc2 extension.

Now, the problem is solved with Jeremy’s tips and removing the toc cell as you suggested.

1 Like

Thanks Jeremy, revert back to the latest version does solve the URI malformed problem for me!

Ah I see! I didn’t know the extension could do that. I’m able to toggle that setting by clicking “Edit”, “nbextensions config”, then clicking “Table of Contents (2)” in the list, then toggling the “Add a Table of Contents cell at the top of the notebook” option.

Alternatively, it also seems to be configurable in the JSON file ~/.jupyter/nbconfig/notebook.json under the keys "toc2" followed by "toc_cell" (a JSON boolean).

2 Likes

Wow, thank you so much! This is very helpful!!! I have always wanted to get this sorted out but was never successful!

I tried and they work well. Thank you!


Now, I think jupyter notebook may become lovely and appealing again :slight_smile:

2 Likes

How to collapse sidebars to display the 100% of line width of cells

I have written a little tool to print both source codes, comments and evaluations of expressions for debugging. So, I need to a wide line width to display below, and luckily in jupyterlab, by default the line width of cells seem to be 100% (I guess). To enable a nice view of the print out, I just need to collapse the sidebar as shown below.

In jupyter notebook, I can manually set the line width of cells with the following code

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

then I can get the look I want as below

However, when I do nbdev_preview, I can’t collapse the sidebars to display the full line width of cells. Is there a way to collapse the sidebars to reveal the full line width of cells?

There are many nice ways to do this in quarto:

1 Like

Do you think reader mode may be what you are looking for? Quarto - Website Navigation

You can try setting this in a custom.yml file

1 Like

(Removed post because replied on wrong thread)

1 Like

By default, the URL of nbdev docs maps to the notebook file name. my_notebook_name.ipynb maps to mysite.github.io/my_notebook_name.html.

Is it possible to specify a URL that does not change based on the notebook file name?

Thanks a lot! I have tried to reader mode. It does collapse the two sidebars but it does not give me the full line width of cells, as it is shown below.


Thanks Jeremy and @hamelsmu !

You are right, I just found out a way to enable individual cell to span its width.


2 Likes

IIRC quarto has an output-file key you can put in your frontmatter.

1 Like

Hi @jeremy,

output-file worked great to specify the URL I wanted. However, I lost the automatic refresh of the output of nbdev_preview.

Without output-file, any notebook changes saved get immediately reflected on localhost:3000 when using nbdev_preview. This feature is lost when using output-file.

Should I file an issue for that?

FYI: My question was answered here: Automatic refresh of nbdev_preview lost when using output-file on the frontmatter · Issue #1052 · fastai/nbdev · GitHub

1 Like