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

Support html language #179

Closed
technic opened this issue Feb 15, 2019 · 6 comments
Closed

Support html language #179

technic opened this issue Feb 15, 2019 · 6 comments

Comments

@technic
Copy link

technic commented Feb 15, 2019

Hi,
%%html cell magic is not converted to py:percent correctly.
%%javascript, %%bash and others seem to work well.
I think we just need to add it to languages.py.

@mwouts
Copy link
Owner

mwouts commented Feb 15, 2019

Hello @technic , thanks for reporting this. I will cover this with an additional test, and hopefully fix it soon! By the way, are you aware of an explicit list of all languages that one can have in a notebook cell?

@technic
Copy link
Author

technic commented Feb 15, 2019

Thanks!
@mwouts
Well, this is ipython cell magic, and in principle additional plugins, or users can add their custom languages.
So, unfortunately the complete list is not possible, but html is upstream. The upstream list is in the documentation.
Maybe we can have a metadata field as a hint for jupytext, that the field is not a valid python code (or is there one already?).

@mwouts
Copy link
Owner

mwouts commented Feb 15, 2019

Interesting! Well there is a large majority of cell magics for which the content of the cell should be escaped... I will have a look at this.

Maybe we can have a metadata field as a hint for jupytext, that the field is not a valid python code (or is there one already?).

Yes! You can tag your cells with the active="ipynb" metadata, as documented here.

@mwouts
Copy link
Owner

mwouts commented Feb 16, 2019

I plan to do the following

  1. In the percent and light format, comment out all cells that start with a cell magics. @dsblank , are you aware of any cell magic that should not turn the cell into an inactive one in scripts?
  2. In the hydrogen format, cells magics should appear verbatim in the text representation. I have tested a few of them and they all work!

image

mwouts added a commit that referenced this issue Feb 16, 2019
Hydrogen allows cell magics just like in the Jupyter Notebook. There's no need to comment out these cells.
mwouts added a commit that referenced this issue Feb 16, 2019
Because they include magic commands #179
@mwouts
Copy link
Owner

mwouts commented Feb 16, 2019

  1. In the percent and light format, comment out all cells that start with a cell magics. @dsblank , are you aware of any cell magic that should not turn the cell into an inactive one in scripts?

I found one: %%time! So I will still check that the cell magic is a Jupyter language, and just allow html and latex there...

mwouts added a commit that referenced this issue Feb 16, 2019
@mwouts
Copy link
Owner

mwouts commented Feb 16, 2019

Hello @technic , I expect this to be fixed in the latest RC:

pip install jupytext==1.0.0-rc5

Can you please test and confirm that it now works as expected? Thanks

@mwouts mwouts closed this as completed in c6c6a53 Feb 18, 2019
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

No branches or pull requests

2 participants