mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove unused files from the HTML help build.
This commit is contained in:
parent
78812d8e7c
commit
9b5566dddb
@ -468,15 +468,16 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
self.handle_page('modindex', modindexcontext, 'modindex.html')
|
self.handle_page('modindex', modindexcontext, 'modindex.html')
|
||||||
|
|
||||||
# the search page
|
# the search page
|
||||||
self.info(' search', nonl=1)
|
if self.name != 'htmlhelp':
|
||||||
self.handle_page('search', {}, 'search.html')
|
self.info(' search', nonl=1)
|
||||||
|
self.handle_page('search', {}, 'search.html')
|
||||||
|
|
||||||
# additional pages from conf.py
|
# additional pages from conf.py
|
||||||
for pagename, template in self.config.html_additional_pages.items():
|
for pagename, template in self.config.html_additional_pages.items():
|
||||||
self.info(' '+pagename, nonl=1)
|
self.info(' '+pagename, nonl=1)
|
||||||
self.handle_page(pagename, {}, template)
|
self.handle_page(pagename, {}, template)
|
||||||
|
|
||||||
if self.config.html_use_opensearch:
|
if self.config.html_use_opensearch and self.name != 'htmlhelp':
|
||||||
self.info(' opensearch', nonl=1)
|
self.info(' opensearch', nonl=1)
|
||||||
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
||||||
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
||||||
|
@ -135,9 +135,10 @@ def build_hhx(builder, outdir, outname):
|
|||||||
outdir += os.sep
|
outdir += os.sep
|
||||||
olen = len(outdir)
|
olen = len(outdir)
|
||||||
for root, dirs, files in os.walk(outdir):
|
for root, dirs, files in os.walk(outdir):
|
||||||
|
staticdir = (root == path.join(outdir, '_static'))
|
||||||
for fn in files:
|
for fn in files:
|
||||||
if fn.endswith('.html') or fn.endswith('.css') or fn.endswith('.js'):
|
if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'):
|
||||||
print >>f, path.join(root, fn)[olen:].replace('/', '\\')
|
print >>f, path.join(root, fn)[olen:].replace(os.sep, '\\')
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user