Skip to content

Commit adfbf0d

Browse files
author
jensj
committed
Fix mathjax
1 parent fb278d5 commit adfbf0d

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

tools/sphinx.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
#!/usr/bin/python
22
import os
33
import sys
4-
import time
5-
import glob
6-
import trace
74
import tempfile
85

96
if '--dir' in sys.argv:
107
i = sys.argv.index('--dir')
11-
dir = sys.argv[i+1]
8+
dir = sys.argv[i + 1]
129
else:
1310
dir = None
1411

1512
if '--email' in sys.argv:
1613
i = sys.argv.index('--email')
17-
email = sys.argv[i+1]
14+
email = sys.argv[i + 1]
1815
else:
1916
email = None
2017

@@ -26,13 +23,14 @@
2623

2724
if '--tarfiledir' in sys.argv:
2825
i = sys.argv.index('--tarfiledir')
29-
tarfiledir = sys.argv[i+1]
26+
tarfiledir = sys.argv[i + 1]
3027
else:
3128
tarfiledir = None
3229

3330
tmpdir = tempfile.mkdtemp(prefix='ase-sphinx-', dir=dir)
3431
os.chdir(tmpdir)
3532

33+
3634
def build(email):
3735
if os.system('svn checkout ' +
3836
'https://svn.fysik.dtu.dk/projects/ase/trunk ase') != 0:
@@ -89,12 +87,14 @@ def build(email):
8987
fd.write(''.join(errors))
9088
fd.close()
9189
if 1 and email is not None:
92-
x = os.system('mail -s "ASE: EpyDoc errors" %s < epydoc.errors' % email)
90+
x = os.system(
91+
'mail -s "ASE: EpyDoc errors" %s < epydoc.errors' % email)
9392
assert x == 0
9493

9594
os.chdir('doc')
9695
os.mkdir('_build')
97-
if os.system('PYTHONPATH=%s/lib/python sphinx-build . _build' % tmpdir) != 0:
96+
if os.system('PYTHONPATH=%s/lib/python sphinx-build . _build' %
97+
tmpdir) != 0:
9898
raise RuntimeError('Sphinx failed!')
9999
os.system('cd _build; cp _static/searchtools.js .; ' +
100100
'sed -i s/snapshot.tar/%s.tar/ download.html' % version)
@@ -103,11 +103,15 @@ def build(email):
103103
if os.system('PYTHONPATH=%s/lib/python ' % tmpdir +
104104
'sphinx-build -b latex . _build 2> error') != 0:
105105
raise RuntimeError('Sphinx failed!')
106-
os.system(
107-
'grep -v "WARNING: unusable reference target found" error 1>&2')
106+
os.system('grep -v "WARNING: unusable reference target found"' +
107+
'error 1>&2')
108+
# Don't serve mixed content:
109+
assert os.system(
110+
'cd _build; find -name "*.html" | xargs sed -i ' +
111+
'"s%http://cdn.mathjax.org%https://cdn.mathjax.org%"') == 0
108112

109113
os.chdir('_build')
110-
#os.system('cd ../..; ln -s doc/_static')
114+
# os.system('cd ../..; ln -s doc/_static')
111115
if os.system('make ase-manual.pdf 2>&1') != 0:
112116
raise RuntimeError('pdflatex failed!')
113117
else:

0 commit comments

Comments
 (0)