Files
Waybar/.github/workflows/wiki.yml
T
AlexandClaude Opus 4.8 c76bfc018b ci: auto-sync GitHub wiki module pages from man pages
Add tooling that makes the scdoc man pages the single source of truth and
regenerates the wiki module pages from them:

- .github/wiki/mapping.json: man-page -> wiki-page mapping (aggregation-aware)
- .github/wiki/generate.py: scdoc -> pandoc -> gfm, strips man-only sections,
  concatenates aggregated pages, appends optional extras/<Page>.md
- .github/wiki/extras/: hand-kept appendices (screenshots) with no man equivalent
- .github/workflows/wiki.yml: on push to man/** (or the tooling), regenerate
  and push the wiki; other wiki pages are left untouched

Covers all 65 man pages -> 45 wiki pages (5 new: GPS, Inhibitor, Mango, Menu,
WWAN). Non-module and hand-written wiki pages are never modified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 03:02:10 +02:00

57 lines
1.6 KiB
YAML

name: Sync wiki from man pages
# The scdoc man pages under man/ are the single source of truth for module
# documentation. This workflow regenerates the corresponding GitHub wiki pages
# whenever a man page (or the sync tooling) changes on the default branch.
#
# Only the pages listed in .github/wiki/mapping.json are (re)written; every
# other wiki page (Home, Installation, user showcases, ...) is left untouched.
on:
push:
branches: [master]
paths:
- 'man/**'
- '.github/wiki/**'
- '.github/workflows/wiki.yml'
workflow_dispatch: {}
permissions:
contents: write
concurrency:
group: wiki-sync
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install scdoc and pandoc
run: sudo apt-get update && sudo apt-get install -y scdoc pandoc
- name: Clone the wiki
run: |
git clone \
"https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git" \
wiki
- name: Generate wiki pages from man pages
run: python3 .github/wiki/generate.py --man-dir man --out-dir wiki
- name: Commit and push if changed
working-directory: wiki
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --staged --quiet; then
echo "Wiki already up to date."
else
git commit -m "docs: sync module pages from man (${{ github.sha }})"
git push
fi