Stop generating invalid doctree if "use_latex_toc" setting is True.
commitb39bf40978bf51dd8865efe4673ba9846158d062
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 21 May 2024 21:09:47 +0000 (21 21:09 +0000)
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 21 May 2024 21:09:47 +0000 (21 21:09 +0000)
tree7c8c204eadf92d6b813b4175796c98bf1cf37e82
parentadc502f0ac04f9212d64363caa3ac2c5bba3ea62
Stop generating invalid doctree if "use_latex_toc" setting is True.

The "use_latex_toc" setting tells Docutils to leave the ToC generation
LaTeX (to get a ToC with page numbers).

The "contents" directive generates a `<topic>` node with a nested
`<pending>` node. By default, the `parts.Contents` transform replaces
the `<pending>` node with a generated ToC in a `<bullet_list>`.

Keep the `<pending>` node if "use_latex_toc" is True to avoid an
empty (and hence invalid) `<topic>`.

Change the LaTeX writer to extract the value of the "content"
directive's options from the `<pending>` node.

This allows to drop "local" and "depth" from the attribute list of
`<topic>`, the "attributes reference" section in doctree.txt, and
the valid attributes in nodes.py.

git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@9719 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
docutils/docs/ref/doctree.txt
docutils/docs/ref/docutils.dtd
docutils/docutils/nodes.py
docutils/docutils/transforms/parts.py
docutils/docutils/writers/latex2e/__init__.py
docutils/test/test_writers/test_latex2e_misc.py