Guide

Testing Markdown code examples in any language with txm

txm runs the code blocks you annotate with HTML comments, in any language, and compares their output exactly. Blocks without annotations are not run.

Published
Updated
November 17, 2026
Reading time
11 min
Facts checked against
The txm README and npm registry data for 8.2.0 and the TAP version 13 specification, with every code block run on txm 8.2.0, Node.js 24 and bash (November 17, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerHow txm selects and runs examplesWalk through an annotated READMEChoose expectations that test the contractRun txm in CICompare txm with the engineTriage findingsA checklist for annotated pagesWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

txm is a Node.js command-line tool that tests annotated Markdown examples and reports results in TAP format. A program annotation chooses the command that receives a block on standard input, so the tested language can be any language that command supports. DocsAlive provides a complementary scan: engine 0.6.3 ignores txm annotations, runs recognized unannotated blocks too, executes JavaScript on Node 20, and does not compare JavaScript output. Each page starts in an empty work directory, so a relative require of a repository file fails as a runtime error; packages need an install step or --setup.

Use txm when you need a precise input/output contract for selected examples. Use the scan to look beyond annotations and classify failures, while keeping its language coverage and clean-work-directory behavior in view. Neither a txm pass nor a scan pass proves that every visible example was exercised.

How txm selects and runs examples

txm reads annotations in HTML comments before code blocks. A program annotation sets a shell command for following tests, until another program is declared. txm sends each input block to that command on standard input. The command may be a whole script, so the model is not limited to JavaScript even though txm itself runs on Node.js.

The checked release is txm 8.2.0. Its package metadata specifies Node 16 or newer; its README describes Node.js as a requirement and says the minimum tested version is the current LTS. The example run below used Node 24.22.1.

Named in, out, and err annotations associate a block with input, expected stdout, or expected stderr. Names must match exactly. The halves can appear in any order in the document, but missing input, missing both output and error expectations, or duplicate pieces produce errors. Matching is exact text; the diff can show invisible characters such as spaces.

A check test runs its block and ignores output. It passes when the exit status is zero, or matches an exit annotation. exit nonzero accepts any nonzero status, which is convenient for an error example but cannot prove that the intended error occurred. If any test has an only annotation, tests without it are skipped.

Indented and fenced blocks both work. Each annotation is its own comment. Within a comment, the hyphen escape #- becomes a hyphen. The program receives TXM_INDEX, TXM_NAME, TXM_INPUT_LANG, and TXM_HAS_COLOUR environment variables. These details matter when a shared test command needs to identify the current test or control its display.

Walk through an annotated README

The package name acme-slug and the module slug.js below are illustrative, not a published package. The README and local files show the relationship between annotations, program selection, and results.

Install txm as a development dependency:

npm install --save-dev txm

The illustrative module exposes a slug function and a shortening function. The README will test both the returned text and a self-checking call.

// Tiny slug helpers used in the DocsAlive guides.
function slugify(text, sep = "-") {
  const keep = [...text].map((c) => (/[\p{L}\p{N}]/u.test(c) ? c.toLowerCase() : " ")).join("");
  return keep.split(/\s+/).filter(Boolean).join(sep);
}

function truncateSlug(slug, limit) {
  if (slug.length <= limit) return slug;
  const cut = slug.slice(0, limit + 1);
  return cut.includes("-") ? cut.slice(0, cut.lastIndexOf("-")) : slug.slice(0, limit);
}

module.exports = { slugify, truncateSlug };

The illustrative README first selects Node. It pairs a named input with expected stdout, uses an assertion for a check test, and expects a nonzero exit for invalid input. It then selects Bash for a separate shell test. The output blocks are part of txm’s contract because their names match the corresponding inputs.

# acme-slug

<!-- !test program node -->

Make a slug:

<!-- !test in make a slug -->

```js
const { slugify } = require("./slug.js");
console.log(slugify("Docs That Run Everywhere"));
```

It prints:

<!-- !test out make a slug -->

```text
docs-that-run-everywhere
```

Shorten it for a URL. This example checks itself with assert:

<!-- !test check shorten a slug -->

```js
const assert = require("node:assert");
const { truncateSlug } = require("./slug.js");
assert.strictEqual(truncateSlug("docs-that-run-everywhere", 13), "docs-that-run");
```

Passing something that is not a string throws:

<!-- !test exit nonzero -->

<!-- !test check bad input -->

```js
require("./slug.js").slugify(42);
```

<!-- !test program bash -->

The same slug from a shell:

<!-- !test in shell slug -->

```bash
node -e 'console.log(require("./slug.js").slugify("Hello, World"))'
```

<!-- !test out shell slug -->

```text
hello-world
```

Run txm against the README from the project directory:

npx txm README.md

The checked run produced four passing tests in TAP version 13. Those four results correspond to the annotated tests; an unannotated block would not add a result.

TAP version 13
1..4
ok 1 make a slug
ok 2 shorten a slug
ok 3 bad input
ok 4 shell slug

# 4/4 passed
# OK

The next change is broken on purpose relative to the README. It changes the default separator and renames the shortening function, leaving the documented calls and expected values behind.

--- a/slug.js
+++ b/slug.js
@@ -1,13 +1,13 @@
 // Tiny slug helpers used in the DocsAlive guides.
-function slugify(text, sep = "-") {
+function slugify(text, sep = "_") {
   const keep = [...text].map((c) => (/[\p{L}\p{N}]/u.test(c) ? c.toLowerCase() : " ")).join("");
   return keep.split(/\s+/).filter(Boolean).join(sep);
 }

-function truncateSlug(slug, limit) {
+function shortenSlug(slug, limit) {
   if (slug.length <= limit) return slug;
   const cut = slug.slice(0, limit + 1);
   return cut.includes("-") ? cut.slice(0, cut.lastIndexOf("-")) : slug.slice(0, limit);
 }

-module.exports = { slugify, truncateSlug };
+module.exports = { slugify, shortenSlug };

After the change, two output checks mismatch and the shortening check exits with an error. The invalid-input test still passes because any nonzero status satisfies its expectation. The checked run has one pass and three failures, and txm exits with status 1.

not ok 1 make a slug: output mismatch
  ---
  expected stdout: |
    docs-that-run-everywhere

  actual stdout: |
    docs_that_run_everywhere

  program: 'node'
...
not ok 2 shorten a slug: program exited with error
  ---
  program: 'node'
  exit status: 1
  stderr: |
    [stdin]:3
...
    TypeError: truncateSlug is not a function
...
ok 3 bad input
not ok 4 shell slug: output mismatch
...
# 1/4 passed
# FAILED 3

The illustrative typo.md below is broken on purpose. Its input is named a, while its expected output is named b. txm treats these as two incomplete tests rather than guessing that they belong together.

<!-- !test program node -->

<!-- !test in a -->

```js
console.log(1)
```

<!-- !test out b -->

```text
1
```

The checked run reports both missing halves and exits with status 1. When a page contains many annotations, search for the full test name on both sides before changing the example itself.

not ok 1 a: only input defined
...
not ok 2 b: input not defined
...
# 0/2 passed
# FAILED 2

Choose expectations that test the contract

Use an in and out pair when the exact stdout is a stable part of what the page promises. This catches a changed value even if the program exits successfully. Review spaces and line endings when a mismatch looks visually identical: exact matching makes invisible differences relevant.

Use err when the complete stderr is stable and is the contract you intend to check. txm compares against all of stderr. A Node stack trace can include paths and other details that make a one-line expected error brittle. A check combined with exit nonzero avoids matching the full trace, but accepts an unrelated failure too. Alternatively, select a program that filters stderr and make the filtered contract explicit.

A check can contain its own assertions. Give those assertions enough context to identify what failed, and consider whether the example remains useful to a reader who copies it. An exit annotation can require a specific status; exit nonzero is broader. When the exact error matters, do not treat a generic nonzero result as proof of its cause.

Unannotated blocks are a separate coverage problem. txm neither runs nor reports them. A checked probe containing an unannotated JavaScript block that threw still reported the one annotated test as passing. Audit the rendered page against the test inventory, especially after adding examples. The JavaScript docs testing guide discusses other ways to exercise examples.

Run txm in CI

The command accepts an optional filename; without one, it reads standard input. --jobs controls parallel tests and defaults to the number of CPUs reported by the operating system. Results still print in definition order. Use --jobs 1 when serial execution helps investigate shared resources, but do not assume parallel execution is safe for tests that mutate the same file.

txm exits zero if and only if all tests pass. It also offers --help and --version. Color can be controlled with --color or --no-color, or with FORCE_COLOR and NO_COLOR. TAP version 13 output makes the test list and status suitable for tools that consume that format.

Make the working directory and dependencies explicit in CI. A program that reads a local module needs that module available where it executes. A test that passes only because a developer has a global package or generated file is weaker evidence for a new reader. Check the documented installation path separately from the test harness.

Compare txm with the engine

txm feature What txm does What the engine does in 0.6.3
Annotation selection Runs annotated tests; unannotated blocks are absent from the report Ignores annotation comments and runs recognized unannotated blocks too
Program Uses the selected shell command for following tests Chooses behavior from the fence language
Input and output names Matches named halves and reports incomplete or duplicate tests Does not interpret txm names
stdout and stderr Compares annotated expectations as exact text Does not compare JavaScript output or txm output blocks
check and exit Tests exit status, including an optional nonzero expectation Ignores those annotations and classifies actual execution results
only Skips tests without it when an only test exists Ignores the annotation
Local module The program can use files available in its working environment Each page starts in an empty work directory; repository files are not copied in
JavaScript runtime Runs the chosen program Runs recognized JavaScript fences on Node 20

In the clean-sandbox probe of the README, the JavaScript and shell examples that required the illustrative local module failed as runtime errors needing review. That is a setup difference, not proof that the module itself is broken. Install the package through the page or --setup when that reflects the reader’s path. A file that exists only in your repository checkout is not available to the page in the scan.

When the examples were instead run from the repository folder for a separate probe, the simple JavaScript call ran before and after the separator change: the engine did not compare its output. The renamed function and invalid-input examples produced runtime errors. The text output blocks were skipped. Keep txm’s exact expectations for the values it is meant to guard.

The engine compares printed output only in Python pycon or python-repl sessions. It also has a known limitation for unknown fence labels: a label with no checker can be reported as passing without being run or parsed. Check framework coverage and the operation behind a status.

Triage findings

Finding Likely cause What to do
A visible block has no txm result It has no annotation Add an appropriate test or record why it is intentionally uncovered
Input or output is missing Names differ, a half is absent, or a piece is duplicated Match names exactly and remove duplicate definitions
Output mismatch The implementation, expected text, or whitespace changed Inspect the exact diff and decide which behavior is correct
Expected-error test passes unexpectedly exit nonzero accepts any failure Check the error more specifically or use a controlled stderr filter
Error expectation is brittle Full stderr includes stack traces or paths Make the expectation stable or use a check with a consciously broader exit condition
Relative module fails in a scan The page’s work directory starts empty Provide a reader-realistic install or setup path; review the runtime error
JavaScript runs but a value changed No txm output assertion covers it, or only the scan ran Add or retain an exact txm expectation
Tests interfere with each other Parallel jobs share external state Isolate test resources or investigate with one job

The README testing guide covers the full onboarding path; CLI docs testing covers commands, prerequisites, and exit behavior. If prompt-and-output examples are central to your docs, compare byexample as well.

A checklist for annotated pages

[ ] List the examples readers are expected to run.
[ ] Confirm every intended txm test has an annotation and a program.
[ ] Match in, out, and err names exactly and remove duplicates.
[ ] Choose exact output checks for stable, meaningful values.
[ ] Review full stderr expectations for paths and unstable traces.
[ ] Check whether nonzero exits could hide an unrelated failure.
[ ] Remove accidental only annotations before merging.
[ ] Make dependencies and working-directory assumptions explicit.
[ ] Review unannotated fences and scan findings separately.
[ ] Rerun the affected tests after changing code or documentation.

Where DocsAlive fits

txm is a strong fit for explicitly annotated, language-independent contracts. Its selected program can execute a language-specific tool and its named expectations can catch changed text. That precision depends on authors annotating the examples they want covered.

A scan with DocsAlive adds a page-oriented pass over recognized fences, a fresh container for each page, and triage of likely docs bugs versus results needing context. It does not interpret txm’s annotations or replace its JavaScript output checks. Read the CLI reference for setup and scope, and findings for categories.

For a Python-focused plugin with its own markers, see pytest-codeblocks. For Sphinx directive tests and Markdown fences, see sphinx.ext.doctest. Keep the tool choice tied to the examples and contracts your readers depend on.

The sources we checked

These sources were read on November 17, 2026. Engine behavior was checked against engine 0.6.3, the engine code in the deployed release, on the same day.

Source What it covers
txm repository Annotations, CLI behavior, matching, and supported test patterns
TAP version 13 specification The test output format

FAQ

Can txm test languages other than JavaScript?

Yes. txm is a Node.js command-line tool, but the program annotation selects the command that receives each test input. That command can run another language or a script.

Does txm run every code block in a Markdown page?

No. Blocks without test annotations are neither run nor reported. Compare the page with the test inventory to find examples that have no coverage.

Can an expected failure pass for the wrong reason?

An exit nonzero expectation accepts any nonzero status. It can therefore accept an unrelated crash. Use a more specific check when the cause of the failure is part of the documented contract.

Why did txm report two errors for one naming typo?

Input and expected output are matched by name. If their names differ, txm sees one test with only input and another without input. Correct the names and rerun the page.

How does DocsAlive handle txm pages?

Engine 0.6.3 ignores txm annotations and runs recognized unannotated blocks. It runs JavaScript on Node 20 without comparing JavaScript output. Each page starts in an empty work directory, so requiring a repository file by relative path fails as a runtime error; packages need an install step or --setup.

Should I use txm and a scan together?

They answer different questions. txm checks the contracts authors annotate, including exact expected text. A scan can surface recognized unannotated examples and classify failures, but it does not reproduce txm annotations or JavaScript output matching.

Keep reading
Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs Testing: How to Test the Code Samples in Your Docs

Why code examples in documentation break, the ways teams test them (doctest, docs-as-tests, CI runners) and how to run every sample on each release.

Two lenses held over the same documentation page, each bringing a different layer into focusComparison

Vale vs markdownlint: What Each Docs Linter Catches

Vale checks prose style; markdownlint checks Markdown structure. What each catches, sample configs, running both in CI and what neither one tests.

Blueprint of two documentation pages: one with a handwritten test script, one whose code blocks are framed and checkedComparison

Doc Detective vs DocsAlive: Testing the Code in Your Docs

Doc Detective is a free, open-source docs-as-tests framework; DocsAlive is a hosted docs CI for code examples. Features, price, setup and when to use each.

A machine blueprint above a ruled documentation page, with a caliper measuring between themComparison

Promptless Alternative: Promptless vs DocsAlive Compared

Promptless drafts docs updates from what you ship; DocsAlive runs the code examples you've published. Features, pricing, security and when to use each.

A long workbench of outlined testing instruments, each with a small lime light, beside a stack of documentation pagesGuide

Best Free Tools to Test Code Examples in Documentation

Free, open-source tools that run the code examples in your docs: rustdoc, Go examples, doctest, pytest plugins, Sphinx doctest, Doc Detective and byexample.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing SDK Docs Before Every Release: A Release-Gate Guide

Test SDK and client-library docs against the package you ship: build the wheel or npm tarball, install it clean, run every example, and gate the release in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test Quickstarts and Tutorials in Your Docs

Test the onboarding path a new reader follows: run quickstarts in a clean environment, in page order, sort real bugs from credentials and fragments, and wire it into CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test CLI Documentation: Commands, Flags and Output

Test the commands a CLI page promises: install in a clean container, run examples in order, compare flags with --help, check exit codes and output, and run it in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

How to Test API Reference Docs: Requests, Responses and SDKs

Test API reference pages against the contract they publish: methods, parameters, request and response examples, SDK snippets, status codes and OpenAPI samples.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for API-first companies

Keep API quickstarts, SDK snippets and curl examples working across releases.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for CLI and developer-tool vendors

Test developer-tool install paths, package managers and command examples across releases.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing README Code Examples: Install, Usage and CI

Keep README install commands and usage examples working with clean environments, output checks and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Notebooks and Executable Docs: Cells, Kernels and Output

Test notebooks in fresh kernels, check meaningful output and manage dependencies, data and drift in CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Docs in GitHub Actions: Pull Requests and Scheduled Checks

Run documentation example checks in GitHub Actions with practical guidance on schedules, path filters, caching, secrets and reports.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Code Examples in MkDocs, Docusaurus and Sphinx Sites

Find and test documentation examples in Markdown, MDX and reStructuredText, alongside site builds and link checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Python Docs Testing: Doctest, Pytest and Markdown

Test Python documentation with doctest, pytest, Markdown example execution and isolated environments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

JavaScript Docs Testing: Node, TypeScript and Modules

Test Node and TypeScript documentation examples across module formats, package versions and type checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Go documentation examples

Test Go example functions and Markdown snippets against the intended module versions in clean environments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Sphinx Docs Testing: doctest, code-block and MyST

Test Sphinx documentation examples: what the doctest and linkcheck builders prove, code-block and literalinclude, MyST fences, and what a Markdown scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

ReadMe Docs Testing: CLI, OpenAPI and Code Examples

Test ReadMe documentation examples: docs-as-code and bi-directional sync, what lint and oas:validate prove, Tabs variants and runnable code.

Outlined documentation pages with a lime pulse line running out of the stackGuide

TypeScript Docs Testing: tsc --noEmit and Runtime

Test TypeScript documentation examples: type-check snippets with tsc --noEmit in a consumer project, then run them, and what each check proves.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docusaurus Docs Testing: Code Blocks, Tabs and MDX

Test Docusaurus documentation examples: builds vs runnable code, code block metadata, Tabs install variants, MDX pages and clean-container runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Mintlify Docs Testing: CodeGroup, Tabs and the CLI

Test Mintlify documentation examples: docs.json, MDX pages, CodeGroup and Tabs variants, what mint broken-links and mint validate prove, and clean runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

MkDocs Docs Testing: Code Examples, Tabs and Snippets

Test MkDocs documentation examples: strict builds, Material tabs, Snippets includes, mkdocstrings pages and clean-container runs.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Installation Instructions: pip, npm and Containers

Test documented install steps in clean environments: pip and extras, venv, npm install vs npm ci, containers and the first import.

Outlined documentation pages with a lime pulse line running out of the stackGuide

AI SDK Docs Testing: LLM Examples, Keys and Drift

Test AI and LLM SDK documentation examples: requests, responses, streaming, tool calls, credentials, model retirements and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing migration guides and changelog examples

Test before and after examples against the right releases and make migration documentation part of the release gate.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs Testing Checklist: Code Examples Before Release

A practical pre-release checklist for testing documentation examples, reviewing gaps and verifying published packages.

Outlined documentation pages with a lime pulse line running out of the stackGuide

The Cost of Broken Code Examples in Documentation

Understand how broken documentation examples create friction in developer adoption and support, and how to reduce it.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Rust documentation examples

Test Rust rustdoc examples and cargo documentation tests, and keep native Rust checks because compiled Rust fences are recognized but not executed.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing VitePress documentation examples

Test VitePress Markdown examples separately from the site build, including code groups, includes and what a plain Markdown scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs in GitLab CI

Run documentation example checks in GitLab CI jobs, keep site builds separate from execution, and review what a scan covers and skips.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing JSON, TOML and YAML examples in docs

Test JSON, TOML and YAML config examples in documentation: parse, schema and tool checks, honest fence labels, fragments, CI jobs and what a scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Java documentation examples

Test Java examples in READMEs, SDK docs and Javadoc: the source launcher, javac, JShell scripts, assertions, @snippet files, CI and what a scan covers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing PHP documentation examples

Test PHP examples in docs: php -l lint, clean-directory runs, assertions with zend.assertions, Composer scratch projects, PHPUnit, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing C# documentation examples

Test C# examples in docs: .NET 10 file-based apps, dotnet build with warnings as errors, test projects, XML doc comments, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Ruby documentation examples

Test Ruby examples in docs: ruby -c syntax checks, clean-directory runs, bundler/inline, minitest assertions, YARD examples, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Kotlin documentation examples

Test Kotlin examples in docs: kotlinc runnable JARs and scripts, -Werror, KDoc @sample in compiled source, kotlinx-knit, fence labels, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Swift documentation examples

Test Swift examples in docs: swift scripts, swiftc -typecheck, DocC snippets compiled by swift build, Swift Testing assertions, CI containers and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing curl and HTTP examples in API docs

Test curl examples in API docs: --fail-with-body, status and JSON checks against a local stub, http fences, credentials and what a docs scan checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Astro Starlight documentation examples

Test code examples in Astro Starlight docs: src/content/docs inventory, Tabs and Expressive Code, Markdoc pages, a Node check script, CI and scan coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Nextra documentation examples

Test code examples in Nextra docs: content/ and app/ sources, fence metadata, Tabs and npm2yarn, a Node check script, CI and an honest scan limitation.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for open-source projects

Test the code examples in open-source docs and READMEs: pull requests from forks, release and scheduled checks, contributor guidelines, triage and the Open source plan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for technical writers and docs teams

How technical writers and docs teams test the code examples they publish: docs-as-code checks, style-guide rules, reading a report, routing findings to engineers.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Docs testing for DevRel teams

How developer advocates test quickstarts, tutorials, workshops and sample READMEs: an inventory, a launch and release cadence, reading a report, and honest reporting.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Hugo documentation examples

Test the code examples in Hugo docs: fences with brace options, the highlight shortcode, Docsy tabs, drafts and theme example sites, scan scope and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing GitBook documentation examples

Test the code examples in GitBook docs synced to Git: the space root, code tags, tabs, reusable includes, invisible characters, scan scope and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing SQL examples in documentation

Test SQL examples in docs: run fences in page order on a fresh database, assert results, handle dialects, SQLite STRICT typing, psql ON_ERROR_STOP and CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing mdBook documentation examples

Test the code in an mdBook: what mdbook test covers, rust attributes, hidden lines, include directives, untagged output fences and a scan-ready copy for CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Docsify documentation examples

Test the code examples in Docsify docs: embedded code files and fragments, docsify-tabs tab sets, Prism grammars, scan scope and a CI check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Jekyll documentation examples

Test the code examples in Jekyll docs: include tags, site variables, highlight tags, posts and _site copies, a scan-ready copy and Ruby hooks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Antora and AsciiDoc documentation examples

Test the code examples in Antora docs: example includes, tagged regions, attributes, failing the build on missing includes and a Markdown copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Fumadocs documentation examples

Test the code examples in Fumadocs docs: npm fences and package-manager tabs, tab groups, the Tabs component, includes, pycon highlighting and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing versioned Docusaurus docs

Test every Docusaurus version readers can reach: versioned_docs copies, versions.json, partials, tabs, per-version scans and old-version triage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Read the Docs documentation examples

Test the code examples on a Read the Docs site: .readthedocs.yaml build jobs, a pycon gate, latest and stable versions, Sphinx, MyST and .rst coverage.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Eleventy documentation examples

Test the code examples in Eleventy docs: Liquid pre-processing, global data, include tags, ignored drafts, raw tags and a rendered copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Zola documentation examples

Test the code examples in Zola docs: Tera content templating, raw tags, config values, hide_lines, drafts, blog posts and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Quarto documentation examples

Test the code examples in Quarto docs: executable cells, display-only fences, freeze and _freeze, a CI profile, cell options and a copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Hexo documentation examples

Test the code examples in Hexo docs: posts, drafts, scaffolds, codeblock and include_code tags, a build check and a scan-ready copy.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing pdoc documentation examples

Test the code examples in pdoc docs: doctest for >>> sessions, fenced docstring examples, the README, private items and a copy to scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Doxygen documentation examples

Test the code examples in Doxygen docs: compiled example files, snippets, Markdown pages, WARN_AS_ERROR and what a scan can and cannot check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing TypeDoc documentation examples

Test the code examples in TypeDoc docs: example tags, includeCode regions, project documents, a compiler check of extracted examples and a scan.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing JSDoc documentation examples

Test the code examples in JSDoc docs: example tags, captions, source patterns, tutorials, a doclet export and a scan-ready copy with assertions.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs examples with pre-commit hooks

Check docs code examples with pre-commit: local hooks, files filters, always_run, pass_filenames, SKIP and --no-verify, and what to leave for CI.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing documentation examples with Deno

Run docs code examples with deno test --doc: JSDoc and Markdown examples, imports, hashbang permissions, ignored blocks and deno check --doc-only.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing documentation examples with Sybil

Test Python docs examples with Sybil and pytest: Markdown parsers, invisible setup, skips, clear-namespace, docstrings and pycon fences a scan can read.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdoc documentation examples

Test the code examples in Markdoc docs: variables in fences, partials, if/else, custom tabs, validate in CI and a scan-ready copy from transform.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown examples with phmdoctest

Test Python examples in README and Markdown files with phmdoctest: sessions, output blocks, directives, --report, generated pytest files and pycon fences.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown code blocks with pytest-markdown-docs

Run Markdown python fences as pytest tests with pytest-markdown-docs: globals hook, fixtures, continuation, notest, retry and pinning the released version.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing command line docs with prysk and Cram

Test CLI docs with prysk and Cram: .t transcripts, exit statuses, (re) and (glob) matches, and generating tests from the console blocks in your Markdown.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Python docstring examples with xdoctest

Run docstring examples with xdoctest: the pytest plugin, google and freeform parsing, permissive output matching, directives, and what it does not check.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing multi-language docs examples with byexample

Test docs examples with byexample: prompt-based language detection, the -l selection, +pass, +skip and timeouts, capture tags, and hidden setup in comments.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Markdown code blocks with mktestdocs

Run Markdown code blocks under pytest with mktestdocs: exact fence labels, memory=True for shared state, bash blocks, custom executors and docstring checks.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing README code blocks with pytest-codeblocks

Run README and Markdown code blocks with pytest-codeblocks: exact python, sh and bash labels, cont, skip and xfail markers, expected output, and gaps.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing Sphinx docs examples with sphinx.ext.doctest

Run Sphinx doctest, testcode and testoutput directives in reStructuredText or MyST pages: groups, hidden setup, global setup and what is never run.

Outlined documentation pages with a lime pulse line running out of the stackGuide

Testing docs examples that need API keys

Test credential-gated docs examples: honest placeholders, offline stubs and fixtures, live sandbox jobs, CI secrets and fork rules, and how a scan classifies them.

A machine blueprint above a ruled documentation page, with a caliper measuring between themGuide

Documentation Drift: How to Detect It Before Users Do

What documentation drift is, why code examples drift first, and practical ways to detect it: ownership, release checks, link and execution tests.

See which of your code samples still run.

Send us a public repository. Our team runs DocsAlive on its docs and emails you the real report within 2 business days. Free, no signup.