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

Add way to install MathJax to a particular profile #4104

Merged
merged 4 commits into from
Sep 3, 2013

Conversation

rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Aug 24, 2013

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.

@@ -225,7 +231,14 @@ def main() :

pargs = parser.parse_args()

dest = pargs.install_dir
if(pargs.profile):
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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.

minrk added a commit that referenced this pull request Sep 3, 2013
Add way to install MathJax to a particular profile
@minrk minrk merged commit 972ed78 into ipython:master Sep 3, 2013
minrk added a commit that referenced this pull request Sep 4, 2013
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.
@rgbkrk rgbkrk deleted the mathjax_profile branch January 12, 2014 17:28
yarikoptic added a commit to yarikoptic/ipython that referenced this pull request May 2, 2014
* 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
  ...
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Add way to install MathJax to a particular profile
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

Successfully merging this pull request may close these issues.

None yet

2 participants