mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Format directive options and add some missing ones (#12779)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
eb6ff0a258
commit
49c3b21c60
@ -117,7 +117,7 @@ The ``toctree`` directive is the central element.
|
|||||||
.. versionchanged:: 0.6
|
.. versionchanged:: 0.6
|
||||||
Added support for external links and "self" references.
|
Added support for external links and "self" references.
|
||||||
|
|
||||||
.. rubric:: options
|
.. rubric:: Options
|
||||||
|
|
||||||
.. rst:directive:option:: class: class names
|
.. rst:directive:option:: class: class names
|
||||||
:type: a list of class names, separated by spaces
|
:type: a list of class names, separated by spaces
|
||||||
@ -562,6 +562,27 @@ Presentational
|
|||||||
A rubric is like an informal heading that doesn't correspond to the document's structure,
|
A rubric is like an informal heading that doesn't correspond to the document's structure,
|
||||||
i.e. it does not create a table of contents node.
|
i.e. it does not create a table of contents node.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If the *title* of the rubric is "Footnotes" (or the selected language's
|
||||||
|
equivalent), this rubric is ignored by the LaTeX writer, since it is
|
||||||
|
assumed to only contain footnote definitions and therefore would create an
|
||||||
|
empty heading.
|
||||||
|
|
||||||
|
.. rubric:: Options
|
||||||
|
|
||||||
|
.. rst:directive:option:: class: class names
|
||||||
|
:type: a list of class names, separated by spaces
|
||||||
|
|
||||||
|
Assign `class attributes`_.
|
||||||
|
This is a :dudir:`common option <common-options>`.
|
||||||
|
|
||||||
|
.. rst:directive:option:: name: label
|
||||||
|
:type: text
|
||||||
|
|
||||||
|
An implicit target name that can be referenced using :rst:role:`ref`.
|
||||||
|
This is a :dudir:`common option <common-options>`.
|
||||||
|
|
||||||
.. rst:directive:option:: heading-level: n
|
.. rst:directive:option:: heading-level: n
|
||||||
:type: number from 1 to 6
|
:type: number from 1 to 6
|
||||||
|
|
||||||
@ -572,12 +593,6 @@ Presentational
|
|||||||
or as the corresponding non-numbered sectioning command for LaTeX
|
or as the corresponding non-numbered sectioning command for LaTeX
|
||||||
(see :confval:`latex_toplevel_sectioning`).
|
(see :confval:`latex_toplevel_sectioning`).
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
If the *title* of the rubric is "Footnotes" (or the selected language's
|
|
||||||
equivalent), this rubric is ignored by the LaTeX writer, since it is
|
|
||||||
assumed to only contain footnote definitions and therefore would create an
|
|
||||||
empty heading.
|
|
||||||
|
|
||||||
.. rst:directive:: centered
|
.. rst:directive:: centered
|
||||||
|
|
||||||
@ -594,8 +609,13 @@ Presentational
|
|||||||
compact list by either distributing more than one item horizontally, or
|
compact list by either distributing more than one item horizontally, or
|
||||||
reducing spacing between items, depending on the builder.
|
reducing spacing between items, depending on the builder.
|
||||||
|
|
||||||
For builders that support the horizontal distribution, there is a ``columns``
|
.. rubric:: Options
|
||||||
option that specifies the number of columns; it defaults to 2. Example::
|
|
||||||
|
.. rst:directive:option:: columns: n
|
||||||
|
:type: int
|
||||||
|
|
||||||
|
The number of columns; defaults to 2.
|
||||||
|
For example::
|
||||||
|
|
||||||
.. hlist::
|
.. hlist::
|
||||||
:columns: 3
|
:columns: 3
|
||||||
@ -678,7 +698,7 @@ __ https://pygments.org/docs/lexers
|
|||||||
As discussed previously, *language* can be any lexer alias supported by
|
As discussed previously, *language* can be any lexer alias supported by
|
||||||
Pygments.
|
Pygments.
|
||||||
|
|
||||||
.. rubric:: options
|
.. rubric:: Options
|
||||||
|
|
||||||
.. rst:directive:option:: linenothreshold: threshold
|
.. rst:directive:option:: linenothreshold: threshold
|
||||||
:type: number (optional)
|
:type: number (optional)
|
||||||
@ -723,7 +743,7 @@ __ https://pygments.org/docs/lexers
|
|||||||
.. versionchanged:: 2.0
|
.. versionchanged:: 2.0
|
||||||
The ``language`` argument becomes optional.
|
The ``language`` argument becomes optional.
|
||||||
|
|
||||||
.. rubric:: options
|
.. rubric:: Options
|
||||||
|
|
||||||
.. rst:directive:option:: linenos
|
.. rst:directive:option:: linenos
|
||||||
:type: no value
|
:type: no value
|
||||||
@ -1050,9 +1070,6 @@ Glossary
|
|||||||
text only have "term" part. In this case, translated "localized term" will be
|
text only have "term" part. In this case, translated "localized term" will be
|
||||||
categorized in "key" group.
|
categorized in "key" group.
|
||||||
|
|
||||||
.. versionadded:: 0.6
|
|
||||||
You can now give the glossary directive a ``:sorted:`` flag that will
|
|
||||||
automatically sort the entries alphabetically.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.1
|
.. versionchanged:: 1.1
|
||||||
Now supports multiple terms and inline markup in terms.
|
Now supports multiple terms and inline markup in terms.
|
||||||
@ -1060,9 +1077,19 @@ Glossary
|
|||||||
.. versionchanged:: 1.4
|
.. versionchanged:: 1.4
|
||||||
Index key for glossary term should be considered *experimental*.
|
Index key for glossary term should be considered *experimental*.
|
||||||
|
|
||||||
|
|
||||||
|
.. rubric:: Options
|
||||||
|
|
||||||
|
.. rst:directive:option:: sorted
|
||||||
|
|
||||||
|
Sort the entries alphabetically.
|
||||||
|
|
||||||
|
.. versionadded:: 0.6
|
||||||
|
|
||||||
.. versionchanged:: 4.4
|
.. versionchanged:: 4.4
|
||||||
In internationalized documentation, the ``:sorted:`` flag sorts
|
In internationalized documentation, sort according to translated terms.
|
||||||
according to translated terms.
|
|
||||||
|
|
||||||
|
|
||||||
Meta-information markup
|
Meta-information markup
|
||||||
-----------------------
|
-----------------------
|
||||||
@ -1211,7 +1238,7 @@ mainly contained in information units, such as the language reference.
|
|||||||
.. versionchanged:: 1.1
|
.. versionchanged:: 1.1
|
||||||
Added ``see`` and ``seealso`` types, as well as marking main entries.
|
Added ``see`` and ``seealso`` types, as well as marking main entries.
|
||||||
|
|
||||||
.. rubric:: options
|
.. rubric:: Options
|
||||||
|
|
||||||
.. rst:directive:option:: name: a label for hyperlink
|
.. rst:directive:option:: name: a label for hyperlink
|
||||||
:type: text
|
:type: text
|
||||||
@ -1415,15 +1442,37 @@ or use Python raw strings (``r"raw"``).
|
|||||||
|
|
||||||
.. math:: (a + b)^2 = a^2 + 2ab + b^2
|
.. math:: (a + b)^2 = a^2 + 2ab + b^2
|
||||||
|
|
||||||
|
.. rubric:: Options
|
||||||
|
|
||||||
|
.. rst:directive:option:: class: class names
|
||||||
|
:type: a list of class names, separated by spaces
|
||||||
|
|
||||||
|
Assign `class attributes`_.
|
||||||
|
This is a :dudir:`common option <common-options>`.
|
||||||
|
|
||||||
|
.. _class attributes: https://docutils.sourceforge.io/docs/ref/doctree.html#classes
|
||||||
|
|
||||||
|
.. rst:directive:option:: name: label
|
||||||
|
:type: text
|
||||||
|
|
||||||
|
An implicit target name that can be referenced using :rst:role:`ref`.
|
||||||
|
This is a :dudir:`common option <common-options>`.
|
||||||
|
|
||||||
|
.. rst:directive:option:: label: label
|
||||||
|
:type: text
|
||||||
|
|
||||||
Normally, equations are not numbered. If you want your equation to get a
|
Normally, equations are not numbered. If you want your equation to get a
|
||||||
number, use the ``label`` option. When given, it selects an internal label
|
number, use the ``label`` option. When given, it selects an internal label
|
||||||
for the equation, by which it can be cross-referenced, and causes an equation
|
for the equation, by which it can be cross-referenced, and causes an equation
|
||||||
number to be issued. See :rst:role:`eq` for an example. The numbering
|
number to be issued. See :rst:role:`eq` for an example. The numbering
|
||||||
style depends on the output format.
|
style depends on the output format.
|
||||||
|
|
||||||
There is also an option ``nowrap`` that prevents any wrapping of the given
|
.. rst:directive:option:: nowrap
|
||||||
math in a math environment. When you give this option, you must make sure
|
|
||||||
yourself that the math is properly set up. For example::
|
Prevent wrapping of the given math in a math environment.
|
||||||
|
When you give this option, you must make sure
|
||||||
|
yourself that the math is properly set up.
|
||||||
|
For example::
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
:nowrap:
|
:nowrap:
|
||||||
|
Loading…
Reference in New Issue
Block a user