Skip to content

WIP docs: Migrate docs site from mkdocs-material to mdBook#18337

Open
hakman wants to merge 5 commits into
kubernetes:masterfrom
hakman:mdbook
Open

WIP docs: Migrate docs site from mkdocs-material to mdBook#18337
hakman wants to merge 5 commits into
kubernetes:masterfrom
hakman:mdbook

Conversation

@hakman
Copy link
Copy Markdown
Member

@hakman hakman commented May 14, 2026

Summary

Replaces the Python/mkdocs-material build with stock mdBook v0.5.2.
Drops the pip-based Alpine image and the custom Python macro plugin
in favor of a single ~50-line shell script that fetches a pinned binary.

Notes

  • 73 kops_feature_table() calls inlined as static markdown tables.
  • Netlify's default pretty_urls resolves legacy /foo/ paths to mdBook's /foo.html — no per-page redirects needed.
  • Stock mdBook theme is plainer than Material (no nav tabs, no accent palette). Custom theming is a follow-up if desired.
  • mdBook version pinned via MDBOOK_VERSION in hack/build-mdbook.sh.

Mostly done by Claude Opus

/cc @rifelpet @justinsb

hakman added 5 commits May 14, 2026 11:43
Introduces a parallel mdBook-based docs build to evaluate replacing
mkdocs-material. Stock mdBook v0.5.2, no preprocessors. Adds book.toml,
docs/SUMMARY.md covering all current pages, hack/build-mdbook.sh to
fetch the pinned binary, and Makefile targets build-docs-mdbook /
live-docs-mdbook. Existing mkdocs build is untouched.
Replaces the 73 {{ kops_feature_table(...) }} call sites across 14
docs files with the equivalent rendered markdown tables, and deletes
the hack/mkdocs_macros/ Python module plus the mkdocs-macros-plugin
dependency. The mkdocs build still loads the macros plugin via
default settings for the few remaining Jinja escapes in
contributing/adding_a_feature.md; that escape syntax is cleaned up
in the Netlify cutover commit. mdBook needs no templating layer for
the inlined tables.
netlify.toml now runs hack/build-mdbook.sh instead of the mkdocs
Python pipeline, dropping the PYTHON_VERSION env. Netlify's default
pretty_urls handles legacy /foo/ paths against mdBook's /foo.html
output without per-page rewrites. Also unwraps the 22 remaining
{{ '...' }} mkdocs-macros Jinja escapes in adding_a_feature.md and
cluster_template.md so the embedded Go template snippets render
literally under mdBook.
Deletes mkdocs.yml, images/mkdocs/, docs/.pages and the
Docker/pip-based docs pipeline. Renames the mdbook Makefile targets
to the canonical live-docs / build-docs names, retargets the
contributing docs at SUMMARY.md, and swaps the leftover .md-content
selector in extra.css for mdBook's .content class.
mdbook serve was binding to 0.0.0.0 and then opening
http://0.0.0.0:3000/ in the browser, which is unroutable. Switches
to localhost and lets the user click the printed URL. Adds a PORT
env var override for collisions.
@k8s-ci-robot k8s-ci-robot requested a review from justinsb May 14, 2026 11:11
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2026
@k8s-ci-robot k8s-ci-robot requested a review from rifelpet May 14, 2026 11:11
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/documentation labels May 14, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hakman for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants