-
Notifications
You must be signed in to change notification settings - Fork 269
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
Switch to jupytext MyST markdown #2221
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Can we use the same as gammapy here? I like that in that format, the notebooks are actually valid python scripts that can also be run normally. |
Sure, I'll take a look at it. Just to be clear: The .md notebooks can be run by Jupyter without converting them again |
Out of the box? Or with some extension installed? |
Jupytext has to be installed in the environment |
fixes: #2099 |
Does jupyter itself support the format GammaPy uses, or do they export to that after editing? With Jupytext, you can use jupyter directly to edit/view the files I think, which is nice. |
The system gammapy uses is sphinx-gallery: https://sphinx-gallery.github.io/ |
That is nice as it lets you download the result as a notebook or a script... |
Loading the script directly with jupytext also seems to work in that format |
@@ -130,7 +130,7 @@ jobs: | |||
- name: Install doc dependencies | |||
run: | | |||
sudo apt update --yes && sudo apt install --yes git build-essential pandoc graphviz | |||
pip install -U pip towncrier | |||
pip install -U pip towncrier myst-nb |
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.
should we not include those now in setup.cfg
under options.extras_require.docs
?
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.
yes. The docs are something the user should be able to build on their local install, without using the CI, so it should be a dependency
@StFroese Could you make a new attempt here with the same format Gammapy uses and the current main? Please add the newly needed packages to the correct extras in |
@maxnoe can do. I'll open a new PR for this |
I have a quick question, not having worked with the sphinx-gallery text format. Can you open notebooks written in this format directly in Jupyter(lab)? Or do you have to convert to notebook first, edit, and convert back? Or is it just a different variant of format supported by the jupytext plugin? |
@kosack When you have the jupytext extension installed, they open just fine in jupyter {lab,notebook} |
I'm a little confused about this too. Seems like you have to use .py script with sphinx-gallery instead of notebooks. Am I right @maxnoe? |
Replaced by #2377 |
fixes #2099