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

Updating MathJax CDN in HTML documents #116

Open
KGHustad opened this issue Jul 19, 2017 · 0 comments
Open

Updating MathJax CDN in HTML documents #116

KGHustad opened this issue Jul 19, 2017 · 0 comments

Comments

@KGHustad
Copy link
Collaborator

The easiest way to update HTML documents to use the new MathJax CDN is to rerun doconce. However, in some circumstances, this may not be possible if the doconce source files have been lost.

A script which fixes the MathJax CDN in HTML documents have been written and tested with the DocOnce documentation. This script is available in utils/fix_mathjax_cdn.py in the repo and https://github.com/hplgit/doconce/blob/master/utils/fix_mathjax_cdn.py

Usage

Standalone

./fix_mathjax_cdn.py <html file>

With find

This script should be paired with find to fix all files in a given directory and its subdirectories.

Say we have the following directory structure

[cwd: doc]$ tree
.
├── fix_mathjax_cdn.py
├── pub
│   ├── book.html
│   ├── book.pdf
│   └── chapters
│       ├── chap1.html
│       ├── chap1.pdf
│       ├── chap2.html
│       ├── chap2.pdf
│       ├── chap3.html
│       └── chap3.pdf

We can use the following command

find . -type f -name '*.html' -exec ./fix_mathjax.py {} \;
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

1 participant