-
Notifications
You must be signed in to change notification settings - Fork 86
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 new parser for text-based notebooks #83
Comments
sounds good - that's similar to what jupyter book does currently, if it gets a text file that's not One snag here will be same line number / reporting challenge in #71 - in this case, we do have a "natural" line number to report, even though we're working with a notebook, but we'll need to find a way to pass this through the build system to use when needed |
Yeh absolutely, thats the 'major' complication of pre-conversion to a notebook, rather than treating these cells as 'pure' sphinx directives (as done by jupyter-sphinx). I think/hope it is solvable though. To re-iterate why trying to achieve this by adapting
|
Using nb = jupytext.myst.matches_mystnb(text, store_line_numbers=True) Now stores the line numbers in cell metadata, under start_line=nb_cell["metadata"].get("_source_lines", [0])[0] |
Once mwouts/jupytext#458 is merged, and a new jupytext version is released, we can progress with the folowing:
Also these files won't work directly with the
myst-parser
extension (because it won't know what to do withcode-cell
andraw-cell
). You need to add a separate parser to myst-nb that callsjupytext.myst.matches_mystnb
, to work out if the markdown file should be read as pure markdown or converted to a notebook. (it should just need to be a small subclass ofNotebookParser
)@AakashGfude will also need to use it in some manner in #55 to work out which markdown files to convert/execute/cache
Originally posted by @chrisjsewell in #82 (comment)
The text was updated successfully, but these errors were encountered: