Skip to content

Commit

Permalink
Play around with templates to fix shrinking content (not perfect yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Jun 10, 2022
1 parent 1186bc8 commit 788d6df
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
4 changes: 1 addition & 3 deletions doc/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ dt:target, span.highlighted {
}

/* If no-sidebar is present, hide the div entirely to prevent taking space */
.no-sidebar {
display: none;
}
/* .no-sidebar {display: none;} */


/* *********************************************************************** */
Expand Down
21 changes: 20 additions & 1 deletion doc/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{% extends "!layout.html" %}

{% block docs_main %}
{% set content_xl_width = "col-xl-7" if sidebars else "col-xl-11" %}
<div class="bd-content col-12 col-md-9 {{ content_xl_width }}">
{% block docs_body %}
<article class="bd-article" role="main">
{% block body %} {% endblock %}
</article>
{% endblock %}

{% if theme_show_prev_next %}
<footer class="bd-footer-article">
{% include "sections/footer-article.html" %}
</footer>
{% endif %}
</div>
{% endblock %}


{%- block footer %}
<footer class="footer">
<div class="container">
<div class="dropdown show" style="float:right">
<div class="dropup show" style="float:right">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Archive
</a>
Expand Down
13 changes: 13 additions & 0 deletions doc/_templates/sections/sidebar-secondary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% block docs_toc %}
{# Define content / TOC behavior depending on whether we have sidebars #}
{% set toc_show_width = "xl" if sidebars else "md" %}
<div class="bd-sidebar-secondary d-none d-{{ toc_show_width }}-block col-{{ toc_show_width }}-2 bd-toc">
{% if meta is defined and not (meta is not none and 'notoc' in meta) %}
{% for toc_item in theme_page_sidebar_items %}
<div class="toc-item">
{% include toc_item %}
</div>
{% endfor %}
{% endif %}
</div>
{% endblock %}
18 changes: 5 additions & 13 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
html_css_files = ['css/custom.css']

html_logo = "_static/logo-wide-lightbg.svg"
html_favicon = "_static/favicon.ico"

html_theme_options = {
"icon_links": [
Expand All @@ -129,21 +130,12 @@
"type": "fontawesome",
},
],
"favicons": [
{
"rel": "icon",
"sizes": "16x16",
"href": "_static/favicon.ico",
},
{
"rel": "icon",
"sizes": "32x32",
"href": "_static/favicon.ico",
},
],
"show_prev_next": False,
"navbar_end": ["search-field", "navbar-icon-links"],
}

html_context = {
"default_mode": "light",
}

html_sidebars = {
Expand All @@ -156,7 +148,7 @@

intersphinx_mapping = {
'numpy': ('https://numpy.org/doc/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'matplotlib': ('https://matplotlib.org/stable', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'statsmodels': ('https://www.statsmodels.org/stable/', None)
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
:notoc:

seaborn: statistical data visualization
=======================================
Expand Down

0 comments on commit 788d6df

Please sign in to comment.