Skip to content
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

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

Open
2 tasks
kiwi0fruit opened this issue Sep 20, 2019 · 1 comment
Open
2 tasks
Assignees

Comments

@kiwi0fruit
Copy link
Owner

kiwi0fruit commented Sep 20, 2019

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 jgm/pandoc#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? jgm/pandoc#5992 I guess I'll implement it via yaml blocks kiwi0fruit/knitty#10

Inline commented Markdown cells are also needed: kiwi0fruit/knitty#12

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

  • create executables wrapperes for opening ipynb files in notebook and in jupyter-lab (starts server in the dir of the file that was "opened-as" and may be navigates there.
  • Create special pandoctools profile that is run on VS Code save that converts knitty *.py to *.jupytex.py (same for .r and .jl). It should convert block commented Markdown code cells to inline commented Markdown code cells (and apply SugarTeX to Markdown as well).

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
Copy link
Owner Author

kiwi0fruit commented Aug 14, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant