GithubHelp home page GithubHelp logo

Comments (5)

nthiery avatar nthiery commented on June 14, 2024

@minrk: you may have insight about this last aspect?

from notedown.

aaren avatar aaren commented on June 14, 2024

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.

from notedown.

nthiery avatar nthiery commented on June 14, 2024

On Tue, Oct 06, 2015 at 09:10:20AM -0700, aaren wrote:

I think this comes down to supporting an indented fenced code block.
Technically this should be possible on markdown -> notebook conversion.

This would be very much appreciated!

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).

That's my understanding too. I can imagine that there are good reasons
for this design choice, in particular keeping things simple; however --
just my 2 cents -- I see it as a serious limitation of the notebook
model.

As a result, the conversion of your test input would be one way
only.

For my use cases (being able to author structured documents in ReST --
in particular the Sage documentation --, and convert them with [1] to
IPython notebooks for interactive browsing), that's totally fine.

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.

Ok.

Just being curious -- and slightly off topic -- would it make sense to
extend pandoc with a reader and a writer for the IPython notebook
format to benefit from its infrastructure?

Kind regards,
Nicolas

[1] https://github.com/nthiery/rst-to-ipynb/

from notedown.

aaren avatar aaren commented on June 14, 2024

@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.

from notedown.

minrk avatar minrk commented on June 14, 2024

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.

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.

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.

from notedown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.