Open vincentqb opened 8 years ago
You mean to strip all of the non code content from a file?
There isn't a way to do that but it wouldn't be difficult to add. It would have to be enabled with a flag. What do you think a good flag name would be?
Yes, either stripping or commenting out the non-code content would do. The latter option is what ipython nbconvert does when converting to code.
For the flag, how about "--to code" or "--code" ?
I suggest to support something like knits-spin
http://yihui.name/knitr/demo/stitch/
https://divyup.wordpress.com/2015/07/11/knitr-and-spin-in-r/
Basically, it converts the markdown blocks to special comment lines (with #'
starts) and the code block to plain code lines.
And it is more interesting to support the another direction of conversion, i.e., converting documented python, jupyter or R scripts to jupyter notebooks.
Is there a way of extracting the code chunks directly from notedown?