Skip to content

Commit

Permalink
fix(docs/source/additional/release): link to downloadable json releas…
Browse files Browse the repository at this point in the history
…e file (#366)

Signed-off-by: Thibault Camalon <135698225+thbcmlowk@users.noreply.github.com>
  • Loading branch information
thbcmlowk committed Sep 22, 2023
1 parent 79655dc commit 9752a6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `k3s_create.sh` file, needed for a local deployment ([#365](https://github.com/Substra/substra-documentation/pull/365))
- Add files to run documentation examples in nightly CI ([#357](https://github.com/Substra/substra-documentation/pull/357))
- Update example to be runnable in remote mode ([#357](https://github.com/Substra/substra-documentation/pull/357))
- Fix [JSON releases](https://docs.substra.org/releases.json) ([#356](https://github.com/Substra/substra-documentation/pull/356))

### Added

Expand Down
5 changes: 4 additions & 1 deletion docs/source/additional/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ These sets of versions have been tested for compatibility:
.. only:: html

.. note::
`JSON version of the release table </releases.json>`_

.. /!\ Path to `docs/build/html/releases.json` is relative to `release.html`
`JSON version of the release table <../releases.json>`_

Changelog
---------
Expand Down
10 changes: 4 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@
TMP_FOLDER = Path(__file__).parents[2] / "tmp"
TMP_FOLDER.mkdir(exist_ok=True)

# Generate a JSON compatibility table

html_extra_path = []
JSON_COMPATIBILITY_TABLE_FILE = TMP_FOLDER / "releases.json"

with open("additional/releases.yaml") as f:
compat_table = yaml.safe_load(f)
dest = Path(TMP_FOLDER, "releases.json")
with open(dest, "w") as f:
with open(JSON_COMPATIBILITY_TABLE_FILE, "w") as f:
json.dump(compat_table, f)
html_extra_path.append(str(dest))

repo = git.Repo(search_parent_directories=True)
current_commit = repo.head.commit
Expand Down Expand Up @@ -403,6 +399,8 @@ def reformat_md_section_links(file_path: Path):
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["./static"]

html_extra_path = [str(JSON_COMPATIBILITY_TABLE_FILE)]

html_css_files = [
"owkin.css",
]
Expand Down

0 comments on commit 9752a6f

Please sign in to comment.