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

Why should Jupyter magic commands be commented out in Markdown? #40

Closed
lebigot opened this issue Aug 28, 2018 · 3 comments
Closed

Why should Jupyter magic commands be commented out in Markdown? #40

lebigot opened this issue Aug 28, 2018 · 3 comments

Comments

@lebigot
Copy link

lebigot commented Aug 28, 2018

Jupyter magic commands (like %%time) currently appear commented out in Markdown. The problem is that the rendered version (say in HTML in a web browser) looks different from the notebook, which is surprising.

I can understand that it is useful to comment these magic commands in the Python (.py) version, but is it really necessary to comment them out in the Markdown output? Can't the Markdown output be less surprising?

@mwouts
Copy link
Owner

mwouts commented Aug 28, 2018

Thanks @lebigot for reporting. May I ask how you render (R) Markdown files? I would have expected users to render .Rmd files with R -e "rmarkdown::render('notebook.Rmd')", which probably does not support Jupyter magics.

For now there's no global option to avoid escaping of magic commands ; if you'd like one we could discuss its specifications. Meanwhile you may find useful to add a #noescape comment on the same line as the magic.

@lebigot
Copy link
Author

lebigot commented Aug 28, 2018

I was using MacDown, which displays Markdown. As I am not an R user, and since I do not want to install R on my machine just for visualizing something that looks quite standard, this looked like a reasonable approach. :)

Maybe the problem comes from the fact that I was expecting R Markdown to be essentially the same as Markdown, with maybe some distinct meta-data in the header (a quick search didn't yield anything)? In a .md version of a notebook, I would expect the %%magic commands to be displayed just like in the Jupyter notebook.

@mwouts
Copy link
Owner

mwouts commented Aug 31, 2018

@lebigot , the package now offers support for plain markdown documents, cf. #44 . I close this issue, but feedback is welcome !

@mwouts mwouts closed this as completed Aug 31, 2018
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