This document is meant for developers of doc-as-code. It should be treated as a 'get-started' guide, giving you all needed information to get up and running.
- Clone the repository
- Setup the environment
- No Devcontainer
- Install Bazelisk (version manager for Bazel)
- Create the Python virtual environment:
bazel run //your-docs-dir:ide_support
- Select
.venv_docs/bin/pythonas the python interpreter inside your IDE Note: This virtual environment does not have pip, thereforepip installis not available.
- With Devcontainer (VSCode)
- Click the
reopen current folder in dev containerprompt- If no prompt appears:
ctrl+shift+p=>Dev Containers: Reopen in Containers
- If no prompt appears:
- Click the
- Operating System: Linux (required)
- Core Tools:
- Bazel
- Python
- Git
- VSCode (Optional)
- Several integrations and guides are development primarily with VS Code in mind.
-
Bazel Build System
- Primary build orchestrator
- Handles dependency management
- Coordinates testing and documentation
- Manages multi-repository setup
-
Documentation Tools
- Sphinx with custom extensions
- Esbonio for IDE integration
- Real-time documentation validation
-
Development Tools
- Gitlint for commit message standards
- Pytest for testing infrastructure
- Custom formatters and linters
src/
├── assets/ # Documentation styling (CSS)
├── decision_records/ # Architecture Decision Records (ADRs)
├── extensions/ # Custom Sphinx extensions
│ └── score_metamodel/
│ ├── checks/ # Sphinx-needs validation
│ └── tests/ # Extension test suite
└── templates/ # HTML templates
Find all important bazel commands in the project README
Find everything related to testing and how to add your on test suite here
- Place code in appropriate directory or create new ones. E.g. sphinx-extensions inside
extensions - Create a dedicated test directory
- Include an appropriate README in markdown
If you want to develop your own sphinx extension, check out the extensions guide
The file requirements.in is a PIP requirements file that describe first level dependencies.
The file requirements.txt is a pip-compile lock file that holds the pinned dependency tree calculated from requirements.in.
To update dependencies (e.g. after adding a dependency), run:
bazel run //src:requirements.update
To update the full dependency tree, run
bazel run //src:requirements.update -- --upgrade
-
Documentation
- Keep READMEs up-to-date
- Document architectural decisions in
decision_records/ - Include examples in extension documentation
-
Testing
- Write tests for all new functionality
- Use appropriate test sizes (small/medium/large)
- Include both positive and negative test cases
-
Code Organization
- Follow existing directory structure
- Keep extensions modular and focused
- Use consistent naming conventions
Common issues and solutions:
-
Bazel Build Failures
- Check Bazel version compatibility
- Verify Python environment
- Review recent changes to BUILD files
-
Documentation Build Issues
- Validate Sphinx configuration
- Check for RST syntax errors
- Verify extension dependencies