Closed JonasIsensee closed 4 years ago
nice, will give a review on this (and the other one) this weekend 😉
Thanks @JonasIsensee , when trying to review this, I finally crafted #305 by myself 😅 How about only striping Weave headers when generating markdown ? AFAIU, all the other output format expects no header YAML at this point.
Hi,
your suggestion sounds good.
Just to make sure: The header could also be preserved when converting a jupyter notebook to .jmd
?
no, afaiu there's no YAML header spec in notebooks. Could you elaborate your idea ?
What you are saying is probably correct but my use case is the following:
I do numerical simulations in jupyter notebooks along with extensive markdown explanations. Once finished (or after updates) I use weave to export this to markdown for use in a jekyll website. Jekyll needs a yaml header. I don't want to edit my output markdown files, so i put the YAML in the first notebook cell.
So for maximal flexibility I would like there to be a way to preserve the header during weaving (and maybe during conversion between jmd and notebook)
ah I see. If you put a YAML header in the first markdown cell, and weaving (or converting) your notebook into markdown, then the YAML header will be preserved as the other markdown contents. Well, the YAML header will look weird in the Jupyter notebook frontend, since there is no spec for YAML rendering.
Yeah, it looks a bit odd but I don't mind if it allows me to not have to edit all output files every single time after re-exporting.
okay close in favor of #305
Hi,
here's another small PR, this time concerning #197 . I modified the function
strip_header
to look for a field calledoutput_header
in the YAML header given in the input file. If it exists, its contents are then reexported into YAML and added as a header for the output file.A test is added as well. What are your thoughts ? I have not added anything in the documentation yet because I wasn't sure where it would fit best.