The new `html_show_sourcelink` config value can be used to

switch off the links to the reST sources in the sidebar.
This commit is contained in:
Georg Brandl 2008-12-15 13:38:39 +01:00
parent 037954d850
commit f5cb011e77
6 changed files with 17 additions and 13 deletions

View File

@ -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.

View File

@ -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 <http://opensearch.org>` description file will be

View File

@ -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__,

View File

@ -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),

View File

@ -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/<name>.
#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 <link> tag referring to it. The value of this option must be the

View File

@ -51,16 +51,10 @@
<p class="topless"><a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></p>
{%- endif %}
{%- endblock %}
{%- if sourcename %}
{%- if show_source and has_source %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
{%- if builder == 'web' %}
<li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
<li><a href="{{ pathto('@edit/' + sourcename)|e }}">{{ _('Suggest Change') }}</a></li>
<li><a href="{{ pathto('@source/' + sourcename)|e }}">{{ _('Show Source') }}</a></li>
{%- elif builder == 'html' %}
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">{{ _('Show Source') }}</a></li>
{%- endif %}
</ul>
{%- endif %}
{%- if customsidebar %}
@ -68,15 +62,13 @@
{%- endif %}
{%- block sidebarsearch %}
{%- if pagename != "search" %}
<h3>{% if builder == 'web' %}{{ _('Keyword search')}}{% else %}{{ _('Quick search') }}{% endif %}</h3>
<h3>{{ _('Quick search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
{%- if builder == 'web' %}
<p style="font-size: 90%">{{ _('Enter a module, class or function name.') }}</p>
{%- endif %}
<p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p>
{%- endif %}
{%- endblock %}
</div>