Take the 2-minute tour ×  Does anyone know any option to order
toctree in descending order of the filenames? In case of
ascending order, we can use :glob: option like this:  ..
toctree:   This would be handy for daily notes written in
restructured text that should be reported within a Sphinx
document.  share|improve this question add comment  2 Answers
up vote 6 down vote accepted  There is no simple option to
reverse-sort the toctree. But you can do it by modifying the
document structure before it is written to file. Here is a
suggestion. Add the following code to conf.py:  def
reverse_toctree(app, doctree, docname):     """Reverse the order
of entries in the root toctree if 'glob' is used."""     if
docname == "index":         for node in doctree.traverse():
if node.tagname == "toctree" and node.get("glob"):  def
setup(app):     app.connect("doctree-resolved", reverse_toctree)
The reverse_toctree() callback function is called when the
doctree-resolved event is fired. The function locates the t