Skip to content

Conversation

@miyukoc
Copy link
Contributor

@miyukoc miyukoc commented Dec 3, 2025

This patch makes the theme include a JavaScript file that replaces the static version HTML with a <select> element. The list of versions is fetched from <content root>/../versions.json and is expected to adhere to the following format:

[
  { "name": "1.2.3", "root_url": "/docs/amaranth/v1.2.3/" },
  { "name": "1.2.2", "root_url": "/docs/amaranth/v1.2.2/" }
]

This file is expected to be updated manually similarly to how updates are done for https://amaranth-lang.org/index.html. However, an automation could be built at a maintainer's request: for example, this file could be assembled anew when pushing from this repo's GitHub Actions workflow to https://github.com/amaranth-lang/amaranth-lang.github.io.

The appearance of the version switch matches that of the Read the Docs theme's version switch.

image

Once this PR is merged, a follow-up PR should be created for https://github.com/amaranth-lang/amaranth-lang.github.io that adds this JavaScript file to all past versions of the documentation, together with the initial version of the versions.json file.

@miyukoc miyukoc requested a review from whitequark as a code owner December 3, 2025 03:14
@whitequark
Copy link
Member

However, an automation could be built at a maintainer's request: for example, this file could be assembled anew when pushing from this repo's GitHub Actions workflow to https://github.com/amaranth-lang/amaranth-lang.github.io.

Yes please.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (638edff) to head (0765235).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1642   +/-   ##
=======================================
  Coverage   91.28%   91.28%           
=======================================
  Files          44       44           
  Lines       11471    11471           
  Branches     2236     2236           
=======================================
  Hits        10471    10471           
  Misses        837      837           
  Partials      163      163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@whitequark
Copy link
Member

The smoke tests can be ignored (amaranth-soc is having issues due to too-new Python). The check-links test might need an exemption for medium.com.

@miyukoc miyukoc force-pushed the docs-version-switch branch 2 times, most recently from 6c9e064 to a94c2e3 Compare December 3, 2025 03:25
@miyukoc miyukoc force-pushed the docs-version-switch branch from a94c2e3 to 0765235 Compare December 3, 2025 16:15
@miyukoc
Copy link
Contributor Author

miyukoc commented Dec 3, 2025

However, an automation could be built at a maintainer's request: for example, this file could be assembled anew when pushing from this repo's GitHub Actions workflow to https://github.com/amaranth-lang/amaranth-lang.github.io.

Yes please.

Done. I am deeply unhappy with the way it turned out, however; any suggestions as to how the code could be improved are appreciated.

@whitequark whitequark added this pull request to the merge queue Dec 3, 2025
Merged via the queue into amaranth-lang:main with commit 53d88ad Dec 3, 2025
20 of 23 checks passed
@miyukoc miyukoc deleted the docs-version-switch branch December 3, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants