-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of indented fenced input/output code blocks (e.g. within an itemize) #33
Comments
@minrk: you may have insight about this last aspect? |
I think this comes down to supporting an indented fenced code block. Technically this should be possible on markdown -> notebook conversion. As for notebook -> markdown conversion: I don't think that there is a way to represent this in the notebook model. There isn't a way to nest a code cell within a markdown cell (which is what I see this is). As a result, the conversion of your test input would be one way only. I could add support for this (indented fences) in the markdown -> notebook conversion, but have concerns about my code block matching regex getting much more complex. At some point I'd like to have an external library (likely mistune) doing the markdown parsing, but last time I checked it wasn't simple. |
On Tue, Oct 06, 2015 at 09:10:20AM -0700, aaren wrote:
This would be very much appreciated!
That's my understanding too. I can imagine that there are good reasons
For my use cases (being able to author structured documents in ReST --
Ok. Just being curious -- and slightly off topic -- would it make sense to Kind regards, |
@nthiery can you link me to a real example of the input that you would like to process? And corresponding output? I'd like to understand a bit better. R.e. notebook model: yes I think a tree is a more natural model for the notebook and perhaps that will appear in future formats. The simplicity of the flat model is a major plus though. R.e. pandoc notebook reader / writer: I've thought about this before. The pandoc document model is nice to work with. I've thought about using pandoc for notedown but it is a heavy dependency. |
Feel free to blame the notebook format for not supporting code cells within a bulleted list. We are aware of the issue, but haven't found the complexity trade off to make sense yet. Perhaps in the future when we have fewer other problems to solve. I think it's ambiguous whether code blocks in bullets should be converted to code cells, since it breaks document formatting. You could, for instance, leave them as code blocks in markdown cells, which would remain perfectly valid. It is not true in general that all code blocks should be converted to code cells.
It sure is. I think nbconvert would be a great deal nicer if it were restructured entirely to be pandoc filters/readers/writers, but the dependency is rough for a lot of people, especially on conservative linux environments. |
Markdown supports fenced code blocks within itemize or other markdown construct denoted by indentation, as in the following example:
Would it be possible to have notedown support them as well? In particular, is there a way to translate such code blocks in the Jupyter notebook model?
Currently notedown gets confused and treat the the fenced code blocks and everything indented after as a single raw codeblock. I tried the different values of --match without success.
The text was updated successfully, but these errors were encountered: