Skip to content

Commit

Permalink
Update theme, set minimum sphinx version to 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed May 18, 2017
1 parent a397831 commit c0fc206
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 41 deletions.
5 changes: 0 additions & 5 deletions doc/_templates/layout.html

This file was deleted.

6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.4.2'
needs_sphinx = '1.6.1'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -400,3 +400,7 @@
# -- Extension configuration ----------------------------------------------
autodoc_member_order = 'bysource'
autosummary_generate = True


def setup(app):
app.add_stylesheet('custom.css')
35 changes: 2 additions & 33 deletions doc/theme/layout.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
{% extends "basic/layout.html" %}

{% set theme_css_files = [] %}
{% if theme_bootstrap_version == "3" %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "3.3.6", "theme", "" %}
{% set bootstrap_version, navbar_version = "3.3.6", "" %}
{% set bs_span_prefix = "col-md-" %}
{% else %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "2.3.2", "responsive", "-2" %}
{% set bootstrap_version, navbar_version = "2.3.2", "-2" %}
{% set bs_span_prefix = "span" %}
{% endif %}

{% if theme_bootswatch_theme and theme_bootswatch_theme != "\"\"" %}
{# BS2 needs "bootstrap-responsive.css". BS3 doesn't. #}
{% if theme_bootstrap_version == "3" %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}

{% if not bootswatch_css_custom %}
{% set bootswatch_css_custom = [] %}
{% endif %}
{% set css_files = css_files + theme_css_files + bootswatch_css_custom %}

{% set script_files = script_files + [
'_static/js/jquery-1.11.0.min.js',
'_static/js/jquery-fix.js',
Expand Down
37 changes: 37 additions & 0 deletions doc/theme/static/bootstrap-sphinx.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@
* Sphinx stylesheet -- Bootstrap theme.
*/

/*
* Imports to aggregate everything together.
*/

@import url("basic.css");

{% if theme_bootstrap_version == "3" %}
{% set bootstrap_version, bootstrap_additional_css = "3.3.6", "theme" %}
{% set bs_span_prefix = "col-md-" %}
{% else %}
{% set bootstrap_version, bootstrap_additional_css = "2.3.2", "responsive" %}
{% set bs_span_prefix = "span" %}
{% endif %}

{% if theme_bootswatch_theme and theme_bootswatch_theme != "\"\"" %}
{# BS2 needs "bootstrap-responsive.css". BS3 doesn't. #}
{% if theme_bootstrap_version == "3" %}
@import url("{{ 'bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css' }}");
{% else %}
@import url("{{ 'bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css' }}");
@import url("{{ 'bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css' }}");
{% endif %}
{% else %}
@import url("{{ 'bootstrap-' + bootstrap_version + '/css/bootstrap.min.css' }}");
@import url("{{ 'bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css' }}");
{% endif %}

{% if bootswatch_css_custom %}
{%- for css_custom in bootswatch_css_custom %}
@import url("{{ css_custom }}");
{%- endfor %}
{% endif %}

/*
* Styles
*/

.navbar-inverse .brand {
color: #FFF;
}
Expand Down
2 changes: 1 addition & 1 deletion doc/theme/theme.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Bootstrap Theme
[theme]
inherit = basic
stylesheet = basic.css
stylesheet = bootstrap-sphinx.css
pygments_style = tango

# Configurable options.
Expand Down
2 changes: 1 addition & 1 deletion requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git+https://github.com/has2k1/plotnine-examples#egg=plotnine_examples
jupyter
sphinx
sphinx>=1.6.1
nbsphinx

0 comments on commit c0fc206

Please sign in to comment.