Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
{%- block document %}
<div itemprop="articleBody">
{% block body %}{% endblock %}
{%- if toc|length > title|length + 75 %}
<nav id="local-table-of-contents" role="navigation" aria-labelledby="local-table-of-contents-title">
<h4 id="local-table-of-contents-title">On This Page</h4>
{{ toc }}
</nav>
{%- endif %}
{%- block body %}{% endblock %}
</div>
{%- if self.comments()|trim %}
<div class="articleComments">
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions src/sass/_theme_layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,68 @@ footer
margin-top: 12px
+clearfix

#local-table-of-contents
padding-bottom: 20px
#local-table-of-contents-title
margin-bottom: 10px
a[href="#"]
display: none
& > ul
& > li
list-style: none
margin-top: 0
li
list-style: square
margin-bottom: 5px
margin-top: 5px
ul
ul
padding-left: 0
margin-left: 20px
padding-right: 0

@media screen and (min-width: $nav-media-query + $local-toc-width)
#local-table-of-contents
display: block
position: fixed
margin-left: 0
overflow-y: auto
height: 95%
top: 45px
left: 1100px
width: $local-toc-width
#local-table-of-contents-title
display: block
font-size: 16px
width: 100%
padding-left: 10px
padding-top: 10px
padding-bottom: 5px
margin-bottom: -5px
border-left: 7px solid darken($local-toc-border-color, 20%)
ul
list-style: none
& > ul
border-left: 7px solid darken($local-toc-border-color, 20%)
padding-bottom: 10px
ul
&:first-of-type
padding-left: 0
margin-left: 0
li
margin-top: 5px
margin-bottom: 5px
margin-left: 20px
& > ul
& > li
margin-left: 10px
ul
ul
padding-left: 0
margin-left: 10px
padding-right: 0
margin-right: 10px

#search-results
.search li
margin-bottom: $base-line-height
Expand Down
4 changes: 4 additions & 0 deletions src/sass/_theme_variables.sass
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ $nav-link-color-hover: lighten($nav-link-color, 6%) !default
$nav-link-color-alt: hsl(33, 100%, 51%)
$nav-caption: lighten($blue, 15%)

//Local TOC colors
$local-toc-border-color: $section-background-color
$local-toc-width: 325px

// Sidebar colors
$sidebar-background-color: $table-stripe-color
$sidebar-border-color: $table-border-color
Expand Down