jupyter-book / jupyterlab-myst

Use MyST Markdown directly in Jupyter Lab
https://jupyter-book.github.io/jupyterlab-myst/
BSD 3-Clause "New" or "Revised" License
141 stars 16 forks source link

Support include & literalinclude #189

Open nthiery opened 11 months ago

nthiery commented 11 months ago

The literalinclude directive offered by myst-parser and sphinx -- with its subsection selection mechanisms (start-after, ...) -- is very handy in teaching context for displaying fragments of code, while maintaining these fragments in code files together with tests. This guarantees that the fragments are actually correct; a desirable feature in general which becomes critical when authoring exams.

Proposal

Support the same feature in jupyterlab-myst.

rowanc1 commented 11 months ago

Thanks @nthiery - I have added the first part of the directive that works with the MyST CLI. There is still a bit more work to do to bring it over to jupyter lab.

All of the start-at/after, lines, lineno-match etc. are now implemented as well.

nthiery commented 11 months ago

Oh wow, that was amazingly quick!

agatafilipczak commented 6 months ago

Hey! any updates with this issue?

parmentelat commented 4 months ago

I'd like to +1 on this request, would be a very helpful addition indeed
from the referenced issues and PRs it feels like most of the heavy lifting has been done, when can we expect this to be widely available ?

as far as I can tell, I can use the literalinclude directive in jupyter-book (although it renders without the filename, but that's a minor issue), but in jupyterlab it just silently renders nothing..