Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a 'reverse' flag option to 'toctree' #2527
Conversation
tk0miya
added
the
enhancement
label
May 6, 2016
tk0miya
added this to the 1.5 milestone
May 6, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
LGTM |
lehmannro
reviewed
May 6, 2016
| @@ -123,6 +123,16 @@ 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 | ||
| in the list. This can be useful when using the ``glob`` flag option to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lehmannro
May 6, 2016
Contributor
You can take a look at tests/test_toctree.py. It basically uses the HTML builder to then look at the relations between documents (up/next/previous). Writing a test for this PR would thus involve cloning tests/roots/test-glob-toctree into another testroot, enabling :reverse: and checking if the next/previous relationships are now reversed. You could maybe get away a little simpler with looking at the environment's toctrees (builder.env.toctree_includes).
|
You can take a look at |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tk0miya
Aug 13, 2016
Member
Ping. any updates?
We will release major version in this autumn (now planning).
It would be nice if this PR will be included the release.
|
Ping. any updates? It would be nice if this PR will be included the release. |
| @@ -46,6 +46,7 @@ class TocTree(Directive): | ||
| 'includehidden': directives.flag, | ||
| 'numbered': int_or_nothing, | ||
| 'titlesonly': directives.flag, | ||
| 'reverse': directives.flag, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tk0miya
Oct 12, 2016
Member
Which is better reverse or reversed ? I feel reversed is a little better.
tk0miya
Oct 12, 2016
Member
Which is better reverse or reversed ? I feel reversed is a little better.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tk0miya
Oct 12, 2016
Member
I added a testcases at https://github.com/tk0miya/sphinx/tree/2527_reversed_toctree .
As a test, I renamed the option to :reversed: in my branch.
If agreed, I would like to merge the branch. (if not, I'll pick only the testcodes)
Any comments?
|
I added a testcases at https://github.com/tk0miya/sphinx/tree/2527_reversed_toctree . If agreed, I would like to merge the branch. (if not, I'll pick only the testcodes) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
+1 for |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
JohnVillalovos
Oct 12, 2016
reversed sounds good to me too. Matches up with Python built-in function :)
Thanks for doing unit tests. I got confused on what to do.
JohnVillalovos
commented
Oct 12, 2016
|
Thanks for doing unit tests. I got confused on what to do. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tk0miya
Oct 12, 2016
Member
@JohnVillalovos Thank you for comment. I will merge the change by my side later.
|
@JohnVillalovos Thank you for comment. I will merge the change by my side later. |
tk0miya
merged commit ca49c4c
into
sphinx-doc:master
Oct 12, 2016
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Merged. |
JohnVillalovos commentedMay 5, 2016
I'm not sure the best way to do the unit tests. A little confused. So
help would be appreciated :)
Add the ability to reverse the list of entries when using 'toctree'.
This is likely most useful for people using the 'glob' flag option with
'toctree'
Change-Id: I1852479106c3d9c8253fd1625ced0077af0304e3