Skip to content

Commit

Permalink
Corrected offline instructions and added more sed commands to remove …
Browse files Browse the repository at this point in the history
…http calls.
  • Loading branch information
moorepants committed Jun 25, 2024
1 parent 1ad6d19 commit 37fa6db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,14 @@ Created a directory for MathJax v2::
mkdir -p _static/js/
cd _static/js/
wget https://github.com/mathjax/MathJax/archive/refs/tags/2.7.9.zip
unzip MathJax-2.7.9.zip
unzip 2.7.9.zip
mv MathJax-2.7.9/ MathJax/
rm MathJax-2.7.9.zip
rm 2.7.9.zip

Download this JavaScript file also::

wget https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@^1.0.1/dist/embed-amd.js
cd ../../
cd ../..

In ``conf.py`` change these two lines::

Expand All @@ -336,6 +336,11 @@ Make sure ``embed-amd.js`` loads from the local source with::

sed -i "s,https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@^1.0.1/dist,_static/js,g" _build/html/*.html

Remove links to external resources (slows loading on offline computers)::

sed -i 's,<link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>,,g' _build/html/*.html
sed -i 's^<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">^^g' _build/html/*.html
sed -i 's,<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>,,g' _build/html/*.html

Now build the PDF version::

Expand Down

0 comments on commit 37fa6db

Please sign in to comment.