The doccident project aims to be the standard for validating code examples in documentation. While the current version supports a wide array of languages and features, there are several exciting directions for future development.
- Execution Timeout: Configurable timeout for each snippet (default 5 minutes) to prevent infinite loops or hangs. Use
--timeout <ms>to customize. - Summary Table: Markdown-formatted summary table with language, file, line, status, and execution time.
- Per-Snippet Configuration: Pass arguments (
<!-- args: -->) and environment variables (<!-- env: -->) to individual snippets. - Output Verification: Assign IDs to snippets and verify their output in subsequent blocks with exact, fuzzy (ignore-whitespace), or regex matching.
- Output Updates (Snapshots): Use
--update-outputto automatically populate output blocks with actual results.
- Stream Capture: Capture
stderrseparately fromstdoutand allow verifying error messages specifically.
- Swift: Add support for Swift using
swiftorswiftc. - PHP: Add support for PHP scripts.
- Ruby: Add support for Ruby scripts.
- Lua: Add support for Lua scripts.
- JUnit XML Output: Generate JUnit-compatible XML reports for better integration with CI/CD dashboards.
- Dependency Graph: Instead of linear accumulation, allow snippets to declare explicit dependencies on other snippets (e.g.,
<!-- depends-on: setup-db -->). This would enable more complex, non-linear tutorials. - Idempotency Wrappers: For compiled languages in shared mode, automatically wrap code to prevent side-effect duplication (e.g., checking if a struct is already defined in C before defining it).
- Runtime Arguments: Distinguish between compiler flags and runtime arguments for compiled languages.
- Worker Threads: Execute tests in parallel where possible (especially for isolated snippets) to significantly speed up validation of large documentation sets.
- Live Editing: Explore integrations or plugins (e.g., for VS Code or web) that allow users to run
doccidentchecks on a single block directly from their editor.
- Polyglot Workflows: Support scenarios where a Python script generates data, saves it to a file, and a C program reads it. This would require an ordered execution graph across languages.
- Pre-commit Hooks: Provide an official
pre-commithook definition for easy adoption in Python/Node projects. - GitHub Action: Publish a dedicated GitHub Action to the marketplace for zero-config CI usage.