-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add way to install MathJax to a particular profile #4104
Conversation
@@ -225,7 +231,14 @@ def main() : | |||
|
|||
pargs = parser.parse_args() | |||
|
|||
dest = pargs.install_dir | |||
if(pargs.profile): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic needs to be updated a little bit - pargs.profile will never be False, so the else branch will never be taken. You need to modify a little bit to determine what has been specified as opposed to the default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure enough. When testing, thought it was pulling the install_dir default.
(ipyipy)12:03:54 {mathjax_profile} ~/code/ipython$ python -m IPython.external.mathjax --dest --profile=rawnb
/Users/kyle6475/.ipython/profile_rawnb/static/mathjax
(ipyipy)12:04:10 (mathjax_profile) ~/code/ipython$ python -m IPython.external.mathjax --dest
/Users/kyle6475/.ipython/profile_default/static/mathjax
Shame on me.
Do you think it's alright if I just make the profile option not default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to leave the profile as the default behavior, but change it a little bit so that install_dir is empty unless specified, in which case you would reverse the logic:
if pargs.install_dir:
# explicit install_dir overrides profile
dest = pargs.install_dir
else:
# this is normal / default
dest = dest_for_profile(...)
and probably update a docstring or two to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. Then just take the default out of install dir as well? That is much cleaner. I'll update docs where necessary as well.
Add way to install MathJax to a particular profile
Made a quick handler to install MathJax to a specified profile (rather than either only accepting default or requiring knowledge of a full path). Also cleaned up some grammar.
* commit 'rel-1.1.0-3-gb8b89ca': (66 commits) Backport PR ipython#4209: Magic doc fixes Backport PR ipython#4204: remove some extraneous print statements from IPython.parallel back to dev release 1.1.0 don't upload to GitHub in release script 1.1 backport stats Backport PR ipython#4188: Allow user_ns trait to be None Backport PR ipython#4189: always fire LOCAL_IPS.extend(PUBLIC_IPS) Backport PR ipython#4174: various issues in markdown and rst templates Backport PR ipython#4181: nbconvert: Fix, sphinx template not removing new lines from headers Backport PR ipython#4043: don't 'restore_bytes' in from_JSON Backport PR ipython#4178: add missing data_javascript Backport PR ipython#4136: catch javascript errors in any output Backport PR ipython#4163: Fix for incorrect default encoding on Windows. Backport PR ipython#4171: add nbconvert config file when creating profiles Backport PR ipython#4159: don't split `.cell` and `div.cell` CSS Backport PR ipython#4158: generate choices for `--gui` configurable from real mapping Backport PR ipython#4143: update example custom.js Backport PR ipython#4144: help_end transformer shouldn't pick up ? in multiline string Backport PR ipython#4104: Add way to install MathJax to a particular profile ...
Add way to install MathJax to a particular profile
Made a quick handler to install MathJax to a specified profile (rather than either only accepting default or requiring knowledge of a full path).
Also cleaned up some grammar.