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

Escape all Jupyter magics by default #94

Closed
theodcr opened this issue Oct 8, 2018 · 4 comments
Closed

Escape all Jupyter magics by default #94

theodcr opened this issue Oct 8, 2018 · 4 comments

Comments

@theodcr
Copy link
Contributor

theodcr commented Oct 8, 2018

First thanks for this great tool!

I often use the %watermark (https://github.com/rasbt/watermark) magic extension in my notebooks, adding it to the escaped magics would be useful.

I second the idea of adding a configurable list of magics to be escaped as suggested in #35, notably for custom magics.

@mwouts
Copy link
Owner

mwouts commented Oct 8, 2018

Thanks @theolamayo . I'm glad you like it! I had a second look at #35 , and also at the corresponding unit test, and I am now wondering why I did not simply match magics as commands starting with one or two percent signs... Are you aware of any plain Python instruction that would start with a percent sign? Do you think we could actually escape any percent command?

@theodcr
Copy link
Contributor Author

theodcr commented Oct 9, 2018

Indeed I am not aware of any plain Python instruction that starts with a percent sign. You mentioned Pytest features and decorators in #29 (comment) but they start with a @ sign.

Answers on https://stackoverflow.com/questions/961344/what-does-the-percentage-sign-mean-in-python only mention IPython magics as valid instructions starting with a percent sign.

I also think we could escape any percent command.

@mwouts
Copy link
Owner

mwouts commented Oct 9, 2018

Thanks @theolamayo . Probably there had been a sleepless night before #29... sure, pytest decorators start with @, not %! I also doubled check with Doug at #61, all instructions starting with a single percent sign (up to three actually) are magics. I don't have a excuse now not to fix this... I will do that very soon!

@mwouts mwouts changed the title Escape %watermark magic by default Escape all Jupyter magics by default Oct 9, 2018
@mwouts mwouts mentioned this issue Oct 10, 2018
@mwouts
Copy link
Owner

mwouts commented Oct 10, 2018

@theolamayo , the new release (v0.8.0) should have support for all magics. Please reopen if that is not the case! Thanks

@mwouts mwouts closed this as completed Oct 10, 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