QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

BUG: Interspersed Lists and Code #144

Closed arnavs closed 5 years ago

arnavs commented 5 years ago

If you write

1. This is a list with some code underneath 

    .. code-block:: julia 

        foo = x -> x + one(x)

2. But it won't render properly

What you see is the following

jupinx-error

arnavs commented 5 years ago

And the numbering will reset, cc @jlperla

mmcky commented 5 years ago

@arnavs @jlperla this is going to be an issue that will be very difficult to solve. The reason is that when we break the markdown cells (with a code block in between) the sphinx extension will keep writing the enumerated list (as markdown). We rely on the markdown to render the cells which means the extension just writes 1. in the new markdown cell and I don't see any transfer / link mechanism from a markdown cell above.

Even if I changed to use 2. etc. and incremented the count -- the markdown engine will still render it as a new list in the notebook!

Nosferican commented 5 years ago

Probably best just to change to unordered list?

mmcky commented 5 years ago

@Nosferican I think you're right -- that is probably the best solution for now.

image

mmcky commented 5 years ago

I will close this as this has now been documented in https://github.com/QuantEcon/sphinxcontrib-jupyter/pull/145