From 04520a0476b0c0cb66dde1ce143c0550c9ffc8ee Mon Sep 17 00:00:00 2001 From: jpsenior Date: Wed, 31 Jan 2018 19:46:14 -0700 Subject: [PATCH] #463 - Add github, gitlab, bitbucket page arguments option (#464) This currently defaults to current behavior but can be changed with `vcs_pageview_mode` --- docs/configuring.rst | 17 +++++++++++++++-- sphinx_rtd_theme/breadcrumbs.html | 6 +++--- sphinx_rtd_theme/theme.conf | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/configuring.rst b/docs/configuring.rst index 815d1713..893ca08a 100644 --- a/docs/configuring.rst +++ b/docs/configuring.rst @@ -8,6 +8,9 @@ You can configure different parts of the theme. Project-wide Configuration ========================== +HTML Theme Options +------------------ + The theme's project-wide options are defined in the ``sphinx_rtd_theme/theme.conf`` file of this repository, and can be defined in your project's ``conf.py`` via ``html_theme_options``. For example: @@ -21,6 +24,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via 'display_version': True, 'prev_next_buttons_location': bottom, 'style_external_links': False, + 'vcs_pageview_mode': '', # Toc options 'collapse_navigation': False, 'sticky_navigation': True, @@ -32,7 +36,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via The following options are available: Base options ------------- +~~~~~~~~~~~~ * ``canonical_url`` String. This will specify a `canonical url `__ to let search engines know they should give higher ranking to latest version of the docs. @@ -42,9 +46,12 @@ Base options * ``prev_next_buttons_location`` String. can take the value ``bottom``, ``top``, ``both`` , or ``None`` and will display the "Next" and "Previous" buttons accordingly. * ``style_external_links`` Bool. Add an icon next to external links. Defaults to ``False``. +* ``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`. TOC Options ------------ +~~~~~~~~~~~ These effect how we display the Table of Contents in the side bar. You can read more about them here: http://www.sphinx-doc.org/en/stable/templating.html#toctree @@ -55,6 +62,12 @@ These effect how we display the Table of Contents in the side bar. You can read * ``includehidden`` Bool. Specifies if the sidebar includes toctrees marked with the ``:hidden:`` option * ``titles_only`` Bool. If True, removes headers within a page from the sidebar. +HTML Context Options +-------------------- + +TODO. + + Page-level Configuration ======================== diff --git a/sphinx_rtd_theme/breadcrumbs.html b/sphinx_rtd_theme/breadcrumbs.html index a988ecd2..31550d8b 100644 --- a/sphinx_rtd_theme/breadcrumbs.html +++ b/sphinx_rtd_theme/breadcrumbs.html @@ -42,21 +42,21 @@ {{ _('Edit on GitHub') }} {% else %} - {{ _('Edit on GitHub') }} + {{ _('Edit on GitHub') }} {% endif %} {% elif display_bitbucket %} {% if check_meta and 'bitbucket_url' in meta %} {{ _('Edit on Bitbucket') }} {% else %} - {{ _('Edit on Bitbucket') }} + {{ _('Edit on Bitbucket') }} {% endif %} {% elif display_gitlab %} {% if check_meta and 'gitlab_url' in meta %} {{ _('Edit on GitLab') }} {% else %} - {{ _('Edit on GitLab') }} + {{ _('Edit on GitLab') }} {% endif %} {% elif show_source and source_url_prefix %} {{ _('View page source') }} diff --git a/sphinx_rtd_theme/theme.conf b/sphinx_rtd_theme/theme.conf index abc0decf..16ad38fe 100644 --- a/sphinx_rtd_theme/theme.conf +++ b/sphinx_rtd_theme/theme.conf @@ -15,3 +15,4 @@ logo_only = display_version = True prev_next_buttons_location = bottom style_external_links = False +vcs_pageview_mode =