Skip to content

Commit 6ccaa66

Browse files
authoredJun 30, 2021
Add dynamic version information to docs (#275)
* Add dynamic version list to docs
1 parent 0bd25aa commit 6ccaa66

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎docs/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
api
99
ir-biology
1010
glossary
11+
versions
1112
zzz_bibliography
13+

‎docs/versions.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Other versions
2+
==============
3+
4+
There are other versions of the documentation available:
5+
6+
7+
.. raw:: html
8+
9+
<ul id="versions_container">
10+
<li><a href="https://icbi-lab.github.io/scirpy">latest release</a></li>
11+
<li><a href="https://icbi-lab.github.io/scirpy/develop">latest development version</a></li>
12+
</ul>
13+
<script type="text/javascript">
14+
fetch("https://icbi-lab.github.io/scirpy/versions/versions.json")
15+
.then(response => response.json())
16+
.then(versions => versions.forEach((x, i) => {
17+
document.getElementById("versions_container").innerHTML += '<li><a href="https://icbi-lab.github.io/scirpy/tags/' + x + '/">' + x + '</a></li>\n'
18+
})).catch((error) => {
19+
document.getElementById("versions_container").innerHTML = "Could not download version information..."
20+
})
21+
</script>

0 commit comments

Comments
 (0)
Please sign in to comment.