mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Change html_sourcelink_txt -> html_sourcelink_suffix
This commit is contained in:
@@ -870,10 +870,10 @@ that use Sphinx's HTMLWriter class.
|
||||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
.. confval:: html_sourcelink_txt
|
||||
.. confval:: html_sourcelink_suffix
|
||||
|
||||
If true, ``.txt`` is appended to source links (see
|
||||
:confval:`html_show_sourcelink`). Default is ``True``.
|
||||
Suffix to be appended to source links (see :confval:`html_show_sourcelink`),
|
||||
unless they have this suffix already. Default is ``'.txt'``.
|
||||
|
||||
.. versionadded:: 1.5
|
||||
|
||||
|
||||
@@ -409,8 +409,8 @@ class StandaloneHTMLBuilder(Builder):
|
||||
# the name for the copied source
|
||||
if self.config.html_copy_source:
|
||||
sourcename = docname + source_suffix
|
||||
if self.config.html_sourcelink_txt and source_suffix != '.txt':
|
||||
sourcename += '.txt'
|
||||
if source_suffix != self.config.html_sourcelink_suffix:
|
||||
sourcename += self.config.html_sourcelink_suffix
|
||||
else:
|
||||
sourcename = ''
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ class Config(object):
|
||||
html_split_index = (False, 'html'),
|
||||
html_copy_source = (True, 'html'),
|
||||
html_show_sourcelink = (True, 'html'),
|
||||
html_sourcelink_txt = (True, 'html'),
|
||||
html_sourcelink_suffix = ('.txt', 'html'),
|
||||
html_use_opensearch = ('', 'html'),
|
||||
html_file_suffix = (None, 'html', string_classes),
|
||||
html_link_suffix = (None, 'html', string_classes),
|
||||
|
||||
@@ -989,8 +989,8 @@ def test_html_extra_path(app, status, warning):
|
||||
assert (app.outdir / 'background.png').exists()
|
||||
|
||||
|
||||
@with_app(buildername='html', confoverrides={'html_sourcelink_txt': False})
|
||||
def test_html_sourcelink_txt(app, status, warning):
|
||||
@with_app(buildername='html', confoverrides={'html_sourcelink_suffix': ''})
|
||||
def test_html_sourcelink_suffix(app, status, warning):
|
||||
app.builder.build_all()
|
||||
content_otherext = (app.outdir / 'otherext.html').text()
|
||||
content_images = (app.outdir / 'images.html').text()
|
||||
|
||||
Reference in New Issue
Block a user