Skip to content

Commit 49e799a

Browse files
authored
stable and latest subcategories in sphinx output (#144)
1 parent 9556b54 commit 49e799a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

docs/source/_templates/version.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<p class="caption">
2+
<span class="caption-text">Version</span>
3+
</p>
4+
<ul>
5+
<li class="toctree-l1">
6+
<a class="reference internal" id="version-stable"
7+
href="../stable/{{ pathto('index') if '.html' in pathto('index') else 'index.html' }}">Stable
8+
({{ version }})</a>
9+
</li>
10+
<li class="toctree-l1">
11+
<a class="reference internal" id="version-latest"
12+
href="../latest/{{ pathto('index') if '.html' in pathto('index') else 'index.html' }}">Latest</a>
13+
</li>
14+
</ul>
15+
<script>
16+
if (window.location.href.indexOf("stable") > -1) {
17+
document.getElementById("version-stable").className = "reference internal current";
18+
document.getElementById("version-latest").className = "reference internal";
19+
} else {
20+
document.getElementById("version-stable").className = "reference internal";
21+
document.getElementById("version-latest").className = "reference internal current";
22+
}
23+
</script>

docs/source/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
copyright = '2020, AI4Science Group'
3131
author = 'AI4Science Group'
3232

33+
version = f"{deeptime.__version__.split('+')[0]}"
3334
# The full version, including alpha/beta/rc tags
3435
release = f"{deeptime.__version__}"
3536

@@ -155,9 +156,10 @@ def filter(self, record: LogRecord) -> int:
155156
'**': [
156157
'about.html',
157158
'navigation.html',
159+
'version.html',
158160
'relations.html',
159161
'searchbox.html',
160-
'github_button.html'
162+
'github_button.html',
161163
]
162164
}
163165

0 commit comments

Comments
 (0)