Skip to content

Commit

Permalink
Got help from unidata team to get this working
Browse files Browse the repository at this point in the history
Required an updated sphinx 0.2.5b1 .whl file
  • Loading branch information
mnlevy1981 committed Jun 11, 2018
1 parent 52fc6f4 commit ddd346f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
17 changes: 17 additions & 0 deletions docs/src/_static/pop_ver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$(document).ready(function() {
var proj_end = document.baseURI.indexOf("versions") + 9;
var end = document.baseURI.indexOf("/", proj_end);
var cur_ver = document.baseURI.substring(proj_end, end);
var name = cur_ver.startsWith('cesm') ? cur_ver.substring(0) : cur_ver;
var mylist = $("#version-list");
mylist.empty();
mylist.append($("<option>", {value: "../" + cur_ver, text: name}));
$.getJSON(version_json_loc, function(obj) {
$.each(obj.versions, function() {
if (this != cur_ver) {
name = this.startsWith('cesm') ? this.substring(0) : this;
mylist.append($("<option>", {value: DOCUMENTATION_OPTIONS.URL_ROOT + '../' + this, text: name}));
}
});
});
});
5 changes: 5 additions & 0 deletions docs/src/_templates/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "!footer.html" %}
{% block extrafooter %}
{{ super() }}
<script>var version_json_loc = "{{ pathto('../versions.json', 1) }}";</script>
{% endblock %}
3 changes: 3 additions & 0 deletions docs/src/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends "!layout.html" %}

{% set script_files = script_files + ["_static/pop_ver.js"] %}
9 changes: 6 additions & 3 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'bizstyle'
#html_theme = 'sphinxdoc'
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {}
html_theme_options['versions'] = {'latest': '../latest', 'cesm2.0': '../cesm2.0'}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down

0 comments on commit ddd346f

Please sign in to comment.