diff --git a/CHANGES b/CHANGES index 7834e94ab..63fb2db8c 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,9 @@ New features added switch off the generated "paragraph sign" permalinks for each heading and definition environment. + - The new ``html_show_sourcelink`` config value can be used to + switch off the links to the reST sources in the sidebar. + * New translations: - Italian by Sandro Dentella. diff --git a/doc/config.rst b/doc/config.rst index 91cc7c3fc..a090da1ce 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -409,6 +409,13 @@ that use Sphinx' HTMLWriter class. will only display the titles of matching documents, and no excerpt from the matching contents. +.. confval:: html_show_sourcelink + + If true (and :confval:`html_copy_source` is true as well), links to the + reST sources will be added to the sidebar. The default is ``True``. + + .. versionadded:: 0.6 + .. confval:: html_use_opensearch If nonempty, an `OpenSearch ` description file will be diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 67b3557de..fbe617175 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -142,6 +142,7 @@ class StandaloneHTMLBuilder(Builder): shorttitle = self.config.html_short_title, show_sphinx = self.config.html_show_sphinx, has_source = self.config.html_copy_source, + show_source = self.config.html_show_sourcelink, file_suffix = self.out_suffix, script_files = self.script_files, sphinx_version = __version__, diff --git a/sphinx/config.py b/sphinx/config.py index 1ea5f66f7..d12b8e903 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -69,6 +69,7 @@ class Config(object): html_use_index = (True, False), html_split_index = (False, False), html_copy_source = (True, False), + html_show_sourcelink = (True, False), html_use_opensearch = ('', False), html_file_suffix = (None, False), html_show_sphinx = (True, False), diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 1f0765756..91213f322 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -165,8 +165,8 @@ html_static_path = ['%(dot)sstatic'] # If true, the index is split into individual pages for each letter. #html_split_index = False -# If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the diff --git a/sphinx/templates/layout.html b/sphinx/templates/layout.html index d9c9045d3..0ef14e45a 100644 --- a/sphinx/templates/layout.html +++ b/sphinx/templates/layout.html @@ -51,16 +51,10 @@

{{ next.title }}

{%- endif %} {%- endblock %} - {%- if sourcename %} + {%- if show_source and has_source %}

{{ _('This Page') }}

{%- endif %} {%- if customsidebar %} @@ -68,15 +62,13 @@ {%- endif %} {%- block sidebarsearch %} {%- if pagename != "search" %} -

{% if builder == 'web' %}{{ _('Keyword search')}}{% else %}{{ _('Quick search') }}{% endif %}

+

{{ _('Quick search') }}

- {%- if builder == 'web' %} -

{{ _('Enter a module, class or function name.') }}

- {%- endif %} +

{{ _('Enter search terms or a module, class or function name.') }}

{%- endif %} {%- endblock %}