Rename :reverse: option of toctree directive to :reversed:

This commit is contained in:
Takeshi KOMIYA 2016-10-12 19:36:49 +09:00
parent f22bbf668d
commit c8fe4a1848
3 changed files with 5 additions and 5 deletions

View File

@ -123,13 +123,13 @@ tables of contents. The ``toctree`` directive is the central element.
toctree directive. This is useful if you want to generate a "sitemap" from
the toctree.
You can use the ``reverse`` flag option to reverse the order of the entries
You can use the ``reversed`` flag option to reverse the order of the entries
in the list. This can be useful when using the ``glob`` flag option to
reverse the ordering of the files. Example::
.. toctree::
:glob:
:reverse:
:reversed:
recipe/*

View File

@ -46,7 +46,7 @@ class TocTree(Directive):
'includehidden': directives.flag,
'numbered': int_or_nothing,
'titlesonly': directives.flag,
'reverse': directives.flag,
'reversed': directives.flag,
}
def run(self):
@ -110,7 +110,7 @@ class TocTree(Directive):
subnode = addnodes.toctree()
subnode['parent'] = env.docname
# entries contains all entries (self references, external links etc.)
if 'reverse' in self.options:
if 'reversed' in self.options:
entries.reverse()
subnode['entries'] = entries
# includefiles only entries that are documents

View File

@ -18,7 +18,7 @@ reversed order
.. toctree::
:glob:
:reverse:
:reversed:
foo
bar/index