jupytext.vim icon indicating copy to clipboard operation
jupytext.vim copied to clipboard

Added support to specify output format for plain text conversion.

Open GCBallesteros opened this issue 5 years ago • 4 comments

A new variable g:jupytext_style can be used to specify the format for the notebook to plain text conversion. For example:

let g:jupytext_style='hydrogen'

to always use the hydrogen format when generating scripts.

If left unspecified it is up to jupytext to decide on the default, in line with the current behaviour.

This is for the benefit of users of other plugins and tools that depend on a specific output format other than the default.

GCBallesteros avatar Sep 30 '20 13:09 GCBallesteros

I don't think this is necessary: you can just set jupytext_fmt to something like py:hydrogen, no?

goerz avatar Oct 02 '20 17:10 goerz

Setting jupytext_fmt to py:hydrogen results in the following error:

Error detected while processing function <SNR>41_read_from_ipynb:
line    5:
Invalid jupytext_fmt: py:hydrogen

This happens because py:hydrogen is not in s:jupytext_extension_map.

Would you be open to a small refactor that decouples the notebook language from the output format?

GCBallesteros avatar Oct 02 '20 18:10 GCBallesteros

I’ll think a bit about what I think is the best solution for this. I may very well still merge your original PR.

goerz avatar Oct 02 '20 18:10 goerz

@goerz what's your current view regarding the PR?

gshpychka avatar Nov 06 '23 14:11 gshpychka