Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Holscher <eric@ericholscher.com>2015-06-06 23:12:56 +0300
committerEric Holscher <eric@ericholscher.com>2015-06-06 23:12:56 +0300
commit5f6503c905e67c12b6050e1f49682feab0389126 (patch)
tree9b162bd86e96037055962d3310cd0f756bc6d52e /sphinx/builders
parent42f2b305791507e6bfe9507832daefc5071969cd (diff)
Add suffix to HTML context. Fixes #1873
Diffstat (limited to 'sphinx/builders')
-rw-r--r--sphinx/builders/html.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 431ac4091..885e3d127 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -408,6 +408,9 @@ class StandaloneHTMLBuilder(Builder):
# metadata for the document
meta = self.env.metadata.get(docname)
+ # Suffix for the document
+ source_suffix = '.' + self.env.doc2path(docname).split('.')[-1]
+
# local TOC and global TOC tree
self_toc = self.env.get_toc_for(docname, self)
toc = self.render_partial(self_toc)['fragment']
@@ -425,6 +428,7 @@ class StandaloneHTMLBuilder(Builder):
toc = toc,
# only display a TOC if there's more than one item to show
display_toc = (self.env.toc_num_entries[docname] > 1),
+ page_source_suffix = source_suffix,
)
def write_doc(self, docname, doctree):