-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the sidebar table of contents
Now "Table of Contents" only appears once on the index page. Apparently it is impossible to include the index page in the table of contents and have it expand its subheadings in the globaltoc. You can use "self", but it doesn't expand the subheadings. If you include "index" it complains about recursive toc. I had to do this manually by modifying the sidebar templates. The result is not ideal (the index page is sidebar styled a little differently from the rest), but it is better than before. I also added "self" so that the main page appears on the global toc for every other page. This makes the main page appear twice on itself. I don't know how to fix that.
- Loading branch information
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
basic/globaltoc.html | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Sphinx sidebar template: global table of contents. | ||
|
||
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
|
||
Modified to work properly with the index page | ||
#} | ||
{{ toctree() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{# | ||
basic/localtoc.html | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
Sphinx sidebar template: local table of contents. | ||
|
||
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
|
||
Modified to work properly with the index page | ||
#} | ||
{%- if display_toc %} | ||
<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> | ||
{{ toc }} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ Contents: | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
self | ||
commandline | ||
recipes | ||
api | ||
|