Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect badly formed document headers #10

Open
cgay opened this issue Jan 28, 2025 · 1 comment
Open

Detect badly formed document headers #10

cgay opened this issue Jan 28, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@cgay
Copy link
Member

cgay commented Jan 28, 2025

To be included in the package docs an index.rst file should contain exactly one top-level header or else both headers will show up in the main Table of Contents. For example, the main ToC looks like this:

.. toctree::
   :hidden:
   :maxdepth: 1
   :caption: Packages

   anaphora <anaphora/index>
   base64 <base64/index>
   ...

and if anaphora/index.rst looks like this:

Anaphora
========

[...]
Anaphoric macros
----------------

This library currently implements:

* :macro:`aif`

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

then both "Anaphora" and "Indices and tables" show up in the main ToC. We should be able to detect this with a scan of index.rst looking for any headers that are the same level as the first header.

@cgay cgay added the enhancement New feature or request label Jan 28, 2025
@cgay
Copy link
Member Author

cgay commented Jan 28, 2025

Would be nice to give a warning about this when deft publish is being run, in addition to detecting it when gendoc runs, so the package author can fix it proactively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant