8000 ENH: add HTML Help builder option by cgohlke · Pull Request #3325 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

ENH: add HTML Help builder option #3325

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

Merged
merged 2 commits into from
Jul 31, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ENH: add HTML Help builder option
  • Loading branch information
cgohlke committed Jul 29, 2014
commit 206d3bf4d735a655db0dc16a263d97e084972af3
21 changes: 17 additions & 4 deletions doc/make.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import shutil
import sys
import re

### Begin compatibility block for pre-v2.6: ###
#
Expand Down Expand Up @@ -135,21 +136,32 @@ def doctest():
def linkcheck():
os.system('sphinx-build -b linkcheck -d build/doctrees . build/linkcheck')

def html():
def html(buildername='html'):
check_build()
copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
if small_docs:
options = "-D plot_formats=\"[('png', 80)]\""
else:
options = ''
if os.system('sphinx-build %s -b html -d build/doctrees . build/html' % options):
if os.system('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options, buildername, buildername)):
raise SystemExit("Building HTML failed.")

# Clean out PDF files from the _images directory
for filename in glob.glob('build/html/_images/*.pdf'):
for filename in glob.glob('build/%s/_images/*.pdf' % buildername):
os.remove(filename)

shutil.copy('../CHANGELOG', 'build/html/_static/CHANGELOG')
shutil.copy('../CHANGELOG', 'build/%s/_static/CHANGELOG' % buildername)

def htmlhelp():
html(buildername='htmlhelp')
# remove scripts from index.html
with open('build/htmlhelp/index.html', 'r+') as fh:
content = fh.read()
fh.seek(0)
content = re.sub(r'<script>.*?</script>', '', content,
flags=re.MULTILINE| re.DOTALL)
fh.write(content)
fh.truncate()

def latex():
check_build()
Expand Down Expand Up @@ -213,6 +225,7 @@ def all():

funcd = {
'html' : html,
'htmlhelp' : htmlhelp,
'latex' : latex,
'texinfo' : texinfo,
'clean' : clean,
Expand Down
0