Nbdev v2 launched

Could you please share more about your use-case and the specific issues nbdev is giving? Are you referring to the table of contents in Quarto? What does your notebook contain?

1 Like

Hi wasim,

So sorry for taking it so long to share the nbdev project.

At the moment I am using nbdev project to experiment source code of fastcore.delegates to have a better understanding and to share what I found and ask questions at the same time.

On the front page, I introduced a tiny little problem of the source and showed a solution to it.

On the second page, I have done a dissection on the source code of delegates starting from here which is heading level 2 and the subheadings extend to level 4. I can see headings down to level 3, but not level 4. This is when I wonder whether we can customize it to reveal more subheadings.

You are absolutely right that show_doc can show us which params are from to, which again demonstrates how brilliant fastai is. Here is a tiny use difficulty I found with show_doc and keep=True.

Thanks for your patience!

1 Like

I have two questions concerning nbdev toc and search.

The links on the table of content generated from Jupyter notebook TOC extension don’t work on the preview nor on the website. Does it indicate that we should delete the table of content cell before pushing it to github?

The website search feature is great. When I search “question”, it gives me the detailed context of the searched word. The context includes heading (linked), keyword and the paragraph where it appeared. However, sometimes the heading link given is little far away from the keyword, as there is closer subheading link could be given. see the example below.

Also after clicking the search link provided, if the keyword can be automatically highlighted, that would be wonderful too. Can we customize it ourselves?


1 Like

This is currently a limitation of Quarto. We’ve asked the Quarto folks to add this and they’re looking into it.

2 Likes

This is a quarto feature, not nbdev. So I’d suggest asking on the Quarto Discussions board:

2 Likes

Thank you Jeremy! I will look into Quarto discussion board for search feature.

I assume nbdev_install_jupyter_hooks is not in use anymore, as I can’t find it in nbdev docs.


Thanks I’ll fix the docs. nbdev_install_hooks installs the jupyter hooks too now.

2 Likes

Got it, Thanks Jeremy.

I have another question about #|echo: false. I think it should work as below.

However, when I tried it with my nbdev project, it didn’t hide the input.

I tried both #|echo: false and #|echo: False. Neither work on my side.


Sorry, no more problem! Now it is working.

1 Like

I have a strange behavior of doc in nbdev project.

but after I installed with conda install -c fastai nbdev. The problem is gone.

After installed nbdev 2, it seems importing nbdev_export in jupyter cell does not work anymore. But everything else works fine.

Check the version. I’m not sure you’ve got the latest.

1 Like

You are right, it is working now!

I made the change on 07_meta.ipynb in my fork of fastcore, and after I run nbdev_preview, I run git diff and there are some auto changes to _modidx.py file. Should this be happening?

Then I run nbdev_preview and found the difference on the web

When I run git diff, I found auto changes to _quarto.yaml below:

And there is auto changes on the 07_meta.ipynb file as well:

How should I deal with them? Thanks!


Should I simply make the change on 07_meta.ipynb and push without running nbdev_prepare so that there won’t be those auto changes?

1 Like

You should run nbdev_install_hooks. That will remove that metadata added to the notebook for you. Also make sure you update to the latest fastcore, nbdev, and execnb versions. Thanks for being so thorough!

2 Likes

I have done all the updates and installs. However, right now, I got the following error message when running nbdev_preview:

I tried to pip uninstall nbdev and reinstall it again, and pip install -U nbdev and run nbdev_install_hooks. Still got this same error message. What else should I try?

Can we convert ipynb file to markdown file, and from markdown file to ipynb file using nbdev command?

I found this post in 2020 about using nbdev_nb2md to convert from notebook to markdown. But I can’t find any such command from nbdev2.

I have deleted mambaforge folder and reinstalled everything, but the error persisted.

I just released something which should fix this - please try updating nbdev.

1 Like

I tried it but still not working for me.

First, I updated nbdev

Second, I ran nbdev_prepare, no problem, but nbdev_preview get me the following error message:

In order to see whether nbdev_preview can work in the end, I comment out all the places where I import and use my lib debuggable, but still can’t get nbdev_preview to work properly.