Skip to content

Add a version switcher and an edit link to the documentation pages - #248

Open
Hackwar wants to merge 4 commits into
joomla:masterfrom
Hackwar:feature/docs-version-switcher
Open

Hackwar wants to merge 4 commits into
joomla:masterfrom
Hackwar:feature/docs-version-switcher

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Depends on #239 (5.x-dev). This branch is based on #239, so its commits show up here until #239 is merged. The change itself is the last commit.

Summary

Packages have documentation for 3.x, 4.x and, with #239, 5.x. But the pages didn't show which version is displayed, and the package lists only link to the latest version.

  • Version switcher: a button group above each page lists the versions the package has documentation for, with the current one highlighted. It links to the same page in the other version, or to the overview when that version doesn't have the page.
  • Development notice: pages of an unreleased version (5.x) show a notice that the version is still in development and may change. It links to the same page of the current release.
  • Edit on GitHub: every page links to its source file on the branch the documentation is fetched from, e.g. https://github.com/joomla-framework/application/edit/4.x-dev/docs/tutorial/index.md.

The documented versions, their branches and whether they are released are defined in one place, the new VersionHelper. A package shows a version when its has_vN flag is set and the documentation for that version was fetched.

To avoid conflicts with #236 and #247 (docs index), the controller and view constructors are unchanged. The view gets the helper through a setter in its service factory, and the controller passes the version and page with setPage().

Testing

I tested with the 3.x and 4.x documentation fetched locally, plus a 5.x copy of the Application docs:

Page Switcher Notice Edit link
/docs/4.x/application/tutorial/index 3.x → overview (no tutorial in 3.x), 4.x, 5.x → overview – 4.x-dev/docs/tutorial/index.md
/docs/5.x/application/overview 3.x, 4.x, 5.x dev links to the 4.x overview 5.x-dev/docs/overview.md
/docs/4.x/registry/overview 3.x, 4.x (no 5.x docs) – 4.x-dev/docs/overview.md

I haven't viewed the pages in a browser.

🤖 Generated with Claude Code

Hackwar and others added 3 commits November 13, 2026 07:36
The 5.x-dev branch now exists in all active package repositories. This adds
it everywhere the 4.x branch is handled:

- New `has_v5` column for the packages table, with `has_v5: false` for the
  deprecated packages in packages.yml, synced by `package:sync`
- 5.x Series column with the CI badge of the 5.x-dev branch on the status page
- The documentation of the 5.x-dev branch is fetched and served under /docs/5.x

Since 5.x is not stable yet, the `latest` documentation links keep pointing
to 4.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Packages have documentation for 3.x, 4.x and now 5.x, but the pages didn't
show which version is displayed, and the package lists only link to the
latest version.

- A version switcher above each page lists the versions the package has
  documentation for. It links to the same page in the other version, or to
  the overview when that version doesn't have the page.
- Pages of an unreleased version (5.x) show a notice that the version is
  still in development, with a link to the same page of the current release.
- Every page links to its source file on GitHub ("Edit this page on GitHub"),
  on the branch the documentation is fetched from.

The documented versions, their branches and whether they are released are
defined in the new VersionHelper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant