Input formats
Doc Detective supports multiple documentation formats for defining and detecting tests. You can use inline tests and detected tests in any of these formats.
Supported formats
Doc Detective includes built-in support for:
- Markdown: The most common format, with support for MDX and various Markdown flavors
- DITA: XML-based format with semantic markup for technical documentation
- AsciiDoc: Lightweight markup language popular in technical writing
- HTML: Standard web format with HTML comment syntax
Every format detects the same steps, written in its own syntax.
How input formats work
Input formats are defined in your configuration file using the fileTypes array. Each file type definition includes:
- name: A descriptive name for the file type.
- extensions: File extensions that should be processed with this configuration.
- inlineStatements: Where inline test statements live. The built-ins read them from comments.
- markup: Definitions that detect steps from your content.
Doc Detective parses each file, so it knows a link from a code sample. It doesn’t read statements or bold text inside code blocks, inline code, or other code. A sample that shows a Doc Detective test stays a sample. To detect steps your own way, see Selectors.
What gets detected
With step detection on, each built-in detects these steps:
DITA also clicks, finds, and types into <uicontrol> elements, finds <wintitle> elements, and checks <link> elements. See DITA.
Each format writes links, bold text, images, and code blocks its own way. The Selectors page lists the syntax each format uses.
Default configurations
Doc Detective includes default configurations for common file types:
Choosing an input format
The input format you choose depends on your documentation toolchain and team preferences:
- Use Markdown for most modern documentation sites and static site generators
- Use DITA for enterprise documentation with semantic markup requirements
- Use AsciiDoc for technical documentation with advanced formatting needs
- Use HTML for web-based documentation or when working directly with HTML files
Custom input formats
You can define custom input formats by extending the default configuration. See Custom inputs for more information.
Next steps
Learn more about each specific input format: