From 8e376af4fc64cf809c8233bd8e571a51edb21317 Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Fri, 30 Nov 2018 17:50:09 +0100 Subject: [PATCH 01/16] Fix inconsistent font size and line height for autodoc "raises" and "returns" (#691) --- docs/changelog.rst | 17 +++++++++++++++++ sass/_theme_rst.sass | 3 +++ 2 files changed, 20 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 717125d0..7c660d68 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,23 @@ Changelog ********* +master +====== + +:Date: TBD + +New Features +------------- + +Fixes +----- + +* Fix inconsistent font size and line height for autodoc "raises" and "returns" (#267) + +Other Changes +-------------- + + v0.4.2 ====== diff --git a/sass/_theme_rst.sass b/sass/_theme_rst.sass index 458722c8..6a89405b 100644 --- a/sass/_theme_rst.sass +++ b/sass/_theme_rst.sass @@ -263,6 +263,9 @@ border: none td border: none + p + font-size: inherit + line-height: inherit td > strong display: inline-block .field-name From 28e7c4a47a873554c271d1bbf8eb9a230a425683 Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Fri, 30 Nov 2018 18:05:18 +0100 Subject: [PATCH 02/16] Style code block captions (#689) * Give code block captions same permalink as other elems * Style code block captions like table captions * Revert "Give code block captions same permalink as other elems" This reverts commit 4f7e6da24682153d3d783a907a1e95e36724abf1. --- sass/_theme_rst.sass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sass/_theme_rst.sass b/sass/_theme_rst.sass index 6a89405b..ad19eb68 100644 --- a/sass/_theme_rst.sass +++ b/sass/_theme_rst.sass @@ -95,6 +95,13 @@ font-size: 12px line-height: 1.4 + .code-block-caption + font-style: italic + font-size: 85% + line-height: 1 + padding: 1em 0 + text-align: center + @media print .codeblock, div[class^='highlight'], div[class^='highlight'] pre white-space: pre-wrap From b9bf19f5be9ec18fc60ada9220d222cf57c21394 Mon Sep 17 00:00:00 2001 From: Eric Holscher <25510+ericholscher@users.noreply.github.com> Date: Fri, 30 Nov 2018 12:11:20 -0500 Subject: [PATCH 03/16] Remove RTD integration now that it isn't requiremed (#684) --- docs/contributing.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 3e4b241a..a47c3b80 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -87,7 +87,3 @@ you should do the following: $ rm -rf dist/ $ python setup.py sdist bdist_wheel $ twine upload --sign --identity security@readthedocs.org dist/* - -#. In the ``readthedocs.org`` repo, edit the ``bower.json`` file to point at the correct version - (``sphinx-rtd-theme": "https://github.com/rtfd/sphinx-rtd-theme.git#$NEW_VERSION"``). -#. In the ``readthedocs.org`` repo, run ``gulp build`` to update the distributed theme files. From 139a56abee34ce6d71338fdebb8bdf58c23f826e Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Tue, 4 Dec 2018 16:41:13 +0100 Subject: [PATCH 04/16] Style caption link for code and literal blocks (#690) --- docs/changelog.rst | 2 ++ sass/_theme_rst.sass | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7c660d68..e5736672 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,8 +14,10 @@ New Features Fixes ----- +* Style caption link for code and literal blocks * Fix inconsistent font size and line height for autodoc "raises" and "returns" (#267) + Other Changes -------------- diff --git a/sass/_theme_rst.sass b/sass/_theme_rst.sass index ad19eb68..7e7542df 100644 --- a/sass/_theme_rst.sass +++ b/sass/_theme_rst.sass @@ -172,7 +172,7 @@ @extend h2 // This is the #href that shows up on hover. Sphinx's is terrible so I hack it away. - h1, h2, h3, h4, h5, h6, dl dt, p.caption, table > caption + h1, h2, h3, h4, h5, h6, dl dt, p.caption, table > caption, .code-block-caption .headerlink visibility: hidden font-size: 14px From 5b7d202a110ec00ef3f5e261716c4f4b8fc55b2f Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Tue, 4 Dec 2018 12:43:45 -0500 Subject: [PATCH 05/16] Small visual improvement to captions in toctree (#665) * Small visual improvement to captions in toctree * Add new nav-caption internal var * Use colored text and add margin * Nav captions now have independent color Co-Authored-By: Blendify * De saturate the bright blue captions Co-Authored-By: Blendify --- sass/_theme_layout.sass | 5 +++-- sass/_theme_variables.sass | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sass/_theme_layout.sass b/sass/_theme_layout.sass index 421fe5b9..904e9ae1 100644 --- a/sass/_theme_layout.sass +++ b/sass/_theme_layout.sass @@ -31,15 +31,16 @@ html width: $nav-desktop-width header, p.caption + color: $nav-caption height: $base-font-size * 2 display: inline-block line-height: $base-font-size * 2 padding: 0 $gutter - margin-bottom: 0 + margin: $base-line-height / 2 0 0 0 display: block font-weight: bold text-transform: uppercase - font-size: 80% + font-size: 85% white-space: nowrap ul diff --git a/sass/_theme_variables.sass b/sass/_theme_variables.sass index 6361ad0f..b4f09152 100644 --- a/sass/_theme_variables.sass +++ b/sass/_theme_variables.sass @@ -51,6 +51,7 @@ $nav-link-color: $blue $nav-link-color-visited: $purple $nav-link-color-hover: lighten($nav-link-color, 6%) !default $nav-link-color-alt: hsl(33, 100%, 51%) +$nav-caption: desaturate($blue, 15%) // Sidebar colors $sidebar-background-color: $table-stripe-color From 7e4592f95c0a1c01a420e6bb3e2bd3f043fd4d11 Mon Sep 17 00:00:00 2001 From: Eric Holscher <25510+ericholscher@users.noreply.github.com> Date: Tue, 4 Dec 2018 15:08:29 -0500 Subject: [PATCH 06/16] Add support for Google Analytics to theme. (#411) * Add support for Google Analytics to theme. This setting has actually existed in the default config since the original version, but doesn't currently work. This fixes that and supports GA if it's set. * Add docs around analytics_id * Do not conflict with RTD insertion of analytics script * Remove dupliate analytics_id * Add analytics_id to the configuration in its new place --- docs/configuring.rst | 2 +- sphinx_rtd_theme/layout.html | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/configuring.rst b/docs/configuring.rst index 67c91bce..94beb09d 100644 --- a/docs/configuring.rst +++ b/docs/configuring.rst @@ -19,7 +19,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via html_theme_options = { 'canonical_url': '', - 'analytics_id': '', + 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard 'logo_only': False, 'display_version': True, 'prev_next_buttons_location': 'bottom', diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index 7d9a25df..dccfac1d 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -221,6 +221,23 @@ }); + {# Do not conflict with RTD insertion of analytics script #} + {% if not READTHEDOCS %} + {% if theme_analytics_id %} + + + + {% endif %} + {% endif %} + {%- block footer %} {% endblock %} From a42c4d74fec660835393a4c9b1e7cb9e654ccc90 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Tue, 4 Dec 2018 20:27:37 -0500 Subject: [PATCH 07/16] Move javascript back to head (#545) * Move javascript back to head * Move jQuery function back to bottom * Do not change white space * Update comment + whitespace cleanup * Address review points * Fix code comments --- sphinx_rtd_theme/layout.html | 76 ++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index dccfac1d..2df1b39c 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -28,18 +28,42 @@ {% endif %} - {# CSS #} - - {# OPENSEARCH #} - {% if not embedded %} - {% if use_opensearch %} - + {# JAVASCRIPTS #} + + {%- if not embedded %} + {# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #} + {% if sphinx_version >= "1.8.0" %} + + {%- for scriptfile in script_files %} + {{ js_tag(scriptfile) }} + {%- endfor %} + {% else %} + + {%- for scriptfile in script_files %} + + {%- endfor %} {% endif %} + - {% endif %} + {# OPENSEARCH #} + {%- if use_opensearch %} + + {%- endif %} + {%- endif %} + {# CSS #} {%- for css in css_files %} @@ -49,6 +73,7 @@ {%- endif %} {%- endfor %} + {%- for cssfile in extra_css_files %} {%- endfor %} @@ -74,10 +99,6 @@ {%- endif %} {%- endblock %} {%- block extrahead %} {% endblock %} - - {# Keep modernizr in head - http://modernizr.com/docs/#installing #} - - @@ -186,35 +207,6 @@ {% include "versions.html" %} - {% if not embedded %} - - {# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #} - {% if sphinx_version >= "1.8.0" %} - - {%- for scriptfile in script_files %} - {{ js_tag(scriptfile) }} - {%- endfor %} - {% else %} - - {%- for scriptfile in script_files %} - - {%- endfor %} - {% endif %} - - {% endif %} - - -