Skip to content

docs: migrate from Mintlify to Docusaurus 3#1174

Draft
planetf1 wants to merge 4 commits into
generative-computing:mainfrom
planetf1:main
Draft

docs: migrate from Mintlify to Docusaurus 3#1174
planetf1 wants to merge 4 commits into
generative-computing:mainfrom
planetf1:main

Conversation

@planetf1
Copy link
Copy Markdown
Contributor

@planetf1 planetf1 commented May 29, 2026

What this does

This PR replaces the Mintlify documentation setup with a Docusaurus 3.10 site
that builds cleanly and deploys to GitHub Pages via a single CI job. The intent
is to give the team a live, navigable prototype at
https://planetf1.github.io/mellea/ while we verify the migration before
cutting over the canonical docs.mellea.ai domain.

The content of docs/docs/ is preserved almost entirely — changes are purely
mechanical: canonical frontmatter removed, sidebarTitle renamed to
sidebar_label, a handful of admonitions updated to Docusaurus syntax, and
internal links de-prefixed to match the way Docusaurus strips numeric filename
prefixes from doc IDs (01-your-first-generative-programyour-first-generative-program).

Key design decisions

Single docs plugin, two named sidebars. Rather than two separate
@docusaurus/plugin-content-docs instances, the site uses one plugin with
routeBasePath: '/' and both docsSidebar and apiSidebar defined in
sidebars.ts. This avoids SSR failures at the secondary plugin's root route
when only a placeholder API doc exists.

apiSidebar is autogenerated. The docs/docs/api/ tree is wiped and
regenerated by the autogen pipeline on every CI run. A static {type:'doc'}
entry in the sidebar would be deleted on each build; {type:'autogenerated', dirName:'api'} picks up whatever the pipeline emits. Locally, the placeholder
docs/docs/api/index.md acts as the seed.

SidebarFix injection disabled. decorate_api_mdx.py was emitting a
Mintlify-specific import { SidebarFix } from "/snippets/SidebarFix.mdx"
into every generated API MDX file. The snippet no longer exists on disk so
webpack fails. Step 3 in decorate() is now a no-op; no Mintlify artefacts
are needed in Docusaurus.

<Icon> shim added. mdxify generates <Icon icon="github" .../> as a
source link in every API heading. An Icon MDX component shim is registered
globally; it renders the GitHub SVG and handles the string-form style
attribute that mdxify produces.

onBrokenLinks: 'warn' — the generated api-reference.mdx and
reference/cli.md files contain cross-references that resolve incorrectly
against the Docusaurus route tree. These are a known deferred item (full
autogen pipeline retargeting). All static documentation pages are clean.

Fork/upstream base URL separation. DOCS_BASE_URL is set to /mellea/
when running on planetf1/mellea and / on generative-computing/mellea.
The same docusaurus.config.ts handles both cases via process.env.

What's included

  • docs/docusaurus.config.ts — full config: single-plugin setup, 63 Mintlify
    redirect rules, IBM Plex Sans typography, local search, analytics script
  • docs/sidebars.ts — 11-section manual sidebar plus autogenerated API sidebar
  • docs/src/ — custom CSS (monochrome palette, sidebar badges), Mintlify shim
    components (Card, CardGroup, Icon, Note, Warning), global MDX registration
  • docs/static/CNAMEdocs.mellea.ai
  • _category_.json for all 11 doc sections
  • Autogen pipeline updated to guard against missing docs.json (Docusaurus mode)
    and to disable the Mintlify-only SidebarFix injection
  • CI workflow updated: Node 20 setup, npm ci, Docusaurus build, deploy to
    gh-pages branch via peaceiris/actions-gh-pages

CI status

Build and deploy passing on planetf1/mellea. Live at:
https://planetf1.github.io/mellea/

What's deferred

  • Full autogen pipeline retargeting (sidebar TS emit, slug migration, MDX
    cross-reference cleanup — root cause of remaining onBrokenLinks: 'warn'
    entries)
  • SPA analytics route-change module
  • Soft-warning quality gates (9 new autogen checks)
  • Algolia DocSearch, Cloudflare previews, snapshot versioning
  • markdownlint-climarkdownlint-cli2 bump

Testing

cd docs && npm ci && npm run build   # exits 0
npm run start                         # browse localhost:3000

Spot checks to verify:

  • All 11 sidebar sections expand correctly
  • Dark mode toggles
  • Local search returns results
  • A sample redirect (e.g. /guide/glossary/reference/glossary) works
  • API Reference navbar item shows the generated API tree

planetf1 added 3 commits May 29, 2026 10:47
Replaces the Mintlify configuration with a fully-working Docusaurus 3.10
site deployable to GitHub Pages. The existing docs/docs/ content is
preserved with minimal changes: canonical frontmatter removed, sidebarTitle
→ sidebar_label, admonition syntax updated, numeric-prefix tutorial links
stripped to match Docusaurus ID conventions, and broken old-path links
fixed.

Key additions:
- docs/docusaurus.config.ts: single-plugin setup, 63 Mintlify redirects,
  IBM Plex Sans, local search, analytics script, fork/upstream base-URL logic
- docs/sidebars.ts: manual sidebar matching existing content structure
- docs/src/: custom CSS (monochrome palette), Mintlify shim components
  (Card, CardGroup, Note, Warning), MDXComponents registration
- docs/static/CNAME: docs.mellea.ai
- _category_.json files for all 11 doc sections
- docs/docs/api/index.md: placeholder until autogen pipeline runs

CI workflow (docs-publish.yml) updated to build with Docusaurus and deploy
to gh-pages branch; DOCS_BASE_URL set to /mellea/ on fork, / on upstream.
Autogen pipeline (build.py, generate-ast.py) guards against missing docs.json
when running in Docusaurus mode. codespell skip list updated for package-lock.json.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
The API docs pipeline regenerates docs/docs/api/ on each CI run,
deleting any manually-committed placeholder. Switch apiSidebar from
a fixed {type:'doc', id:'api/index'} entry to {type:'autogenerated',
dirName:'api'} so it works with the placeholder locally and with the
generated MDX tree in CI.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
The inject_sidebar_fix step emits a Mintlify-specific import into every
generated API MDX file. Since the docs site is now Docusaurus, this import
resolves to nothing and breaks the webpack build. Disable the injection;
the Mintlify SidebarFix component is not needed in Docusaurus.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 29, 2026
mdxify emits <Icon icon="github" style="..."/> in every API page heading
as a source link. Register an Icon MDX shim that renders the GitHub SVG
and handles the string-form style attribute that mdxify produces.

Set onBrokenLinks: 'warn' (was 'throw') because the generated api-reference.mdx
and reference/cli.md contain cross-reference links that break when resolved
against the Docusaurus route tree. These are a known deferred item (full
autogen pipeline retargeting). Static docs are clean; only generated pages
emit warnings.

Fix community/building-extensions link to point to the live API backend doc.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants