Skip to content

Migrate docs from GitBook to a self-updating MkDocs + mike pipeline - #14

Open
pfeerick wants to merge 1 commit into
EdgeTX:edgetx_2.12from
JimB40:mkdocs-migration-pr
Open

pfeerick wants to merge 1 commit into
EdgeTX:edgetx_2.12from
JimB40:mkdocs-migration-pr

Conversation

@pfeerick

@pfeerick pfeerick commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Replaces the GitBook-based publishing for this repo with a versioned MkDocs Material site built by mike, where the API reference is generated directly from /*luadoc*/ annotations in the EdgeTX firmware source rather than hand-maintained.

Live preview (this fork's own GitHub Pages, same content this PR proposes): https://jimb40.github.io/lua-reference-guide/

Why

  • The API reference (constants, functions, LVGL widgets) drifts out of sync with the firmware whenever it's hand-maintained separately. This pipeline (tools/docs_pipeline.py) parses the firmware's own /*luadoc*/ comment blocks into a normalized model and renders the API reference + a matching LuaLS .d.lua type-stub from it, so a source annotation change is the only place a fact needs to change.
  • GitBook's own versioning didn't give a clean way to browse older EdgeTX releases' docs side by side. mike publishes every version (2.4 through the current release) to one gh-pages branch with a version switcher in the header, and the legacy GitBook-era versions are preserved as-is (imported via tools/import_legacy_gitbook.py, converting each old branch's SUMMARY.md + content into the same MkDocs shell, with a banner marking them as historical).
  • Hand-authored guide content (Programming, API Overview, Radios) stays hand-authored -- this isn't a wholesale content rewrite, just a different publishing mechanism, with a CONTRIBUTING.md documenting which parts of the tree are generated vs. hand-edited.

What's included

  • tools/docs_pipeline.py -- extracts the API model from firmware source, validates it, and renders the Markdown + LuaLS output.
  • tools/import_legacy_gitbook.py -- one-time-per-version conversion of an old GitBook-era branch into the same MkDocs shell.
  • website/md-docs/ -- the hand-authored guide content plus pipeline-generated API reference.
  • .github/workflows/publish-versioned-docs.yml -- deploys main -> dev and edgetx_2.12 -> latest via mike on push.
  • mkdocs.yml / mkdocs.dev.yml -- public and internal-review site configs (the dev config un-excludes a couple of pipeline-internal review pages).
  • MIGRATION-PLAN.md / HANDOFF.md / CONTRIBUTING.md -- the design decisions and current state, for context on why things are structured the way they are.

About this diff

This repo's edgetx_2.12 and the fork this was developed on (JimB40/lua-reference-guide, same edgetx_2.12 branch name) turned out to have no common git ancestor, so a normal PR between them wasn't possible -- this branch is a single squashed commit on top of this repo's actual edgetx_2.12 history instead, replacing its GitBook content wholesale. The fork's own history has the full incremental development record if that's useful during review.

Given the size (this replaces the entire publishing model), I'd rather this start a conversation about whether/how to land it than assume a straight merge -- happy to split it up, adjust the approach, or walk through any part of it.

Still open

  • gh-pages for this repo isn't populated yet -- that's a separate step once there's agreement on landing the source.
  • GitHub Pages isn't currently enabled via repo settings for EdgeTX/lua-reference-guide (the live GitBook site appears to be served another way) -- enabling "Deploy from a branch: gh-pages" would be needed for this to actually go live here.
  • The custom domain (luadoc.edgetx.org, already set as site_url in mkdocs.yml and present as a CNAME file on this branch) would need to stay pointed at GitHub Pages once that's enabled.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HLXbKn4rY3NihRnqH89jmD

Replaces this repo's GitBook-based publishing with a versioned MkDocs
Material site built by mike. The API reference (constants, functions,
LVGL widgets) is now generated directly from /*luadoc*/ annotations in
the EdgeTX firmware source (tools/docs_pipeline.py extracts a
normalized model from those comment blocks and renders both the
Markdown pages and a matching LuaLS .d.lua type-stub from it) instead
of being hand-maintained separately, so a source annotation change is
the only place a fact needs to change. Hand-authored guide content
(Programming, API Overview, Radios) stays hand-authored -- this is a
publishing-mechanism change, not a content rewrite; CONTRIBUTING.md
documents which parts of the tree are generated vs. hand-edited.

Also adds tools/import_legacy_gitbook.py, a one-time-per-version
converter that brings each older GitBook-era branch's SUMMARY.md +
content into the same MkDocs shell (with a banner marking it
historical), and .github/workflows/publish-versioned-docs.yml, which
deploys main -> dev and edgetx_2.12 -> latest via mike on push.

This is squashed to a single commit on top of this branch's real
history (rather than carrying the full history of the fork this was
developed on, which had no common ancestor with this repo's own
edgetx_2.12 and couldn't be opened as a normal PR) -- see the linked
fork's commit history for the full incremental development record if
useful during review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLXbKn4rY3NihRnqH89jmD
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