Skip to content

Commit

Permalink
Update docs assets and config (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt authored Jan 10, 2023
1 parent fae159f commit 63bbd92
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 23 deletions.
80 changes: 72 additions & 8 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
.sphx-glr-thumbcontainer {
height: 210px;
}

:root {
--pst-color-primary: 47,47,47;
--pst-color-link: 56,123,178;
--pst-color-link-hover: 43,175,137;
:root[data-theme="light"] {
--pst-color-primary: rgb(47, 47, 47);
--pst-color-link: rgb(56, 123, 178);
}

.nav-link {
Expand Down Expand Up @@ -60,3 +55,72 @@
.fa-discourse:before {
color: white;
}

button.toggle-button {
display: none;
}

.toggle-hidden:not(.admonition) {
height: 0;
}

.tag_hide-input {
margin-bottom: 0 !important;
}

details.hide.above-input {
display: none;
}

.toggle-hidden + .cell_output {
margin-top: 0 !important;
}

dl.field-list {
display: none
}

/* Improve styling */

div.cell div.cell_input {
border: none;
}

.highlight {
border-radius: 4px;
}

html[data-theme="light"] .highlight {
background-color: #263238;
color: #f8f8f2;
}

pre[id^='codecell'] {
background-color: unset;
border: none;
border-radius: 0.5em;
color: #f8f8f2;
box-shadow: none;
padding: 1.5em;
}

button.copybtn {
background-color: #263238;
}

button.copybtn:hover {
background-color: #263238;
color: #f8f8f2;
}

.highlight button.copybtn:hover {
background: none
}

.o-tooltip--left:after {
background: none;
}

ul.current.nav.bd-sidenav {
padding: 0;
}
16 changes: 9 additions & 7 deletions doc/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block docs_navbar %}
<nav class="navbar navbar-dark navbar-expand-lg bg-dark fixed-top bd-navbar" id="navbar-main">
{%- include "docs-navbar.html" %}
{%- include "sections/header.html" %}
</nav>
{% endblock %}

Expand All @@ -29,7 +29,7 @@
{% endfor %}
{% endif %}
{% if ('gallery' in pagename or 'reference' in pagename or 'user_guide' in pagename) and not pagename.endswith('index') %}
<a href="https://mybinder.org/v2/gh/holoviz/geoviews/{{ last_release }}?urlpath=lab/tree/examples/{{ pagename }}.ipynb" id="binder-link">Open this example in Binder</a>
<a href="https://mybinder.org/v2/gh/holoviz/geoviews/{{ last_release }}?urlpath=lab/tree/examples/{{ pagename }}.ipynb" style="padding-left: 1.5rem;">Open this page in Binder</a>
{% endif %}
</div>
{% endblock %}
Expand All @@ -40,14 +40,16 @@
{% else %}
{% set content_col_class = "col-md-11 col-xl-8" %}
{% endif %}
<main class="col-12 {{ content_col_class }} py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div class="bd-content col-12 {{ content_col_class }}" role="main">
{% block docs_body %}
<div>
<article class="bd-article" role="main">
{% block body %} {% endblock %}
</div>
</article>
{% endblock %}
{% if theme_show_prev_next %}
{% include "prev-next.html" %}
<footer class="bd-footer-article">
{% include "sections/footer-article.html" %}
</footer>
{% endif %}
</main>
</div>
{% endblock %}
19 changes: 19 additions & 0 deletions doc/_templates/sections/sidebar-primary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% block docs_sidebar %}
{% if sidebars %}
<!-- Only show if we have sidebars configured, else just a small margin -->
<div class="bd-sidebar-primary col-12 col-md-2 bd-sidebar">
<div class="sidebar-start-items">
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
</div>
<div class="sidebar-end-items">
{%- for leftsidebartemplate in theme_left_sidebar_end %}
{%- include leftsidebartemplate %}
{%- endfor %}
</div>
</div>
{% else %}
<div class="sidebar-primary col-12 col-md-1 col-xl-2 bd-sidebar no-sidebar"></div>
{% endif %}
{% endblock %}
11 changes: 11 additions & 0 deletions doc/_templates/sidebar-nav-bs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<nav class="bd-links" id="bd-docs-nav" aria-label="{{ _('Main navigation') }}">
<div class="bd-toc-item active">
{{ generate_nav_html("sidebar",
show_nav_level=theme_show_nav_level|int,
maxdepth=theme_navigation_depth|int,
collapse=theme_collapse_navigation|tobool,
includehidden=True,
startdepth=0,
titles_only=True) }}
</div>
</nav>
21 changes: 14 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from nbsite.shared_conf import *

project = u'GeoViews'
authors = u'HoloViz Developers'
copyright = u'2018-2021 ' + authors
project = 'GeoViews'
authors = 'HoloViz Developers'
copyright = '2018 ' + authors
description = 'Geographic visualizations for HoloViews.'

import geoviews
version = release = str(geoviews.__version__)
version = release = base_version(geoviews.__version__)

html_static_path += ['_static']

Expand All @@ -34,7 +34,11 @@
"url": "https://discourse.holoviz.org/",
"icon": "fab fa-discourse",
}
]
],
"navbar_end": ["navbar-icon-links"],
"google_analytics_id": "UA-154795830-3",
"pygment_light_style": "material",
"pygment_dark_style": "material",
}

extensions += [
Expand All @@ -59,8 +63,11 @@
}

html_context.update({
"last_release": f"v{'.'.join(geoviews.__version__.split('.')[:3])}",
"last_release": f"v{release}",
"github_user": "holoviz",
"github_repo": "geoviews",
"google_analytics_id": "UA-154795830-3",
"default_mode": "light"
})

# Override the Sphinx default title that appends `documentation`
html_title = f'{project} v{version}'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def run(self):
'lxml',
'selenium',
'pooch',
'pydata-sphinx-theme <0.9.0',
'pydata-sphinx-theme ==0.9.0',
'sphinx-copybutton',
],
'tests': [
Expand Down

0 comments on commit 63bbd92

Please sign in to comment.