kiwi0fruit / pandoctools

Profile manager of text processing pipelines: Pandoc filters, any text CLI filters. Atom+Markdown+Pandoc+Jupyter workflow, export to ipynb. Uses Stitch fork: https://github.com/kiwi0fruit/knitty
MIT License
52 stars 9 forks source link

Create Jupytext workflow (with VS Code Run on Save and SugarTeX) #41

Open kiwi0fruit opened 5 years ago

kiwi0fruit commented 5 years ago

NEW

Simply write pandoctools profile that converts from pandoctools .py to .jupytext.py (there are many differences including markdown cells format. Add this to README https://github.com/jgm/pandoc/issues/5992 and check that knitty doesn't break escaped double quotes). When adding YAML with this profile to the top of the .py I would be able to run conversion on demand (drag and drop for example). It would be enough for me. Unicode would be added in Atom. Python files would be edited in PyCharm.

Use pandoc jupyter format in jupytext together with py-pre-knitty-to-md-pandoc

.py pre-knitty .md pandoc .pandoc-ast pandoc .pandoc-jupyter-md jupytext-pair .ipynb


OLD

NEW2: Consider using Atom only as it might be the most convenient option. Consider. Static images and text can be handled in hydrogen. But lots of text and dynamic figures should be handled via jupytex and jupyter-lab. Worth considering adding special block comments: Markdown(stex(""" and """)).

NEW: I guess I need ability to add cell metadata. And make sure knitty pandoc filter preserves cells attributes like in here https://pandoc.org/MANUAL.html#creating-jupyter-notebooks-with-pandoc Does pandoc jupyter markdown support complex cell attributes? https://github.com/jgm/pandoc/issues/5992 I guess I'll implement it via yaml blocks https://github.com/kiwi0fruit/knitty/issues/10

Inline commented Markdown cells are also needed: https://github.com/kiwi0fruit/knitty/issues/12

That would be replacement of the Atom/Hydrogen and VS Code interactive Python.

Components to use: Jupytext, one of Visual Studio Code "Run on Save" extensions, SugarTeX, upcoming SugarTeX completions for VS Code extension.

PS: May be I would need to reconsider matplotlibhelper and tabulatehelper functionality.

UPD: I should also find on save runner for PyCharm but it may be tricky hence worth considering monitoring opened file change in VS Code.

UPD2: Use pandoc jupyter format in jupytext together with pre-knitty-to-pandoc

But marking of which code blocks are code cells should be taken from knitty.

kiwi0fruit commented 3 years ago

Move to VS Code: