CI/CD Integration
oxdoc can automatically verify documentation quality in CI environments.
GitHub Actions
name: Documentation Check
on: [push, pull_request]
jobs:
doc-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: pnpm install
# Maintain 80%+ documentation coverage
- name: Check doc coverage
run: npx @jiji-hoon96/oxdoc coverage ./src --threshold 80
# Verify that @example blocks actually work
- name: Run doc tests
run: npx @jiji-hoon96/oxdoc doctest ./src
# Generate API docs (optional)
- name: Generate API docs
run: npx @jiji-hoon96/oxdoc generate ./src --format markdown --output ./api-docs
Pre-commit Hook
// package.json
{
"scripts": {
"doc:check": "oxdoc coverage ./src --threshold 80",
"doc:test": "oxdoc doctest ./src"
}
}
# Use with lint-staged
npx @jiji-hoon96/oxdoc coverage ./src --threshold 80