Closed mmcky closed 6 years ago
I see the method for adding non-autoparsed content in rst2ipynb
is to use pycon
as the highlighter
.. code:: pycon
>>> def f(a, b, c):
... """Multiline
... docstring
...
... """
... # a comment
...
... return a + b + c
...
>>> f(1, 2, 3)
6
which is parsed as
For the time being we will simple include whatever is found in the code-block
without any additional parsing. It should give users the most expected output. If they wish to have code in different In
blocks they will need to use different code-block
directives sequentially.
See PR #37
The current implementation will treat each
code-block
(or equivalent directive type) as a single input cell in the generated jupyter notebook.will get rendered as
The
rst2ipynb
implementation seems to parse internally to the block and split this input out and remove the associated python syntax.The approach taken in this extension so far is to use
code-blocks
as discreteIn
cells and then we have planned to implement a:class: output
option for adding output to the code-block immediately above it. (not implemented yet). Adding output as an option gives the notebook the look and feel of an executed notebook. In my view I think the discrete block approach aligns nicely with jupyter but thought I would open this discussion.