Add a class option to the toctree directive (#12524)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Tim HoffmannandAdam Turner authored and GitHub committed 2024-07-10 11:07:49 +01:00
1 parent c67ef51df9
commit a95d716f7f
5 files changed
+32 -1

No files matched your search

+6
View File
@@ -380,6 +380,12 @@ Docutils supports the following directives:
When the default domain contains a ``class`` directive, this directive
will be shadowed. Therefore, Sphinx re-exports it as ``rst-class``.
.. tip::
If you want to add a class to a directive,
you may consider the ``:class:`` :dudir:`option <common-options>` instead,
which is supported by most directives and allows for a more compact notation.
* HTML specifics:
- :dudir:`meta`
@@ -124,6 +124,14 @@ tables of contents. The ``toctree`` directive is the central element.
foo
As with :dudir:`most directives <common-options>`,
you can use the ``class`` option to assign `class attributes`_::
.. toctree::
:class: custom-toc
.. _class attributes: https://docutils.sourceforge.io/docs/ref/doctree.html#classes
If you want only the titles of documents in the tree to show up, not other
headings of the same level, you can use the ``titlesonly`` option::