Skip to content

tabbed-nav: generate nav/docsets.json for the docsets modal - #158

Merged
recrwplay merged 6 commits into
devfrom
feature/tabbed-nav-docsets-json
Oct 22, 2026
Merged

recrwplay merged 6 commits into
devfrom
feature/tabbed-nav-docsets-json

Conversation

@recrwplay

Copy link
Copy Markdown
Contributor

What

Adds a generated nav/docsets.json to the @neo4j-antora/tabbed-nav extension (0.3.9 to 0.4.0), alongside nav/tabs.json. It feeds the "All Neo4j documentation" modal in docs-ui (docs-restructure branch), which now reads it instead of tabs.json.

Shape, one entry per Antora component:

[{ "name": "cypher-manual", "title": "Cypher Manual", "group": "Query",
   "versions": [{ "version": "25", "latest": true, "url": "/cypher-manual/25/intro/",
                  "pdf": "/cypher-manual/25/neo4j-cypher-manual-25.pdf" }] }]
  • url is the first linkable internal page of that version.
  • pdf is only set when the PDF exists: in the build output for the in-build stage, in the bucket listing for the S3 aggregator. Stored at <component>/<version>/_exports/neo4j-<component>[-<version>].pdf, public URL without _exports. The version segment is omitted for unversioned docsets.
  • group comes from the docset's page-docset-display-group attribute (antora.yml or playbook); empty when unset.

How

  • New docsets.js builds the file from the aggregated tabs.json, shared by index.js (in-build aggregate stage) and aggregate.js (post-publish S3 aggregator).
  • tabs.json only keeps a component's latest version (plus all versions of version-grouped docsets), so each component's latest entry now also carries docsetVersions: every version with its first page. The nav code ignores the new field, and components not yet rebuilt fall back to what tabs.json already has.
  • New docsetsFile option (default nav/docsets.json, false to skip).

Attribute names

  • page-docset-version-group is now the preferred name for the existing page-tabs-group (version matching across docsets). Both work; the new one wins if both are set. It is copied onto pages as page-tabs-group, which the UI layouts and nav helpers still read, so docs-ui needs no change for it.
  • page-docset-display-group is new and sets the group shown in the modal.

Testing

  • The docsets.js merge logic was checked on sample data and against the live dev tabs.json (44 docsets) with a local script.
  • Not yet run: a full Antora build with the extension, or aggregate.js against S3 (needs AWS credentials). Hence draft.

Follow-ups

  • Document docsets.json, docsetsFile and the two attributes in docs-playbook (reference/pages/antora/extensions/tabbed-nav.adoc, docs-restructure/pages/set-up-docset.adoc), from main.
  • Docsets need page-docset-display-group set before real groups appear; the modal currently uses a temporary placeholder mapping.

Adds a flat per-docset listing (name, title, group, versions with url and
optional pdf) built from the aggregated tabs.json, written by both the
in-build aggregate stage and the post-publish S3 aggregator. A pdf is only
listed when the file exists (output dir in-build, bucket listing in the
aggregator). Adds a docsetsFile option. Bumps to 0.4.0.
tabs.json only carries a component's latest version, so docsets.json built
from it listed one version for most docsets. Each component now also writes
a <component>/docset.json shard listing all its versions (from Antora's
content catalog), and both the in-build aggregate stage and the S3 aggregator
merge those. Components that have not published a shard yet fall back to
what tabs.json knows.
…file

Each component's latest tabs.json entry now has docsetVersions (every version
with its first page), so docsets.json is built from the aggregated tabs.json
alone, in both the in-build stage and the S3 aggregator. Replaces the
per-component docset.json shard from the previous commit.
…tabs-group

Both work; page-version-group wins when both are set. It is copied onto
pages as page-tabs-group, which the UI layouts and nav helpers still read.
…ay-group

page-docset-version-group is the preferred name for page-tabs-group (still
accepted); page-docset-display-group sets the group shown in the docsets modal.
@neo4j-docops-agent

neo4j-docops-agent commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@recrwplay
recrwplay marked this pull request as ready for review October 22, 2026 13:55
@recrwplay
recrwplay merged commit 700aed6 into dev Oct 22, 2026
8 checks passed
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.

2 participants