Skip to navigation

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:

StepDetected from
goToA link to an http or https URL, right after “Go to”, “Open”, “Navigate to”, “Visit”, “Access”, “Proceed to”, “Launch”, or “Browse to”
checkLinkEvery link to an http or https URL
clickBold text right after “Click”, “Tap”, “Left-click”, “Choose”, “Select”, or “Check”
findAll bold text
typeQuoted text after “Type”, “Enter”, or “Press” in prose, as in Type "kittens"
screenshotAn image with the screenshot class. The image’s source is the file to save
httpRequestA code block tagged http, or with no language, that holds a request such as GET https://example.com
runCodeA code block tagged bash, python, py, javascript, or js, unless testIgnore follows the language. These steps are unsafe, so they run only with allowUnsafeSteps

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:

{
"fileTypes": [
{
"name": "markdown",
"extensions": ["md", "markdown", "mdx"]
},
{
"name": "html",
"extensions": ["html", "htm"]
},
{
"name": "asciidoc",
"extensions": ["adoc", "asciidoc", "asc"]
},
{
"name": "dita",
"extensions": ["dita", "ditamap", "xml"]
}
]
}

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: