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

.md round-tripping Broken on %%python3 magic #365

Closed
psychemedia opened this issue Oct 29, 2019 · 4 comments · Fixed by #368
Closed

.md round-tripping Broken on %%python3 magic #365

psychemedia opened this issue Oct 29, 2019 · 4 comments · Fixed by #368
Milestone

Comments

@psychemedia
Copy link

Just noticed this in a notebook that uses %%python3 magic to demonstrate code execution in separate cells.

If I'm editing a markdown file in Jupyter notebook UI under Jupytext, if I have a code cell:

%%python3
a = 1
print(a)

if I save the file and then reopen it, the %%python3 block cell magic has been stripped.

@mwouts mwouts added this to the 1.3.0 milestone Oct 29, 2019
@mwouts
Copy link
Owner

mwouts commented Oct 29, 2019

Thanks @psychemedia for reporting this. I will have a look.

mwouts added a commit that referenced this issue Oct 29, 2019
mwouts added a commit that referenced this issue Oct 29, 2019
@mwouts
Copy link
Owner

mwouts commented Oct 29, 2019

@psychemedia , I was able to reproduce (and fix) this. In the next release that should work. Note that the cell magic is absent from the Markdown representation, as python3 becomes the cell language, i.e. that cell starts with ```python3 instead of ```python.

mwouts added a commit that referenced this issue Oct 30, 2019
mwouts added a commit that referenced this issue Oct 30, 2019
mwouts added a commit that referenced this issue Oct 30, 2019
mwouts added a commit that referenced this issue Oct 30, 2019
@mwouts
Copy link
Owner

mwouts commented Nov 8, 2019

Hello @psychemedia , this has been included in the latest RC, available with pip install jupytext==1.3.0rc1. Would you like to give it a try? Thanks

@psychemedia
Copy link
Author

@mwouts Seems to work fine for me now.. thanks 👍

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

Successfully merging a pull request may close this issue.

2 participants