2018-04-14 09:15:31 -05:00
|
|
|
.. highlight:: rst
|
2017-11-03 09:35:20 -05:00
|
|
|
|
|
|
|
===========
|
|
|
|
Field Lists
|
|
|
|
===========
|
|
|
|
|
|
|
|
:ref:`As previously discussed <rst-field-lists>`, field lists are sequences of
|
|
|
|
fields marked up like this::
|
|
|
|
|
|
|
|
:fieldname: Field content
|
|
|
|
|
2020-07-23 19:39:20 -05:00
|
|
|
Sphinx extends standard docutils behavior for field lists and adds some extra
|
|
|
|
functionality that is covered in this section.
|
2020-07-02 16:22:19 -05:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The values of field lists will be parsed as
|
|
|
|
strings. You cannot use Python collections such as lists or dictionaries.
|
|
|
|
|
2017-11-03 09:35:20 -05:00
|
|
|
|
|
|
|
.. _metadata:
|
|
|
|
|
|
|
|
File-wide metadata
|
|
|
|
------------------
|
|
|
|
|
|
|
|
A field list near the top of a file is normally parsed by docutils as the
|
2020-07-02 16:22:19 -05:00
|
|
|
*docinfo* and shown on the page. However, in Sphinx, a field list preceding
|
|
|
|
any other markup is moved from the *docinfo* to the Sphinx environment as
|
|
|
|
document metadata, and is not displayed in the output.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
A field list appearing after the document title *will* be part of the
|
|
|
|
*docinfo* as normal and will be displayed in the output.
|
|
|
|
|
|
|
|
|
|
|
|
Special metadata fields
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
Sphinx provides custom behavior for bibliographic fields compared to docutils.
|
2017-11-03 09:35:20 -05:00
|
|
|
|
|
|
|
At the moment, these metadata fields are recognized:
|
|
|
|
|
|
|
|
``tocdepth``
|
|
|
|
The maximum depth for a table of contents of this file. ::
|
|
|
|
|
|
|
|
:tocdepth: 2
|
|
|
|
|
2020-02-07 08:59:20 -06:00
|
|
|
.. note::
|
|
|
|
|
2024-05-06 21:49:08 -05:00
|
|
|
This metadata affects the depth of the local toctree. But it does not
|
|
|
|
affect the depth of the *global* toctree. So this does not change
|
|
|
|
the sidebar of themes that use the global toctree.
|
2020-02-07 08:59:20 -06:00
|
|
|
|
2017-11-03 09:35:20 -05:00
|
|
|
.. versionadded:: 0.4
|
|
|
|
|
|
|
|
``nocomments``
|
|
|
|
If set, the web application won't display a comment form for a page
|
|
|
|
generated from this source file. ::
|
|
|
|
|
|
|
|
:nocomments:
|
|
|
|
|
|
|
|
``orphan``
|
|
|
|
If set, warnings about this file not being included in any toctree will be
|
|
|
|
suppressed. ::
|
|
|
|
|
|
|
|
:orphan:
|
|
|
|
|
|
|
|
.. versionadded:: 1.0
|
2020-01-25 07:26:19 -06:00
|
|
|
|
|
|
|
``nosearch``
|
|
|
|
If set, full text search for this file is disabled. ::
|
|
|
|
|
|
|
|
:nosearch:
|
|
|
|
|
2024-03-17 08:45:56 -05:00
|
|
|
.. note:: object search is still available even if ``nosearch`` option is set.
|
2020-01-25 07:26:19 -06:00
|
|
|
|
2020-03-05 05:40:35 -06:00
|
|
|
.. versionadded:: 3.0
|