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

Support Sphinx :reversed: on .. toctree:: #1148

Open
d-s-codappix opened this issue Oct 17, 2024 · 2 comments
Open

Support Sphinx :reversed: on .. toctree:: #1148

d-s-codappix opened this issue Oct 17, 2024 · 2 comments
Labels

Comments

@d-s-codappix
Copy link

d-s-codappix commented Oct 17, 2024

Feature request

The .. toctree:: directive of Sphinx has an option :reversed: which will invert the order of entries: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-option-toctree-reversed

This is useful for situations like:

.. _changelog:

Changelog
=========

.. toctree::
   :glob:
   :reversed:

   Changelog/*

That way newest versions are at the top.

Would be cool to have that supported. Right now the option seems to be ignored.

We use this here: https://github.com/werkraum-media/events/blob/main/Documentation/Changelog.rst rendered result: https://docs.typo3.org/p/werkraummedia/events/main/en-us/Changelog.html

@jaapio
Copy link
Member

jaapio commented Oct 17, 2024

If I get this right it will only order the documents in reverse not the sub headings?

@d-s-codappix
Copy link
Author

d-s-codappix commented Oct 28, 2024

To be honest: I don't know but good question.
https://github.com/sphinx-doc/sphinx/blob/116a430caca98580c8877cf7b0ba270eae9604bf/sphinx/directives/other.py#L62 looks to be the implementation of sphinx, which seem to reverse both.

But https://docs.typo3.org/p/werkraummedia/events/main/en-us/Changelog.html shows that only the files seem to be reversed. Maybe TYPO3 used an older version of Sphinx. But I guess it will only reverse the top level? Like you wrote, not the sub headings.

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

No branches or pull requests

2 participants