Add html_link_suffix value.

This commit is contained in:
Georg Brandl
2008-12-25 17:59:32 +01:00
parent dafb55a467
commit a26aa3315f
4 changed files with 19 additions and 1 deletions

View File

@@ -31,6 +31,9 @@ New features added
- The new ``html_show_sourcelink`` config value can be used to
switch off the links to the reST sources in the sidebar.
- The new ``html_link_suffix`` config value can be used to select
the suffix of generated links between HTML files.
* New translations:
- Italian by Sandro Dentella.

View File

@@ -432,6 +432,14 @@ that use Sphinx' HTMLWriter class.
.. versionadded:: 0.4
.. confval:: html_link_suffix
Suffix for generated links to HTML files. The default is whatever
:confval:`html_file_suffix` is set to; it can be set differently (e.g. to
support different web server setups).
.. versionadded:: 0.6
.. confval:: html_translator_class
A string with the fully-qualified name of a HTML Translator class, that is, a

View File

@@ -49,6 +49,7 @@ class StandaloneHTMLBuilder(Builder):
name = 'html'
copysource = True
out_suffix = '.html'
link_suffix = '.html' # defaults to matching out_suffix
indexer_format = js_index
supported_image_types = ['image/svg+xml', 'image/png', 'image/gif',
'image/jpeg']
@@ -65,6 +66,11 @@ class StandaloneHTMLBuilder(Builder):
if self.config.html_file_suffix:
self.out_suffix = self.config.html_file_suffix
if self.config.html_link_suffix is not None:
self.link_suffix = self.config.html_link_suffix
else:
self.link_suffix = self.out_suffix
if self.config.language is not None:
jsfile = path.join(package_dir, 'locale', self.config.language,
'LC_MESSAGES', 'sphinx.js')
@@ -435,7 +441,7 @@ class StandaloneHTMLBuilder(Builder):
# --------- these are overwritten by the serialization builder
def get_target_uri(self, docname, typ=None):
return docname + self.out_suffix
return docname + self.link_suffix
def handle_page(self, pagename, addctx, templatename='page.html',
outfilename=None, event_arg=None):

View File

@@ -72,6 +72,7 @@ class Config(object):
html_show_sourcelink = (True, False),
html_use_opensearch = ('', False),
html_file_suffix = (None, False),
html_link_suffix = (None, False),
html_show_sphinx = (True, False),
html_context = ({}, False),