mknotebooks
mknotebooks copied to clipboard
Support YAML front-matter metadata
When using MkDocs, we have the possibility of putting extra article metadata in a YAML front-matter at the top of the Markdown document. This allows for custom formatting, such as selecting the template to use, etc.
When trying the same thing with a Jupyter Notebook, the top YAML front-matter is rendered as any Markdown cell and not picked up by MkDocs as such.
Here is a scenario in action:
I try digging nbconvert
documentation but could not find anything relevant nor enabling a workaround. The only thing that seems to be working is using the MarkdownExporter but mknotebooks
uses the HTMLExporter.
Any ideas?
A quick follow-up. In the following issue referring to adding a blog feature in mkdocs-material
, @timvink mentioned mknotebooks
being up for the task: https://github.com/squidfunk/mkdocs-material/issues/3353#issuecomment-998516787
As stated in this issue, mknotebooks
does not support YAML front-matter metadata in the first notebook cell.
@greenape is there any reason mknotebooks
uses internally the "HTMLExporter" instead of the "MarkdownExporter" from nbconvert
?
+1. If we're going to get blog support improved in mkdocs, this feature would make sense!
@greenape would you be interested in investigating this and picking this up? If not, do you agree on the direction and would you be open to contributors?
Contributions are very welcome! (I don't have a lot of time to work on this at the moment.)
Did originally use the markdown exporter for this, but at the time it was rather less capable than the html one especially when dealing with widgets etc. (May no longer be the case, I haven't checked)