You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,51 @@ Set the following additional config variables in the Sphinx project:
28
28
29
29
- ``idf_target`` - slug of the IDF target (ie esp32, esp32s2). Optional, but if ``idf_target`` is set then ``idf_targets`` must be set and vice versa. If these two are unset, no "Targets" section is generated in the navigation footer.
30
30
- ``idf_targets`` - Python list with short names of all supported IDF targets (ie ``["esp32", "esp32s2"]``).
31
-
- ``languages`` - Python list with short names of all supported languages (ie ``["en", "zh_CN"]``). If this is unset, no "Languages" section is generated in then navigation footer.
31
+
- ``languages`` - Python list with short names of all supported languages (ie ``["en", "zh_CN"]``). Must be set to at least one language element (the current project's language)
32
32
- ``project_slug`` - short name of the project as a URL slug (ie ``esp-idf``)
33
33
- ``versions_url`` - URL to download the ``versions.js`` file from
34
34
- ``project_homepage`` - URL of the project's main page (GitHub, etc)
35
35
36
36
Versions file
37
37
^^^^^^^^^^^^^
38
38
39
-
TBD
39
+
The file found at the ``versions_url`` location should be a JavaScript file describing all current versions. It should take this form:
40
+
41
+
.. highlight:: javascript
42
+
43
+
```
44
+
var DOCUMENTATION_VERSIONS = {
45
+
"DEFAULTS": { "has_targets": false },
46
+
"VERSIONS": [
47
+
{ "name": "latest", "has_targets": true },
48
+
{ "name": "v4.0" },
49
+
{ "name": "v3.3.1" },
50
+
{ "name": "v3.3", "old": true },
51
+
{ "name": "v3.2.3" },
52
+
{ "name": "v3.2.2", "old": true },
53
+
{ "name": "v3.1.6" },
54
+
{ "name": "v3.1.5", "old": true },
55
+
{ "name": "v3.0.9", "old": true },
56
+
{ "name": "v4.0-rc", "pre_release": true },
57
+
{ "name": "v4.0-beta2", "pre_release": true },
58
+
{ "name": "release-v4.1", "pre_release": true },
59
+
{ "name": "release-v4.0", "pre_release": true },
60
+
{ "name": "release-v3.3", "pre_release": true },
61
+
{ "name": "release-v3.2", "pre_release": true },
62
+
{ "name": "release-v3.1", "pre_release": true },
63
+
]
64
+
};
65
+
```
66
+
67
+
.. note:: This file is JavaScript so it can be easily included in a script tag, but it's excpected to contain a single assignment statement which assigns the ``DOCUMENTATION_VERSIONS`` variable to a valid JSON object. Doing any other JavaScript computation in this file is invalid.
68
+
69
+
Inside the ``DOCUMENTATION_VERSIONS`` object:
70
+
71
+
- ``VERSIONS`` key is a list of versions, where each version is a JSON object with at minimum a ``name`` key which is the version name "slug", and optionally one or more of the following keys:
72
+
- ``has_targets`` is true if the URLs for these docs have a target element, ie ``<project>/<language>/<target>/<version>``. False if the URL format is ``<project>/<language>/<version>``. A single project can have some versions which include and some which exclude the target URL component.
73
+
- ``old`` is true if this version is not current, will be shown in "Old Versions" section under the main versions.
74
+
- ``pre_release`` is true if this version is a prerelease not a stable release, will be shown in "Prereleases" section under the main versions
75
+
- ``DEFAULTS`` key contains the default values for any keys which are not supplied in an individual ``VERSIONS`` entries. Just exists to make the file more readable.
Copy file name to clipboardExpand all lines: sphinx_idf_theme/versions.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,14 @@
43
43
{% if release == "latest" %}
44
44
<strong>
45
45
{% endif %}
46
-
<!-- Latest version URL may not be correct depending on whether that version has different language & idf_targets as part of the URL format compared to this version.
46
+
<!-- Latest version URL may not be correct depending on whether that version has idf_target as part of the URL format compared to this version.
<!-- Stable version URL may not be correct depending on whether that version has different language & idf_targets as part of the URL format compared to this version.
53
+
<!-- Stable version URL may not be correct depending on whether that version has idf_target as part of the URL format compared to this version.
0 commit comments