Allow automatic toc to be disabled
In some cases, a user may want to disable the automatic table of contents generation in the body of the page. This patch adds a ``display_toc`` option into the theme options list that will disable the automatic TOC in the documentation body. Closes-Bug: 1613761 Change-Id: I508b46c5ba6a022ee4ad2687cb4e44ed449ca4fe
This commit is contained in:
parent
70f6ed6a41
commit
59072440ab
@ -1,6 +1,4 @@
|
||||
{%- if theme_sidebar_mode == 'toctree' %}
|
||||
{%- if display_toc %}
|
||||
{%- if theme_sidebar_mode == 'toctree' and theme_display_toc %}
|
||||
<h5><a href="{{ pathto(master_doc) }}">Contents</a></h5>
|
||||
{{ toc }}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
@ -6,3 +6,4 @@ pygments_style = native
|
||||
[options]
|
||||
analytics_tracking_code = UA-17511903-1
|
||||
sidebar_mode = toctree
|
||||
display_toc = True
|
||||
|
@ -0,0 +1,14 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The automatic table of contents that appears in the body of the
|
||||
documentation can be disabled by setting ``display_toc`` to ``False`` in
|
||||
the ``html_theme_options`` option in ``conf.py``.
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
html_theme_options = {
|
||||
"display_toc": False,
|
||||
}
|
Loading…
Reference in New Issue
Block a user