Skip to content
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

Support include & literalinclude #189

Open
nthiery opened this issue Sep 15, 2023 · 4 comments
Open

Support include & literalinclude #189

nthiery opened this issue Sep 15, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@nthiery
Copy link

nthiery commented Sep 15, 2023

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
Copy link
Member

rowanc1 commented Sep 19, 2023

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
Copy link
Author

nthiery commented Sep 19, 2023

Oh wow, that was amazingly quick!

@rowanc1 rowanc1 changed the title Support literalinclude Support include & literalinclude Nov 14, 2023
@agatafilipczak
Copy link

Hey! any updates with this issue?

@parmentelat
Copy link

parmentelat commented May 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants