-
Notifications
You must be signed in to change notification settings - Fork 54
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
Proposition: text-based source files via Jupytext #80
Comments
Leaving this open for a bit in case people want to catch up with the significant change. All (but two) notebooks were replaced with markdown in #81! @davidmascharka the text files are so... beautiful 😭 |
Current issues with jupytext-markdown:
Neither of these are hard-blocking issues. I am working with the jupytext folks to help remedy this. |
These issues were fixed in jupytext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source control for notebooks is awful. Editing notebooks is awful (@davidmascharka can maybe attest to these more than anyone on the planet). Meta data in notebooks is awful.
I am proposing a workflow that consists of writing / version-controlling .md or .py files as the source documents of PLYMI. And then using
jupytext
andnbsphinx
to convert these to notebooks and then html.Background
Why do we use notebooks in PLYMI? The answer was that it was by far the easiest solution for me when I first started working on this project.
nbsphinx
provides an incredibly easy means for jumping from a familiar notebook format to nice html. That being said, only a couple of PLYMI's sections actually use nbsphinx as intended: example 1, example 2. The rest of these sections could be written in pure .rst... almost.The reason why we need
![image](https://user-images.githubusercontent.com/29104956/53289097-09a97780-3760-11e9-85a9-be2bbae45d82.png)
nbsphinx
for all of this is because of these guys:These custom "admonition boxes", with nice headers and code-blocks, cannot be produced in reSt files. The author of
nbsphinx
rolled his own special support for these boxes.I experimented with PLYMI without these boxes, and it turns out that they are super important to the experience that we give the reader. Delimiting takeaways, reading comprehension questions, etc. is critical. So until common markdown provides support for these, we need
nbsphinx
and the whole stack that it builds off of.Proposed Solution
I would like to use jupytext to mediate conversions between notebooks and text files. From their readme:
Yes.
Yes...!
YES!!!
OKAY!!
jupytext
supports a workflow in which a notebook, saynotebook.ipynb
, can be "paired" with a python script,notebook.py
(or other type of file, like markdown). You can now edit the script and runjupytext --sync notebook.py
to propagate changes to the notebook. You can also edit the notebook, and changes will propagate to the text file automatically. Ultimately we would only share the text files, and generate the notebook locally as needed.Thus a full work cycle of editing PLYMI source and building the site anew would look like:
For @davidmascharka an edit workflow would simply be steps 1-3.
I am going to experiment with this and verify that we can indeed generate all of PLYMI as-is from text files as the true source files.
From there, I will mess with the smaller details / config setting for
jupytext
to see if I can prescribe a simple, portable workflow that can be stood up from scratch easily. And one that gets us from text to html quickly. Ultimately it is important that this methodology does not require specialized knowledge of these tools.I would love feedback thoughts on this. Let me know if anything about jupytext and its capabilities jump out as being particularly useful for PLYMI or if you have any concerns.
Edit: it looks like nbsphinx can leverage
jupytext
directly if we modify the sphinxconf.py
file. This means that sphinx itself would do the text -> notebook conversion.The text was updated successfully, but these errors were encountered: