mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with 1.0
This commit is contained in:
commit
7fe2f8ca5b
@ -696,7 +696,10 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
return uri
|
return uri
|
||||||
ctx['pathto'] = pathto
|
ctx['pathto'] = pathto
|
||||||
ctx['hasdoc'] = lambda name: name in self.env.all_docs
|
ctx['hasdoc'] = lambda name: name in self.env.all_docs
|
||||||
|
if self.name != 'htmlhelp':
|
||||||
ctx['encoding'] = encoding = self.config.html_output_encoding
|
ctx['encoding'] = encoding = self.config.html_output_encoding
|
||||||
|
else:
|
||||||
|
ctx['encoding'] = encoding = self.encoding
|
||||||
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
|
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
|
||||||
self.add_sidebars(pagename, ctx)
|
self.add_sidebars(pagename, ctx)
|
||||||
ctx.update(addctx)
|
ctx.update(addctx)
|
||||||
|
@ -258,8 +258,8 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
|
|||||||
def write_index(title, refs, subitems):
|
def write_index(title, refs, subitems):
|
||||||
def write_param(name, value):
|
def write_param(name, value):
|
||||||
item = ' <param name="%s" value="%s">\n' % (name, value)
|
item = ' <param name="%s" value="%s">\n' % (name, value)
|
||||||
f.write(item.encode('ascii', 'xmlcharrefreplace')
|
f.write(item.encode(self.encoding, 'xmlcharrefreplace')
|
||||||
.decode('ascii'))
|
.decode(self.encoding))
|
||||||
title = cgi.escape(title)
|
title = cgi.escape(title)
|
||||||
f.write('<LI> <OBJECT type="text/sitemap">\n')
|
f.write('<LI> <OBJECT type="text/sitemap">\n')
|
||||||
write_param('Keyword', title)
|
write_param('Keyword', title)
|
||||||
|
@ -120,7 +120,7 @@ def load_grammar(gt="Grammar.txt", gp=None,
|
|||||||
head, tail = os.path.splitext(gt)
|
head, tail = os.path.splitext(gt)
|
||||||
if tail == ".txt":
|
if tail == ".txt":
|
||||||
tail = ""
|
tail = ""
|
||||||
gp = head + tail + ".".join(map(str, sys.version_info)) + ".pickle"
|
gp = head + tail + ".".join(map(str, sys.version_info[:2])) + ".pickle"
|
||||||
if force or not _newer(gp, gt):
|
if force or not _newer(gp, gt):
|
||||||
logger.info("Generating grammar tables from %s", gt)
|
logger.info("Generating grammar tables from %s", gt)
|
||||||
g = pgen.generate_grammar(gt)
|
g = pgen.generate_grammar(gt)
|
||||||
|
Loading…
Reference in New Issue
Block a user