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
|
||||
ctx['pathto'] = pathto
|
||||
ctx['hasdoc'] = lambda name: name in self.env.all_docs
|
||||
ctx['encoding'] = encoding = self.config.html_output_encoding
|
||||
if self.name != 'htmlhelp':
|
||||
ctx['encoding'] = encoding = self.config.html_output_encoding
|
||||
else:
|
||||
ctx['encoding'] = encoding = self.encoding
|
||||
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
|
||||
self.add_sidebars(pagename, ctx)
|
||||
ctx.update(addctx)
|
||||
|
@ -258,8 +258,8 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
|
||||
def write_index(title, refs, subitems):
|
||||
def write_param(name, value):
|
||||
item = ' <param name="%s" value="%s">\n' % (name, value)
|
||||
f.write(item.encode('ascii', 'xmlcharrefreplace')
|
||||
.decode('ascii'))
|
||||
f.write(item.encode(self.encoding, 'xmlcharrefreplace')
|
||||
.decode(self.encoding))
|
||||
title = cgi.escape(title)
|
||||
f.write('<LI> <OBJECT type="text/sitemap">\n')
|
||||
write_param('Keyword', title)
|
||||
|
@ -120,7 +120,7 @@ def load_grammar(gt="Grammar.txt", gp=None,
|
||||
head, tail = os.path.splitext(gt)
|
||||
if tail == ".txt":
|
||||
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):
|
||||
logger.info("Generating grammar tables from %s", gt)
|
||||
g = pgen.generate_grammar(gt)
|
||||
|
Loading…
Reference in New Issue
Block a user