mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix building with SingleHTMLBuilder when there is no toctree.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,6 +1,8 @@
|
||||
Release 1.0.1 (in development)
|
||||
==============================
|
||||
|
||||
* Fix building with SingleHTMLBuilder when there is no toctree.
|
||||
|
||||
* Fix display names for objects linked to by intersphinx with
|
||||
explicit targets.
|
||||
|
||||
|
||||
@@ -847,8 +847,14 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
|
||||
def get_doc_context(self, docname, body, metatags):
|
||||
# no relation links...
|
||||
toc = self.env.get_toctree_for(self.config.master_doc, self, False)
|
||||
self.fix_refuris(toc)
|
||||
toc = self.render_partial(toc)['fragment']
|
||||
# if there is no toctree, toc is None
|
||||
if toc:
|
||||
self.fix_refuris(toc)
|
||||
toc = self.render_partial(toc)['fragment']
|
||||
display_toc = True
|
||||
else:
|
||||
toc = ''
|
||||
display_toc = False
|
||||
return dict(
|
||||
parents = [],
|
||||
prev = None,
|
||||
@@ -861,7 +867,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
|
||||
rellinks = [],
|
||||
sourcename = '',
|
||||
toc = toc,
|
||||
display_toc = True,
|
||||
display_toc = display_toc,
|
||||
)
|
||||
|
||||
def write(self, *ignored):
|
||||
|
||||
Reference in New Issue
Block a user