Skip to content

Commit 5942c5f

Browse files
committed
Add links to old docs on doc overview page
1 parent 5ae71eb commit 5942c5f

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

Jenkinsfile

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ pipeline {
4242

4343
sh "ls -lhart"
4444

45+
script {
46+
if (params.linkDocs) {
47+
sh "python add_old_links.py $major_version $minor_version"
48+
}
49+
}
50+
4551
/* Build docs */
4652
sh """
4753
rm -rf ./docs/$major_version"_"$minor_version

add_old_links.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
Adds an entry to the table listing old versions on the documentation homepage.
3+
"""
4+
5+
from operator import le
6+
import pathlib
7+
import sys
8+
9+
HERE = pathlib.Path(__file__).parent
10+
INDEX = HERE / 'src' / 'index.qmd'
11+
12+
13+
ROW = "| {major}.{minor} | [html](https://mc-stan.org/docs/{major}_{minor}/reference-manual/) [pdf](https://mc-stan.org/docs/{major}_{minor}/reference-manual-{major}_{minor}.pdf) | [html](https://mc-stan.org/docs/{major}_{minor}/stan-users-guide/) [pdf](https://mc-stan.org/docs/{major}_{minor}/stan-users-guide-{major}_{minor}.pdf) | [html](https://mc-stan.org/docs/{major}_{minor}/cmdstan-guide/) [pdf](https://mc-stan.org/docs/{major}_{minor}/cmdstan-guide-{major}_{minor}.pdf) | [html](https://mc-stan.org/docs/{major}_{minor}/functions-reference/) [pdf](https://mc-stan.org/docs/{major}_{minor}/functions-reference-{major}_{minor}.pdf) |"
14+
15+
16+
if __name__ == '__main__':
17+
if len(sys.argv) != 3:
18+
print('Usage: python add_old_links.py <version>')
19+
sys.exit(1)
20+
major = sys.argv[1]
21+
minor = sys.argv[2]
22+
row = ROW.format(major=major, minor=minor)
23+
index = INDEX.read_text()
24+
if row in index:
25+
print('Row already exists')
26+
sys.exit(1)
27+
28+
new_index = []
29+
added = False
30+
for line in index.splitlines():
31+
new_index.append(line)
32+
if not added and line.startswith('|---------|'):
33+
new_index.append(row)
34+
added = True
35+
36+
if not added:
37+
print('Failed to add row')
38+
sys.exit(1)
39+
40+
INDEX.write_text('\n'.join(new_index))
41+

src/index.qmd

+59
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: "Stan Documentation"
33
subtitle: "Version {{< env STAN_DOCS_VERSION >}}"
44
author: "Stan Development Team"
5+
page-navigation: false
6+
sidebar: false
7+
toc: false
58
---
69

710
![](img/logo_tm.png "Stan Logo"){width=225 .column-margin .d-none .d-md-block}
@@ -18,4 +21,60 @@ There are also separate installation and getting started guides for
1821
[*CmdStan*](cmdstan-guide/index.html) ([pdf](https://mc-stan.org/docs/{{< env STAN_DOCS_VERSION_PATH >}}/cmdstan-guide-{{< env STAN_DOCS_VERSION_PATH >}}.pdf)), the command-line interface to the Stan inference engine,
1922
and the R, Python, and Julia interfaces.
2023

24+
### Older Versions
25+
26+
This documentation is for Stan {{< env STAN_DOCS_VERSION >}}. Older versions of each of the documents linked above
27+
can be found in the table below:
28+
29+
| Version | Stan Reference Manual | Stan Users Guide | CmdStan Guide | Stan Functions Reference |
30+
|---------|------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
31+
| 2.35 | [html](https://mc-stan.org/docs/2_35/reference-manual/) [pdf](https://mc-stan.org/docs/2_35/reference-manual-2_35.pdf) | [html](https://mc-stan.org/docs/2_35/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_35/stan-users-guide-2_35.pdf) | [html](https://mc-stan.org/docs/2_35/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_35/cmdstan-guide-2_35.pdf) | [html](https://mc-stan.org/docs/2_35/functions-reference/) [pdf](https://mc-stan.org/docs/2_35/functions-reference-2_35.pdf) |
32+
| 2.34 | [html](https://mc-stan.org/docs/2_34/reference-manual/) [pdf](https://mc-stan.org/docs/2_34/reference-manual-2_34.pdf) | [html](https://mc-stan.org/docs/2_34/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_34/stan-users-guide-2_34.pdf) | [html](https://mc-stan.org/docs/2_34/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_34/cmdstan-guide-2_34.pdf) | [html](https://mc-stan.org/docs/2_34/functions-reference/) [pdf](https://mc-stan.org/docs/2_34/functions-reference-2_34.pdf) |
33+
| 2.33 | [html](https://mc-stan.org/docs/2_33/reference-manual/) [pdf](https://mc-stan.org/docs/2_33/reference-manual-2_33.pdf) | [html](https://mc-stan.org/docs/2_33/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_33/stan-users-guide-2_33.pdf) | [html](https://mc-stan.org/docs/2_33/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_33/cmdstan-guide-2_33.pdf) | [html](https://mc-stan.org/docs/2_33/functions-reference/) [pdf](https://mc-stan.org/docs/2_33/functions-reference-2_33.pdf) |
34+
| 2.32 | [html](https://mc-stan.org/docs/2_32/reference-manual/) [pdf](https://mc-stan.org/docs/2_32/reference-manual-2_32.pdf) | [html](https://mc-stan.org/docs/2_32/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_32/stan-users-guide-2_32.pdf) | [html](https://mc-stan.org/docs/2_32/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_32/cmdstan-guide-2_32.pdf) | [html](https://mc-stan.org/docs/2_32/functions-reference/) [pdf](https://mc-stan.org/docs/2_32/functions-reference-2_32.pdf) |
35+
| 2.31 | [html](https://mc-stan.org/docs/2_31/reference-manual/) [pdf](https://mc-stan.org/docs/2_31/reference-manual-2_31.pdf) | [html](https://mc-stan.org/docs/2_31/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_31/stan-users-guide-2_31.pdf) | [html](https://mc-stan.org/docs/2_31/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_31/cmdstan-guide-2_31.pdf) | [html](https://mc-stan.org/docs/2_31/functions-reference/) [pdf](https://mc-stan.org/docs/2_31/functions-reference-2_31.pdf) |
36+
| 2.30 | [html](https://mc-stan.org/docs/2_30/reference-manual/) [pdf](https://mc-stan.org/docs/2_30/reference-manual-2_30.pdf) | [html](https://mc-stan.org/docs/2_30/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_30/stan-users-guide-2_30.pdf) | [html](https://mc-stan.org/docs/2_30/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_30/cmdstan-guide-2_30.pdf) | [html](https://mc-stan.org/docs/2_30/functions-reference/) [pdf](https://mc-stan.org/docs/2_30/functions-reference-2_30.pdf) |
37+
| 2.29 | [html](https://mc-stan.org/docs/2_29/reference-manual/) [pdf](https://mc-stan.org/docs/2_29/reference-manual-2_29.pdf) | [html](https://mc-stan.org/docs/2_29/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_29/stan-users-guide-2_29.pdf) | [html](https://mc-stan.org/docs/2_29/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_29/cmdstan-guide-2_29.pdf) | [html](https://mc-stan.org/docs/2_29/functions-reference/) [pdf](https://mc-stan.org/docs/2_29/functions-reference-2_29.pdf) |
38+
| 2.28 | [html](https://mc-stan.org/docs/2_28/reference-manual/) [pdf](https://mc-stan.org/docs/2_28/reference-manual-2_28.pdf) | [html](https://mc-stan.org/docs/2_28/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_28/stan-users-guide-2_28.pdf) | [html](https://mc-stan.org/docs/2_28/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_28/cmdstan-guide-2_28.pdf) | [html](https://mc-stan.org/docs/2_28/functions-reference/) [pdf](https://mc-stan.org/docs/2_28/functions-reference-2_28.pdf) |
39+
| 2.27 | [html](https://mc-stan.org/docs/2_27/reference-manual/) [pdf](https://mc-stan.org/docs/2_27/reference-manual-2_27.pdf) | [html](https://mc-stan.org/docs/2_27/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_27/stan-users-guide-2_27.pdf) | [html](https://mc-stan.org/docs/2_27/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_27/cmdstan-guide-2_27.pdf) | [html](https://mc-stan.org/docs/2_27/functions-reference/) [pdf](https://mc-stan.org/docs/2_27/functions-reference-2_27.pdf) |
40+
| 2.26 | [html](https://mc-stan.org/docs/2_26/reference-manual/) [pdf](https://mc-stan.org/docs/2_26/reference-manual-2_26.pdf) | [html](https://mc-stan.org/docs/2_26/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_26/stan-users-guide-2_26.pdf) | [html](https://mc-stan.org/docs/2_26/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_26/cmdstan-guide-2_26.pdf) | [html](https://mc-stan.org/docs/2_26/functions-reference/) [pdf](https://mc-stan.org/docs/2_26/functions-reference-2_26.pdf) |
41+
| 2.25 | [html](https://mc-stan.org/docs/2_25/reference-manual/) [pdf](https://mc-stan.org/docs/2_25/reference-manual-2_25.pdf) | [html](https://mc-stan.org/docs/2_25/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_25/stan-users-guide-2_25.pdf) | [html](https://mc-stan.org/docs/2_25/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_25/cmdstan-guide-2_25.pdf) | [html](https://mc-stan.org/docs/2_25/functions-reference/) [pdf](https://mc-stan.org/docs/2_25/functions-reference-2_25.pdf) |
42+
| 2.24 | [html](https://mc-stan.org/docs/2_24/reference-manual/) [pdf](https://mc-stan.org/docs/2_24/reference-manual-2_24.pdf) | [html](https://mc-stan.org/docs/2_24/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_24/stan-users-guide-2_24.pdf) | [html](https://mc-stan.org/docs/2_24/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_24/cmdstan-guide-2_24.pdf) | [html](https://mc-stan.org/docs/2_24/functions-reference/) [pdf](https://mc-stan.org/docs/2_24/functions-reference-2_24.pdf) |
43+
| 2.23 | [html](https://mc-stan.org/docs/2_23/reference-manual/) [pdf](https://mc-stan.org/docs/2_23/reference-manual-2_23.pdf) | [html](https://mc-stan.org/docs/2_23/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_23/stan-users-guide-2_23.pdf) | [html](https://mc-stan.org/docs/2_23/cmdstan-guide/) [pdf](https://mc-stan.org/docs/2_23/cmdstan-guide-2_23.pdf) | [html](https://mc-stan.org/docs/2_23/functions-reference/) [pdf](https://mc-stan.org/docs/2_23/functions-reference-2_23.pdf) |
44+
| 2.22 | [html](https://mc-stan.org/docs/2_22/reference-manual/) [pdf](https://mc-stan.org/docs/2_22/reference-manual-2_22.pdf) | [html](https://mc-stan.org/docs/2_22/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_22/stan-users-guide-2_22.pdf) | | [html](https://mc-stan.org/docs/2_22/functions-reference/) [pdf](https://mc-stan.org/docs/2_22/functions-reference-2_22.pdf) |
45+
| 2.21 | [html](https://mc-stan.org/docs/2_21/reference-manual/) [pdf](https://mc-stan.org/docs/2_21/reference-manual-2_21.pdf) | [html](https://mc-stan.org/docs/2_21/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_21/stan-users-guide-2_21.pdf) | | [html](https://mc-stan.org/docs/2_21/functions-reference/) [pdf](https://mc-stan.org/docs/2_21/functions-reference-2_21.pdf) |
46+
| 2.20 | [html](https://mc-stan.org/docs/2_20/reference-manual/) [pdf](https://mc-stan.org/docs/2_20/reference-manual-2_20.pdf) | [html](https://mc-stan.org/docs/2_20/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_20/stan-users-guide-2_20.pdf) | | [html](https://mc-stan.org/docs/2_20/functions-reference/) [pdf](https://mc-stan.org/docs/2_20/functions-reference-2_20.pdf) |
47+
| 2.19 | [html](https://mc-stan.org/docs/2_19/reference-manual/) [pdf](https://mc-stan.org/docs/2_19/reference-manual-2_19.pdf) | [html](https://mc-stan.org/docs/2_19/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_19/stan-users-guide-2_19.pdf) | | [html](https://mc-stan.org/docs/2_19/functions-reference/) [pdf](https://mc-stan.org/docs/2_19/functions-reference-2_19.pdf) |
48+
| 2.18 | [html](https://mc-stan.org/docs/2_18/reference-manual/) [pdf](https://mc-stan.org/docs/2_18/reference-manual-2_18.pdf) | [html](https://mc-stan.org/docs/2_18/stan-users-guide/) [pdf](https://mc-stan.org/docs/2_18/stan-users-guide-2_18.pdf) | | [html](https://mc-stan.org/docs/2_18/functions-reference/) [pdf](https://mc-stan.org/docs/2_18/functions-reference-2_18.pdf) |
49+
50+
51+
Prior to version 2.18, all documentation was part of a single document called the Stan User’s Guide and Reference Manual.
52+
These versions are still available for download as PDFs:
53+
54+
| Version | Stan User’s Guide and Reference Manual |
55+
|---------|----------------------------------------|
56+
| 2.17 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.17.1/stan-reference-2.17.1.pdf) |
57+
| 2.16 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.16.0/stan-reference-2.16.0.pdf) |
58+
| 2.15 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.15.0/stan-reference-2.15.0.pdf) |
59+
| 2.14 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.14.0/stan-reference-2.14.0.pdf) |
60+
| 2.13 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.13.1/stan-reference-2.13.1.pdf) |
61+
| 2.12 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.12.0/stan-reference-2.12.0.pdf) |
62+
| 2.11 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.11.0/stan-reference-2.11.0.pdf) |
63+
| 2.10 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.10.0/stan-reference-2.10.0.pdf) |
64+
| 2.9 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.9.0/stan-reference-2.9.0.pdf) |
65+
| 2.8 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.8.0/stan-reference-2.8.0.pdf) |
66+
| 2.7 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.8.0/stan-reference-2.8.0.pdf) |
67+
| 2.6 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.6.2/stan-reference-2.6.2.pdf) |
68+
| 2.5 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.5.0/stan-reference-2.5.0.pdf) |
69+
| 2.4 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.4.0/stan-reference-2.4.0.pdf) |
70+
| 2.3 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.3.0/stan-reference-2.3.0.pdf) |
71+
| 2.2 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.2.0/stan-reference-2.2.0.pdf) |
72+
| 2.1 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.1.0/stan-reference-2.1.0.pdf) |
73+
| 2.0 | [pdf](https://github.com/stan-dev/stan/releases/download/v2.0.1/stan-reference-2.0.1.pdf) |
74+
| 1.3 | [pdf](https://github.com/stan-dev/stan/releases/download/v1.3.0/stan-reference-1.3.0.pdf) |
75+
| 1.2 | [pdf](https://github.com/stan-dev/stan/releases/download/v1.2.0/stan-reference-1.2.0.pdf) |
76+
| 1.1 | [pdf](https://github.com/stan-dev/stan/releases/download/v1.1.1/stan-reference-1.1.1.pdf) |
77+
| 1.0 | [pdf](https://github.com/stan-dev/stan/releases/download/v1.0.3/stan-reference-1.0.3.pdf) |
78+
79+
2180
{{< include copyright_licensing.qmd >}}

0 commit comments

Comments
 (0)