mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-19 21:38:07 -04:00
fix(scripts): improve nix options doc generator
- Restore missing description on hm enable option (fixes nix build warning)
- Rewrite format_default_value into format_value with example support and nix code blocks
- Fix Nix markup stripping: {tag}`content` now preserves backtick content
- Generalize ::: block handling beyond {.note} to any block type
- Switch output from Markdown table to labeled fields format
This commit is contained in:
parent
c3ec4c6142
commit
d5db98cfb7
3 changed files with 87 additions and 63 deletions
19
.github/workflows/generate-nix-options-docs.yml
vendored
19
.github/workflows/generate-nix-options-docs.yml
vendored
|
|
@ -6,6 +6,7 @@ on:
|
|||
- 'nix/**-modules.nix'
|
||||
- 'nix/generate-options.nix'
|
||||
- 'flake.nix'
|
||||
- '.github/scripts/generate-nix-options-docs.py'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'nix/**-modules.nix'
|
||||
|
|
@ -35,20 +36,10 @@ jobs:
|
|||
|
||||
- name: Format to Markdown
|
||||
run: |
|
||||
OUTPUT_FILE="docs/nix-options.md"
|
||||
|
||||
cat << 'EOF' > $OUTPUT_FILE
|
||||
---
|
||||
title: Nix Module Options
|
||||
description: NixOS and Home Manager configuration options for mangowm.
|
||||
---
|
||||
|
||||
> **Note:** This document is automatically generated from the Nix module source code.
|
||||
|
||||
EOF
|
||||
|
||||
python3 ./.github/scripts/generate-nix-options-docs.py result-nixos/share/doc/nixos/options.json $OUTPUT_FILE "NixOS Module Options"
|
||||
python3 ./.github/scripts/generate-nix-options-docs.py result-hm/share/doc/nixos/options.json $OUTPUT_FILE "Home Manager Options"
|
||||
python3 ./.github/scripts/generate-nix-options-docs.py \
|
||||
result-nixos/share/doc/nixos/options.json \
|
||||
result-hm/share/doc/nixos/options.json \
|
||||
docs/nix-options.md
|
||||
|
||||
- name: Auto-commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue