AsciiDoc input format
AsciiDoc is a lightweight markup language popular in technical documentation. Doc Detective supports inline tests in AsciiDoc files.
File extensions
Doc Detective processes AsciiDoc files with the following extensions:
.adoc.asciidoc.asc
Inline test syntax
AsciiDoc files use line comments for inline tests:
The comment syntax uses parentheses to distinguish test comments from regular AsciiDoc comments.
Test start:
Step:
Test end:
Ignore blocks:
Example
Here’s a complete example of an AsciiDoc file with inline tests:
Detected tests
AsciiDoc currently only supports inline test statements. Detected test patterns (automatic test generation from content) are not included in the default configuration.
To add detected test functionality to AsciiDoc files, you can define custom markup patterns in your configuration. See custom inputs for examples.
Example custom pattern for AsciiDoc:
JSON and YAML syntax
AsciiDoc inline tests support both JSON and YAML syntax:
JSON syntax:
YAML syntax:
Both formats work identically. Choose the format that’s most readable for your team.
Best practices
- Use parentheses in comments to distinguish test statements from regular comments
- Keep test comments on a single line
- Use descriptive test IDs to identify tests in results
- Combine inline tests with custom markup patterns for comprehensive coverage
- Use YAML syntax for simpler, more readable inline tests
Integration with AsciiDoc toolchains
AsciiDoc test comments are standard AsciiDoc comments and don’t affect document rendering. This makes Doc Detective tests invisible to your documentation build process while still being testable.
Common AsciiDoc toolchains that work with Doc Detective:
- Asciidoctor: The most popular AsciiDoc processor
- Antora: Site generator for AsciiDoc documentation
- Jekyll AsciiDoc: AsciiDoc plugin for Jekyll
- Hugo: Static site generator with AsciiDoc support
Next steps
- Learn about inline tests for manual test definition
- See custom inputs to add detected test patterns for AsciiDoc
- Explore Markdown and DITA formats for detected test examples