Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/configuring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'vcs_pageview_mode': '',
'versions_menu': True,
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
Expand All @@ -49,6 +50,7 @@ Base options
* ``vcs_pageview_mode`` String. Changes how to view files when using `display_github`, `display_gitlab`, etc.
When using Github or Gitlab this can be: `blob` (default), `edit`, or `raw`,
on Bitbucket, this can be either: `view` (default) or `edit`.
* ``versions_menu`` Bool. Whether or not to show the bottom left menu listing the versions and links to VCS repository.

TOC Options
~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions sphinx_rtd_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ display_version = True
prev_next_buttons_location = bottom
style_external_links = False
vcs_pageview_mode =
versions_menu = True
5 changes: 4 additions & 1 deletion sphinx_rtd_theme/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{% if theme_versions_menu %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should go above, on the include versions.html part? Do we really want all the above HTML in the theme around versions when there isn't a version menu to display?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need this for the ajax call though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up the whitespace with {%- if theme_versions_menu %} else we get 20 blank lines if this is false

http://jinja.pocoo.org/docs/2.10/templates/#whitespace-control

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should ask explicitly if this true and cast it to bool.

<dl>
<dt>{{ _('Versions') }}</dt>
{% for slug, url in versions %}
Expand All @@ -30,7 +31,9 @@
</dl>
<hr/>
{% trans %}Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>.{% endtrans %}

{% else %}
{# This content is injected by an AJAX call to readthedocs.org/readthedocs.com #}
{% endif %}
</div>
</div>
{% endif %}
Expand Down