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

multiple pairings #290

Closed
githubpsyche opened this issue Jul 14, 2019 · 4 comments · Fixed by #373
Closed

multiple pairings #290

githubpsyche opened this issue Jul 14, 2019 · 4 comments · Fixed by #373
Milestone

Comments

@githubpsyche
Copy link

I'd like to be able to pair a notebook with both a markdown file and a python script, but it seems one can only pair with one document type at a time, at least using the toolbar interface.

@mwouts
Copy link
Owner

mwouts commented Jul 15, 2019

Hello @githubpsyche ,

it seems one can only pair with one document type at a time, at least using the toolbar interface.

That's right. Multiple pairing cannot be configured from the Jupytext extensions. Still, as you suggest, it is available with the command line interface:

jupytext --set-formats ipynb,md,py notebook.ipynb
jupytext --sync notebook.ipynb

and through the direct edition of the notebook metadata: replace "ipynb,md" with "ipynb,md,py" in the jupytext.formats metadata.

Multiple pairing is demoed in our demo folder - see there how our World population notebook is paired to 6 text formats.

There are 2 reasons for which multiple pairing is not accessible from the UI:

  • The extensions have to be coded in Javascript/Typescript, which I am not not super fluent at
  • And, last but not least, multiple pairing is a bit more complex to use... For instance, with a pairing "ipynb,md,py", when you load the ipynb file, the inputs cells are taken from the md file. You'll have to open the py file to load the input cells from the py file. Obviously, we could improve that and make sure that input cells are loaded from the most recent file (like jupytext --sync does, see Suggestion: --sync as default when script is older than notebook #254), but for that I'd like to be sure that the added value for the user is worth the additional work.

Can you tell us whether the current options are enough for you? And also, do you plain to edit both the .py and .md files, or just one of them?

@pinggit
Copy link

pinggit commented Oct 27, 2019

I tried

jupytext --set-formats ipynb,md,py notebook.ipynb
jupytext --sync

but it does not work....

@mwouts
Copy link
Owner

mwouts commented Oct 28, 2019

I see - the notebook name was missing on the second command. Give a try to

jupytext --set-formats ipynb,md,py notebook.ipynb
jupytext --sync notebook.ipynb

If you have another issue, please quote the outputs of the command. Also it's often helpful to know which version of Jupytext you are using (jupytext --version).

@mwouts
Copy link
Owner

mwouts commented Nov 8, 2019

Hello @githubpsyche , this has been included in the latest RC, available with pip install jupytext==1.3.0rc1. Would you like to make sure it works as you expect?

For a screenshot, see the release notes.

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.

3 participants