mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-16 11:21:25 +08:00
DOC: Use CSS to style versions sidebar.
Summary: * Label current version with an html id so it can be highlighted in CSS. * Note: Switched out arrow indicator for a disc b/c it's easier (unicode bullets are not well-supported). * Move script file to theme and use standard Sphinx theming to include javascript file.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
<h3>Version</h3>
|
||||
|
||||
<script type="text/javascript" src="/docs/dev/_static/docversions.js"></script>
|
||||
<script type="text/javascript">
|
||||
insert_version_links();
|
||||
</script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{% extends "basic/layout.html" %}
|
||||
|
||||
{% set script_files = script_files + ['_static/docversions.js'] %}
|
||||
|
||||
{% block header %}
|
||||
<div class="header-wrapper">
|
||||
|
||||
@@ -337,6 +337,14 @@ div.sidebarblock {
|
||||
margin-bottom: .8em;
|
||||
}
|
||||
|
||||
ul.versions li {
|
||||
color: gray;
|
||||
list-style: circle inside;
|
||||
}
|
||||
|
||||
ul.versions li#current {
|
||||
list-style: disc inside;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ function insert_version_links() {
|
||||
document.write('<ul class="versions">\n');
|
||||
|
||||
for (i = 0; i < labels.length; i++){
|
||||
document.write('<li>');
|
||||
open_list = '<li>'
|
||||
if (typeof(DOCUMENTATION_OPTIONS) !== 'undefined') {
|
||||
if ((DOCUMENTATION_OPTIONS['VERSION'] == labels[i]) ||
|
||||
(DOCUMENTATION_OPTIONS['VERSION'].match(/dev$/) && (i == 0))) {
|
||||
document.write('▸ ');
|
||||
open_list = '<li id="current">'
|
||||
}
|
||||
}
|
||||
document.write(open_list);
|
||||
document.write('<a href="URL">skimage VERSION</a> </li>\n'
|
||||
.replace('VERSION', labels[i])
|
||||
.replace('URL', 'http://scikits-image.org/docs/' + labels[i]));
|
||||
Reference in New Issue
Block a user