nbdev icon indicating copy to clipboard operation
nbdev copied to clipboard

Automatic refresh of nbdev_preview lost when using output-file on the frontmatter

Open thigm85 opened this issue 2 years ago • 3 comments

Using output-file on the notebook frontmatter works great to specify a fixed URL. 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. Is this expected?

thigm85 avatar Sep 13 '22 13:09 thigm85

No not expected - it's a bug. It's a non-trivial fix though so might not be done right away.

BTW, what do you use output-file for? Why not just rename your notebook? I'm interested in understanding how folks use quarto and nbdev features so would love to hear more about this.

PS: Sorry I didn't respond sooner to when you mentioned this in an earlier issue.

jph00 avatar Sep 14 '22 05:09 jph00

As you suggested, I currently use numbers in front of notebook files to maintain an ordering of files that makes sense to my project. However, I noticed that the ideal ordering changes when the project evolves, as do the notebook names.

Since the documentation links are used externally, it is not pleasant to change the link address every time I change the notebook name, hence output-file. Makes sense?

No worries about the lack of reply. I am grateful for the work and support you and your team provide.

thigm85 avatar Sep 14 '22 08:09 thigm85

Yup makes sense. The good news is that the latest quarto pre-releases make this numbered filename thing unnecessary.

https://quarto.org/docs/websites/website-navigation.html#auto-generation

We're now using this for the nbdev website, so check our _quarto.yml for examples. You'll need to add order: frontmatter to your notebooks.

jph00 avatar Sep 15 '22 00:09 jph00

Excellent, will there be a new _quarto.yml template in future nbdev releases, or should everyone adapt their file manually to use the auto-generation functionality?

thigm85 avatar Sep 15 '22 10:09 thigm85

I'm not sure yet - will have to think about it once quarto 1.2 is released.

jph00 avatar Sep 15 '22 20:09 jph00