Skip to content

docs: Auto-generate API documentation for wiki from driver READMEs. #341

@nedseb

Description

@nedseb

Description

Automatically generate and publish driver API documentation to the STeaMi wiki (Docusaurus) from the README files in the driver repository.

Context

The wiki at wiki.steami.cc uses Docusaurus (Markdown/MDX) and is hosted on Netlify. Each driver in micropython-steami-lib already has a comprehensive README.md with API documentation. Currently, the wiki only links to GitHub READMEs — the documentation is not integrated into the wiki itself.

Goal

When a driver README is updated (via a merged PR), the corresponding wiki page should be updated automatically. No manual copy-paste.

Approach options

Option A — CI copies READMEs to wiki repo (recommended)

A GitHub Action in micropython-steami-lib that, on release:

  1. For each `lib//README.md`, transforms it into a Docusaurus page:
    • Adds frontmatter (`title`, `sidebar_position`)
    • Adjusts relative links (images, other files)
  2. Pushes the generated pages to wiki_steami repo under `docs/software/micropython/drivers/`
  3. Netlify auto-deploys the wiki

Structure in wiki:
```
docs/software/micropython/drivers/
bme280.md # generated from lib/bme280/README.md
ism330dl.md # generated from lib/ism330dl/README.md
...
```

Option B — Docusaurus fetches from GitHub at build time

A Docusaurus plugin that fetches README files from the GitHub API during the wiki build. More elegant but adds a build-time dependency on GitHub availability.

Option C — Git submodule

Add micropython-steami-lib as a submodule in wiki_steami and configure Docusaurus to include `lib/*/README.md` as doc pages. Simple but submodule management can be painful.

Tasks (Option A)

  • Create a script (`scripts/export-docs.sh` or Python) that:
    • Reads each `lib//README.md`
    • Prepends Docusaurus frontmatter
    • Copies to a target directory
  • Add a GitHub Action workflow (`sync-wiki-docs.yml`) that:
    • Triggers on release or push to main
    • Runs the export script
    • Pushes to wiki_steami repo (using a deploy key or PAT)
  • Create the `docs/software/micropython/drivers/` structure in wiki_steami
  • Add a sidebar entry in `sidebars.js` for the drivers section
  • Update the wiki index page to link to individual driver pages instead of GitHub

Related

  • Wiki repo: steamicc/wiki_steami (Docusaurus + Netlify)
  • Current wiki page: `docs/software/micropython/index.md` — links to GitHub READMEs

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions