I don't think there's a better stack in all of scientific computing than Julia + Jupyter Books. Lovin' it.
The new Jupyter Book
11–20 of 69 posts
Re: The new Jupyter Book
#12I love the Jupyter ecosystem but it's frustratingly messy sometimes. There's already "nbconvert" built in to Jupyter (lab), built on Pandoc. It's extremely under-documented but it's possible to extend it with templates to generate arbitrary outputs. I've done this to directly generate branded PDF reports via latex. Jupyter Book has a lot of overlap with this feature, but rather than building on nbconvert/pandoc, it s…
Can you elaborate on this a little? Do you mean via Jupyter notebooks?
Re: The new Jupyter Book
#13This is a really good move. A lot of people have been offering Jupyter Notebooks along with their Books. This should bring down the effort in getting the book out. An important note though, R world has for something called 'bookdown' for quite sometime and many R developers have used it to write books. https://bookdown.org/ The only worry is that now a lot of data science enthusiasts are going to try to publish their…
Re: The new Jupyter Book
#14I love the Jupyter ecosystem but it's frustratingly messy sometimes. There's already "nbconvert" built in to Jupyter (lab), built on Pandoc. It's extremely under-documented but it's possible to extend it with templates to generate arbitrary outputs. I've done this to directly generate branded PDF reports via latex. Jupyter Book has a lot of overlap with this feature, but rather than building on nbconvert/pandoc, it s…
nbconvert/pandoc is very limited in how it can be extended because it only relies on jinja templating rather than a proper AST. You couldn't achieve a lot of the things that sphinx/jupyter book can now do with that. Trust me I know because, before starting work on https://github.com/executablebooks/MyST-Parser I used the nbconvert/pandoc approach to create https://github.com/chrisjsewell/ipypublish ;-)
The only remaining tooling gap is a markdown linter implemented in python.
Re: The new Jupyter Book
#15Re: The new Jupyter Book
#16I love the Jupyter ecosystem but it's frustratingly messy sometimes. There's already "nbconvert" built in to Jupyter (lab), built on Pandoc. It's extremely under-documented but it's possible to extend it with templates to generate arbitrary outputs. I've done this to directly generate branded PDF reports via latex. Jupyter Book has a lot of overlap with this feature, but rather than building on nbconvert/pandoc, it s…
>I've done this to directly generate branded PDF reports via latex. Can you elaborate on this a little? Do you mean via Jupyter notebooks?
My method is roughly this:
1. Create a Python package that subclasses nbconvert.exporters.LatexExporter -- in the setup.py you register the class to 'nbconvert.exporters' in the 'entry_points' dict.
2. You can do general filtering/compiling by registering 'Exporter.filters'. The compile process can be modified by implementing a custom 'from_notebook_node()'
3. You can include a folder containing jinja template(s) in the package to implement whatever styling you want
4. I have some standard metadata that I pull from the notebook/cell metadata (using the standard Jupyter/lab frontend metadata sidebar) to define things like document titles, authors, etc.
5. Do the conversion like: jupyter nbconvert --to=myfancyexportformat notebook.ipynb
Re: The new Jupyter Book
#17In my job I often have to figure out how to solve a problem involving talking to an API or manipulating data in some way and then sharing that information with others. Jupyter notebooks make that so easy, it’s the first tool that I go to. Being able to mix documentation and code, as well as visualizing output, aligns perfectly with the way I think. I’m not entirely sure I have a use for this book feature, at least no…
A colleague of mine, when first introduced to Python and Jupyter, remarked that Jupyter could be a great platform for writing tests.
Re: The new Jupyter Book
#18Re: The new Jupyter Book
#19I love the Jupyter ecosystem but it's frustratingly messy sometimes. There's already "nbconvert" built in to Jupyter (lab), built on Pandoc. It's extremely under-documented but it's possible to extend it with templates to generate arbitrary outputs. I've done this to directly generate branded PDF reports via latex. Jupyter Book has a lot of overlap with this feature, but rather than building on nbconvert/pandoc, it s…
nbconvert/pandoc is very limited in how it can be extended because it only relies on jinja templating rather than a proper AST. You couldn't achieve a lot of the things that sphinx/jupyter book can now do with that. Trust me I know because, before starting work on https://github.com/executablebooks/MyST-Parser I used the nbconvert/pandoc approach to create https://github.com/chrisjsewell/ipypublish ;-)
I was always a bit frustrated by the way nbconvert pulled in pandoc as a dependency, but then didn't make use of any of its power (pandoc surely has a powerful AST). Instead they re-implemented filters and templates themselves. It struck me that it would have been much cleaner to write a proper 'ipynb > AST' Pandoc reader, and then expose pandoc AST filters and templates.
I was a bit suspicious of moving away from pandoc to sphinx, because sphinx seems markedly less powerful and general than pandoc. However, you seem to think it's the opposite! Does Sphinx have an AST? I can't see any reference?
Re: The new Jupyter Book
#20Earlier quoted context omitted.
nbconvert/pandoc is very limited in how it can be extended because it only relies on jinja templating rather than a proper AST. You couldn't achieve a lot of the things that sphinx/jupyter book can now do with that. Trust me I know because, before starting work on https://github.com/executablebooks/MyST-Parser I used the nbconvert/pandoc approach to create https://github.com/chrisjsewell/ipypublish ;-)
This looks great, as extended commonmark support knocks down the last major pain point to switching to Sphinx for docs in the projects I've worked on. The only remaining tooling gap is a markdown linter implemented in python.