-
Notifications
You must be signed in to change notification settings - Fork 64
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
📑 Add literalinclude
directive
#610
Conversation
const showLineNumbers = | ||
options?.linenos || options?.['lineno-start'] || options?.['lineno-match'] || numberLines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a portion of the bug in:
Line number is now turned on if lineno-start
is included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - I didn't dig through all the logic around line numbers, etc, in detail, but testing and documentation both look thorough 👍
Despite all the logic complexity added, there was nice simplification around previously duplicated options/directives. My only comments are non-critical.
I confirm that the dev version of myst supports smoothly the literalincludes Since I could not yet test it with JupyterLab, I actually started Guys, it's amazing what you are building!!! Can't wait to switch over from Jupyter-book for my whole toolchain. |
⚡️💨🚀 Really glad you are up and running with the CLI -- we will get it over to Jupyter soon! |
Dear @rowanc1, There seems to be a little glitch in the tex export when literal-including indented code. I have a file
It's included as such:
The generated TeX looks as such; mind the indentation of the first line:
Let me know if more detailed instructions to reproduce would be helpful. The generated html is fine. |
This supports a new directive,
literalinclude
as well as all of the additional options across RST and Sphinx.RST documentation:
Sphinx documentation:
See jupyter-book/jupyterlab-myst#189 and https://github.com/orgs/executablebooks/discussions/1026
There are a few more tweaks that will be necessary to bring this to
jupyterlab-myst
to expose the transform and extend to not having to read from disk, etc.cc @nthiery @matthewfeickert @fperez who were asking for this over the last few months.