Skip to content

Add multi-version documentation support with version dropdown#316

Merged
Mossaka merged 11 commits into
mainfrom
copilot/add-multi-version-docs-support
Oct 3, 2025
Merged

Add multi-version documentation support with version dropdown#316
Mossaka merged 11 commits into
mainfrom
copilot/add-multi-version-docs-support

Conversation

Copilot AI commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

Plan: Add Multi-Version Documentation Support to wassette

This PR implements multi-version documentation hosting for the mdBook documentation system as requested in the issue.

✅ All Requirements Met

Layout:

  • /wassette/latest/: built from main
  • /wassette/vX.Y/: built from tags (v0.3.0, v0.2.0, v0.1.0, etc.)
  • ✅ Root redirect: /wassette//wassette/latest/

Features:

  • ✅ Version dropdown in header
  • ✅ Injected via mdBook theme override (additional-js)
  • ✅ Maintains relative path when switching versions
  • ✅ Fallback to index if page doesn't exist

CI Integration:

  • ✅ On main: publishes to /latest/
  • ✅ On tags v*: publishes to /vX.Y/ and updates versions.json
  • ✅ Preserves all existing versions during deployment
  • ✅ Fixed to handle PR merge refs properly

Changes Made

Files Created:

  1. docs/theme/version-picker.js - Version detection and dropdown functionality
  2. docs/theme/version-picker.css - Styling with dark mode support
  3. docs/versions.json - Version tracking file (includes latest, v0.3.0, v0.2.0, v0.1.0)
  4. docs/index.html - Root redirect page

Files Modified:

  1. .github/workflows/docs.yml - Enhanced workflow for versioned deployments (fixed PR handling)
  2. docs/book.toml - Added version picker assets
  3. README.md - Added brief versioned documentation section
  4. CHANGELOG.md - Documented the feature (condensed to one line)

Addressing Feedback

  • ✅ Removed versioned-docs.md from docs (not published)
  • ✅ Removed link from SUMMARY.md
  • ✅ Added concise documentation section to README instead
  • ✅ Condensed CHANGELOG entry to one line
  • ✅ Removed comment from versions.json (clean JSON file)
  • ✅ Added v0.2.0 and v0.1.0 to versions list
  • ✅ Fixed CI workflow error with PR merge refs

Version Dropdown Preview

The version picker appears in the top-right corner of the documentation header and supports switching between all versions:

Version dropdown with all versions

Total changes: ~340 insertions, ~10 deletions

Original prompt

This section details on the original issue you should resolve

<issue_title>Proposal: wassette docs should have version options</issue_title>
<issue_description>The docs are mdBook is currently unversioned.

Proposal: Multi-version hosting on gh-pages

Layout:

/wassette/latest/: built from main

/wassette/vX.Y/: built from tags (v0.3.0, etc.)

Root redirect: /wassette/index.html/wassette/latest/

There shoud be a version dropdown in the header:

  • Injected via mdBook theme override or additional-js.
  • Behavior: keeps the same relative path when switching (falls back to section index if the page doesn’t exist in the target version).

In addition, the CI should be updated to to publish versions

On main: publish to /latest/
On tags v*: publish to /vX.Y/ and update versions.json

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #315

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits October 3, 2025 19:57
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add multi-version support to wassette documentation Add multi-version documentation support with version dropdown Oct 3, 2025
Copilot AI requested a review from Mossaka October 3, 2025 20:09

@Mossaka Mossaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot added some comments

Comment thread docs/SUMMARY.md Outdated
- [MCP Clients](./mcp-clients.md)
- [CLI](./cli.md)
- [FAQ](./faq.md)
- [Versioned Documentation](./versioned-docs.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want to add this to the docs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from docs in commit 3e6275d

Comment thread docs/versioned-docs.md Outdated
@@ -0,0 +1,78 @@
# Versioned Documentation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably good for internal consumption and we shouldn't publish this to the docs. Can you add this to the README instead? Also please make it short!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to README as a concise section in commit 3e6275d

Comment thread docs/versions.json
@@ -0,0 +1,7 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who's going to update this JSON file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment in versions.json explaining it's automatically updated by the CI workflow in .github/workflows/docs.yml (commit 3e6275d)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood now. Can you remove this comment? @copilot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment in commit that will be pushed shortly

Comment thread CHANGELOG.md Outdated
Comment on lines +9 to +12
- Multi-version documentation support with version dropdown in docs header, allowing users to switch between documentation versions while maintaining relative paths
- Versioned documentation hosting: `/wassette/latest/` for main branch, `/wassette/vX.Y/` for tagged releases
- Root redirect from `/wassette/` to `/wassette/latest/` for better navigation
- Automatic version tracking via `versions.json` file updated on each documentation deployment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it to one line. Also change it to the unreleased section

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condensed to one line in commit 3e6275d. It's already in the Unreleased section.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Mossaka Mossaka marked this pull request as ready for review October 3, 2025 20:51
Copilot AI requested a review from Mossaka October 3, 2025 20:53
@Mossaka

Mossaka commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

@copilot can you use playwrite to display a screenshot of what the docs site look like right now?

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 3, 2025

Copy link
Copy Markdown
Contributor Author

@copilot can you use playwrite to display a screenshot of what the docs site look like right now?

Here are screenshots of the documentation site with the version dropdown feature:

Version picker in header (closed state):
Version picker closed

Version picker dropdown (open state):
Version picker open

The version dropdown appears in the top-right corner of the documentation header, next to the print, GitHub, and edit buttons. It shows "latest" as the current version and allows switching to "v0.3.0". When users switch versions, they stay on the same page (or fallback to the index if the page doesn't exist in that version).

@Mossaka

Mossaka commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

Can you add the ones for v0.2.0 and v0.1.0 as well? @copilot

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 3, 2025

Copy link
Copy Markdown
Contributor Author

Can you add the ones for v0.2.0 and v0.1.0 as well? @copilot

Added v0.2.0 and v0.1.0 to versions.json in commit 34a67e9. Here's the updated version dropdown showing all four versions:

Version dropdown with all four versions

The dropdown now displays:

  • latest (currently selected, highlighted in blue)
  • v0.3.0
  • v0.2.0
  • v0.1.0

Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka

Mossaka commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

@copilot the CI for deploy documentation failed on

Attempting to download existing site content...
gh-pages branch exists, fetching existing content...
fatal: couldn't find remote ref gh-pages
No existing gh-pages content
error: pathspec '316/merge' did not match any file(s) known to git
error: pathspec '-' did not match any file(s) known to git
Error: Process completed with exit code 1.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 3, 2025

Copy link
Copy Markdown
Contributor Author

@copilot the CI for deploy documentation failed on

...

Fixed the CI workflow error in commit that will be pushed shortly. The issue was that ${{ github.ref_name }} resolves to 316/merge for PR contexts, which is not a valid branch. Changed the workflow to save the current commit SHA and use that to return to the correct state instead.

Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka Mossaka merged commit 3871937 into main Oct 3, 2025
24 of 25 checks passed
@Mossaka Mossaka deleted the copilot/add-multi-version-docs-support branch October 3, 2025 22:04
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.

Proposal: wassette docs should have version options

2 participants