Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Closed
d-s-codappix opened this issue Oct 17, 2024 · 4 comments · Fixed by #1219
Closed

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

d-s-codappix opened this issue Oct 17, 2024 · 4 comments · Fixed by #1219
Assignees
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.

@jaapio
Copy link
Member

jaapio commented Mar 17, 2025

Thanks @linawolf for implementing this feature

@d-s-codappix
Copy link
Author

Thanks @linawolf. I highly appreciate we will have this feature available again :)

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

Successfully merging a pull request may close this issue.

3 participants