Hi, great pleasure to benefit from html_embed (for figures) or fromhtml_toc (for toc :) through nbconvert ; thanks to their developers.
But how to convert to a html file with the 2 formats ?
Some option like nbconvert --to html_embed_toc ... ?
Apologies if the question is naive: I'm a newbie here.
PhL.
Unfortunately it is not possible to chain the two exporters; perhaps would it be possible if both were preprocessors.
Here the toc2 exporter essentially is a wrapper to using the toc2 template, while the embed_html seems essentially a post processor.
Given that, you should get both effects with
jupyter nbconvert --to html_embed --template toc2 FILE
Otherwise, if what you want/need is to keep image files in the html (html_toc extracts the image since the extractPostprocesor is enabled in toc2.py -- may not be a good idea after all), you can issue
jupyter nbconvert --to html_toc --ExtractOutputPreprocessor.enabled=False FILE
jupyter nbconvert --to html_embed --template toc2 FILE
Right! It works fine: .ipynb file --> .html file with embed figures and toc numbers at every section level (+the classic toc). Perfect.
jupyter nbconvert --to html_toc --ExtractOutputPreprocessor.enabled=False FILE
No alas (?): figures in the generated html file are links to external files
Many thanks jfberger for your quick and fruitful answer. PhL.
Most helpful comment
Unfortunately it is not possible to chain the two exporters; perhaps would it be possible if both were preprocessors.
Here the toc2 exporter essentially is a wrapper to using the toc2 template, while the embed_html seems essentially a post processor.
Given that, you should get both effects with
jupyter nbconvert --to html_embed --template toc2 FILEOtherwise, if what you want/need is to keep image files in the html (html_toc extracts the image since the extractPostprocesor is enabled in toc2.py -- may not be a good idea after all), you can issue
jupyter nbconvert --to html_toc --ExtractOutputPreprocessor.enabled=False FILE