Skip to content

Conversation

@basnijholt
Copy link
Owner

Summary

  • Add a documentation site using the Zensical framework with automatic content extraction from README.md
  • Uses markdown-code-runner to populate docs pages from README sections marked with SECTION comments
  • Same approach as adaptive-lighting docs

Changes

  • Add SECTION markers to README.md for content extraction
  • Create docs_gen.py module to extract and transform README sections
  • Add docs/ directory with pages:
    • index.md - Home page with features and intro
    • getting-started.md - Installation and quick start
    • examples.md - Usage examples from README
    • contributing.md - Contributing guide
    • usage/python-api.md - Python API documentation
    • usage/cli.md - CLI reference
    • usage/github-actions.md - GitHub Actions integration
  • Add run_markdown_code_runner.py script to update all docs files
  • Add GitHub Actions workflow for docs deployment
  • Add zensical.toml configuration
  • Add docs dependencies to pyproject.toml

Test plan

  • Build docs locally with uv run zensical build
  • Verify docs deploy correctly to GitHub Pages
  • Check all pages render properly
  • Verify links work correctly

Notes

  • The workflow temporarily deploys from docs-site branch for testing
  • TODO before merging: Remove docs-site from deploy conditions in .github/workflows/docs.yml

Set up a documentation site using the Zensical framework with automatic
content extraction from README.md using markdown-code-runner.

- Add SECTION markers to README.md for content extraction
- Create docs_gen.py module to extract and transform README sections
- Add docs/ directory with pages (index, getting-started, examples, etc.)
- Add run_markdown_code_runner.py script to update all docs files
- Add GitHub Actions workflow for docs deployment
- Add zensical.toml configuration
- Add docs dependencies to pyproject.toml
- Add site/ to .gitignore for build output
Track fence delimiter character and length to correctly handle
nested fences (e.g., ```` containing ```). Previously, a simple
toggle would incorrectly treat inner ``` as a fence boundary.
Instead of escaping markers with zero-width spaces, docs templates
now contain placeholders in OUTPUT sections. The content is generated
during CI build and never committed.

Benefits:
- No escaping logic needed (removed ~70 lines of complex fence detection)
- Templates in repo are clean and copyable
- No zero-width space characters anywhere
- Simpler and more maintainable

Changes:
- docs_gen.py: Remove escaping, add --reset and --verify commands
- docs/*.md: Reset OUTPUT sections to placeholders
- docs.yml: Add verify and generate steps before build
- pre-commit: Add hook to prevent committing processed content
- Remove pip caching section (uv handles caching automatically)
- Use Python API instead of subprocess for processing files
- Use PEP 723 inline script dependencies with uv shebang
The OUTPUT placeholder now explains why we don't commit generated
content: to keep docs copyable and avoid recursion issues.
Check for <!-- PLACEHOLDER --> marker instead of full text,
so the explanatory message can be updated without breaking verification.
@basnijholt basnijholt merged commit 32b1b6a into main Jan 14, 2026
16 checks passed
@basnijholt basnijholt deleted the docs-site branch January 14, 2026 12:56
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.

2 participants