render jupyter percent scripts #6700
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements support for rendering Jupyter percent scripts, which are a convention for encoding a notebook within an ordinary script file. For example, consider the following
notebook.py:You can also include markdown inside a multi-line quote. For example:
Jupyter percent scripts are currently supported by a wide variety of tools including VS Code, Visual Studio, PyCharm, Spyder, and Hydrogen. See the Jupytext documentation on percent scripts for additional details: https://jupytext.readthedocs.io/en/latest/formats-scripts.html
This PR implements support for Python, Julia, and R. There is now a
claimsFile()method on engines (which replacesclaimsExtension()) that is used to determine if a script should be targeted as a percent script.@cderv It would be great if you could add comparable support for Knitr
spin()using theclaimsFile()method (which will need to look inside the R script to see if it usesspin()conventions).@pankgeorg Once this lands you can update your Pluto engine to implement
claimsFile()(you'll want to look inside the file to detect whether it is a Pluto notebook)