Guide

Testing documentation examples with Deno

deno test --doc runs the examples in JSDoc and Markdown, but Markdown needs its own imports, permissions must be granted and ignored blocks go unchecked.

Published
Updated
November 17, 2026
Reading time
14 min
Facts checked against
Deno docs on documentation tests, deno test and deno check, with every code block run on Deno 2.9.8 (TypeScript 6.0.3), Node and Python 3 (November 15, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhat Deno runsWhy Deno examples break or go untestedBuild a small documentation testCheck without executingCompare the scan with DenoSee API driftWriting conventions that keep examples testableTriage findingsWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Run deno test --doc against the module and Markdown files that contain your examples. Give Markdown examples their own imports, grant only the permissions they need, and use assertions to test promised values. Use Deno’s doc-aware check flags when you want type-checking without execution, and review ignored examples separately.

In engine 0.6.3, DocsAlive does not run Deno or read JSDoc in source files. It runs supported TypeScript and JavaScript fences under Node, where Deno globals, import-map names and jsr: specifiers do not provide Deno behavior. A Deno global was classified as depends-on-context in the probe; an import-map name and a jsr: import produced runtime-error findings requiring review. The engine does not read Deno’s ignore attribute, and it skips shell lines beginning with deno as host-tool commands. Use Deno for Deno-specific examples and the scan for other supported blocks on the same pages.

What Deno runs

Deno’s documentation test guide describes deno test --doc as a way to evaluate fenced examples in JSDoc comments and Markdown files. It recognizes fences labeled js, javascript, mjs, cjs, jsx, ts, typescript, mts, cts and tsx. When a fence has no language identifier, Deno infers the language from the source document’s media type.

Each example becomes a pseudo test case named for its source file and line range. Deno runs it as a standalone module in the same directory as the documented module. That location matters for relative imports: write the path as it should resolve from the document containing the example.

Exports from a documented module are automatically imported under their exported names into that module’s own JSDoc examples. That convenience does not make those names available in a separate Markdown page. A Markdown example should import the module items it uses, even when a nearby JSDoc example can omit the same import.

A hashbang at the top of an example can declare Deno CLI flags. Deno validates those flags and forwards permission flags to the generated test. The example cannot receive broader permissions than the parent deno test command was granted. The ignore attribute skips a block; in the probe below, the ignored example was not type-checked either.

For type-checking without execution, deno check --doc checks code blocks in JSDoc as well as the code. deno check --doc-only checks documentation blocks in JSDoc and Markdown only. Deno’s documentation points to the former for JSDoc and the latter for Markdown. See the Deno check reference for the command’s scope.

Why Deno examples break or go untested

Deno makes documentation tests unusually cheap: one flag turns the examples in comments and Markdown into tests, with the same type checker the code uses. The failures in the probe below came from the details around that flag, not from the idea itself.

Markdown is not JSDoc. Inside a module's own JSDoc, exported names arrive without an import, so authors get used to writing examples that call the function directly. The same style copied into a Markdown page fails, because the automatic import applies to the documented module only. A reader who pastes the Markdown example into a new file hits the same missing name.

Permissions are a second contract. An example that reads an environment variable or the network can declare its permission in a hashbang, but the doc test never gets more than the parent command allows. A task that grants nothing turns a correct example into a failure, and a task that grants everything hides how much access the example really needs.

Ignored blocks age silently. The ignore attribute is the right tool for examples that cannot run in a test, such as one that sends a message or needs a real account. It also removes the block from type-checking, so a rename or a changed signature leaves the ignored example behind with no warning.

The plain check does not look at examples. A module that type-checks cleanly can still have broken examples, because the ordinary check reads the code, not the comments or the Markdown. The doc flags change that, but the file selection then decides what is covered, and in the probe a directory argument selected nothing for the doc-only check.

Expected values in comments are not checks. A comment that says what a call returns is helpful to a reader, but the doc test only fails when the code throws or an assertion fails. Examples that matter should assert their result.

Build a small documentation test

The following files are illustrative. The package name acme-slug is illustrative and is not a published package. The probe used Deno 2.9.8 and its bundled TypeScript 6.0.3.

Start with a configuration file that maps the assertion library and defines a task. The task names the module, README and documentation directory, and grants access to one environment variable.

{
  "imports": {
    "@std/assert": "jsr:@std/assert@^1.0.0"
  },
  "tasks": {
    "test:docs": "deno test --doc --allow-env=SLUG_MAX mod.ts README.md docs/"
  }
}

The module has two executable JSDoc examples and one intentionally ignored example. Assertions make the first two examples fail if the returned values change. The ignored example needs separate review because the doc test does not check it.

/**
 * Turn a title into a URL slug.
 *
 * @example Basic use
 * ```ts
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(slugify("Hello, World!"), "hello-world");
 * ```
 */
export function slugify(title: string): string {
  return title
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/^-+|-+$/g, "");
}

/**
 * Shorten a slug to at most `max` characters without cutting a word.
 *
 * @example
 * ```ts
 * import { assertEquals } from "@std/assert";
 *
 * const short = truncateSlug("testing-docs-examples-with-deno", 20);
 * assertEquals(short, "testing-docs");
 * ```
 *
 * @example Reading the limit from the environment (not run)
 * ```ts ignore
 * const max = Number(Deno.env.get("SLUG_MAX"));
 * truncateSlug(slugify(Deno.args[0]), max);
 * ```
 */
export function truncateSlug(slug: string, max: number): string {
  if (slug.length <= max) return slug;
  const cut = slug.slice(0, max + 1);
  return cut.slice(0, cut.lastIndexOf("-"));
}

The illustrative README imports the module explicitly. That path is relative to the README, so it differs from the path a page inside docs/ needs.

# acme-slug

Make URL slugs from titles.

```ts
import { slugify } from "./mod.ts";

console.log(slugify("Release notes: v2.0"));
```

The first version of the usage page is broken on purpose. It assumes that Markdown receives the same automatic imports as the module’s own JSDoc. It also asks for an environment permission in the hashbang.

# Usage

Exported names are available without an import in a doc test:

```ts
import { assertEquals } from "@std/assert";

const slug = slugify("Docs That Run");
assertEquals(slug, "docs-that-run");
```

Read the limit from an environment variable:

```ts
#!/usr/bin/env -S deno run --allow-env=SLUG_MAX
const max = Number(Deno.env.get("SLUG_MAX") ?? "40");
console.log(truncateSlug(slugify("A very long title for a page"), max));
```

Plain JavaScript works too:

```js
const words = "one two three".split(" ");
console.log(words.length);
```

Run the module and Markdown examples together. This first command does not grant the environment permission; the missing imports are encountered first.

deno test --doc mod.ts README.md docs/

The excerpt below shows two of the three type errors. Because type-checking failed, no test ran in this attempt. A failure before execution is useful evidence, but it does not establish whether the remaining examples would pass at runtime.

TS2304 [ERROR]: Cannot find name 'slugify'.
    const slug = slugify("Docs That Run");
                 ~~~~~~~
    at file:///.../docs/usage.md#5-11.ts:3:18

TS2304 [ERROR]: Cannot find name 'truncateSlug'.
    console.log(truncateSlug(slugify("A very long title for a page"), max));
                ~~~~~~~~~~~~
    at file:///.../docs/usage.md#14-19.ts:9:17

Found 3 errors.

error: Type checking failed.

Fix the page by importing each name where it is used. The path moves up from docs/ to the module. Keep the hashbang at the start of the environment example.

# Usage

Markdown pages need their own import of the module:

```ts
import { assertEquals } from "@std/assert";
import { slugify } from "../mod.ts";

const slug = slugify("Docs That Run");
assertEquals(slug, "docs-that-run");
```

Read the limit from an environment variable:

```ts
#!/usr/bin/env -S deno run --allow-env=SLUG_MAX
import { slugify, truncateSlug } from "../mod.ts";

const max = Number(Deno.env.get("SLUG_MAX") ?? "40");
console.log(truncateSlug(slugify("A very long title for a page"), max));
```

Plain JavaScript works too:

```js
const words = "one two three".split(" ");
console.log(words.length);
```

Running the earlier command again gets past the import errors. Five tests pass, but the environment example fails because the parent command did not receive the permission requested by the hashbang.

./docs/usage.md#15-22.ts => ./docs/usage.md#15-22.ts:2:6
error: NotCapable: Can't escalate parent thread permissions

FAILED | 5 passed | 1 failed

Grant the same narrow permission on the parent command, or use the task defined in the configuration. Both commands cover the same files in this illustration.

deno test --doc --allow-env=SLUG_MAX mod.ts README.md docs/
deno task test:docs

Both runs passed all six tests in the probe.

ok | 6 passed | 0 failed

A no-argument deno test --doc also found the README, usage page and module in this probe and ran six tests. Explicit paths remain useful when a team wants the intended coverage visible in its task definition.

Check without executing

The next commands demonstrate an important scope difference. In this probe, giving a directory to deno check --doc-only found no matching files. Naming the README and Markdown files checked their four blocks.

deno check --doc-only docs/
deno check --doc-only README.md docs/*.md

Read the warning and the individual checked paths together. A command that exits without checking the intended pages does not provide the coverage a reviewer may assume from its name.

Warning No matching files found.

Check README.md#5-10.ts
Check docs/usage.md#5-12.ts
Check docs/usage.md#15-22.ts
Check docs/usage.md#25-29.js

With no arguments, deno check --doc-only checked only the two JSDoc examples in the module in this probe. Check your own file selection and command output when you adopt the workflow. An ordinary deno check mod.ts checks the module but does not check its examples without the doc flags.

Type-checking and execution answer different questions. A type check can catch an unavailable exported name or an incompatible argument without exercising the example. An executed assertion can also catch a value that changed while remaining type-correct. The TypeScript guide and TypeDoc guide cover related documentation checks.

Compare the scan with Deno

Plan a scan of the illustrative repository with the following command. Planning alone does not execute blocks.

docsalive scan .

The plan found two pages and four blocks: the plain project’s docs/ directory plus the root README. It did not read the JSDoc in mod.ts. In a separate engine-driver run with the network off, the plain JavaScript block passed, while the TypeScript block using the Deno import-map name and the hashbang block failed as runtime-error findings needing review. The README TypeScript block ran on the probe machine’s Node 24, which can load a TypeScript file directly; the standard runner has Node 20, so do not rely on that result.

The distinction is especially important when a result looks like an API problem. A Deno-specific import may be valid for readers and still fail in Node. Conversely, a block that passes under Node does not prove that its Deno permission model or import map is correct.

Deno feature What deno test --doc does What the engine does in 0.6.3
Module JSDoc Finds eligible examples and supplies the module’s exports Does not read JSDoc in source files
Markdown imports Runs each example as a standalone module; imports must resolve from the document Extracts supported Markdown fences and runs JavaScript with Node
Deno global Uses Deno’s runtime A Deno.env probe failed as depends-on-context
Import map or jsr: Resolves Deno-supported imports Probed import-map and jsr: imports failed as runtime-error
Hashbang permission Validates flags and applies permission flags within the parent grant Does not reproduce Deno’s permission behavior; the probe failed as runtime-error
ignore Skips the example Reads the first fence label and ran the ignored TypeScript probe
Shell command beginning with deno Not evaluated; only the JavaScript and TypeScript fence languages listed above are run Skips it as host-tool:deno

For Deno globals, import maps, jsr: or npm: specifiers and permissions, keep deno test --doc as the authoritative execution check. A scan can still cover supported Python, shell, JSON and plain Node-compatible JavaScript on the same pages and classify findings for review. The JavaScript guide explains the Node-oriented side of that workflow.

The engine’s page selection also matters. It reads .md, .mdx and .markdown pages, not source-file comments. For a plain project with a top-level docs/ directory, the default is that directory plus the root README. Use the CLI reference to choose a narrower page scope when Deno-only pages produce results the scan cannot interpret.

See API drift

The next change is broken on purpose: it renames an exported function while leaving both the documentation and JSDoc examples unchanged.

-export function truncateSlug(slug: string, max: number): string {
+export function shortenSlug(slug: string, max: number): string {

The documentation task then failed type-checking with two errors. The Markdown import referred to an export that no longer existed, and the JSDoc example referred to the old automatically imported name.

TS2305 [ERROR]: Module '"file:///.../mod.ts"' has no exported member 'truncateSlug'.
import { slugify, truncateSlug } from "../mod.ts";
                  ~~~~~~~~~~~~
    at file:///.../docs/usage.md#15-22.ts:1:19

TS2304 [ERROR]: Cannot find name 'truncateSlug'.
    const short = truncateSlug("testing-docs-examples-with-deno", 20);
                  ~~~~~~~~~~~~
    at file:///.../mod.ts#22-28.ts:4:19

Found 2 errors.

error: Type checking failed.

An ordinary check of the module alone passed after this rename because the implementation remained valid. The ignored example still used the old function and did not produce an error. That is the practical cost of an ignored block: it can continue to look authoritative to readers while falling behind the API.

Keep ignored examples rare, explain why they are ignored, and assign a review point when the reason changes. If an example illustrates a planned API rather than a current one, label it clearly and keep it out of a current-version test path.

Writing conventions that keep examples testable

These are conventions, not Deno rules, but each one removes a failure mode shown in this guide.

  • Import explicitly in every Markdown example, with a path that resolves from the page's own folder. Readers copy Markdown examples into new files, and an explicit import is what makes the copy work.
  • State results with an assertion from the standard library rather than in a comment, so the doc test can fail when the value changes.
  • Keep the permission in a hashbang as narrow as the example needs, for example access to one named environment variable, and grant the same flag in the task that runs the doc tests.
  • Use ignore only for examples that cannot run in a test, say in the prose why, and review those examples whenever the API they mention changes.
  • Run the doc test from a task that names its files, so a reviewer can see what is covered, and run the same task in CI. The GitHub Actions guide and the GitLab CI guide show where such a step fits.

Triage findings

Finding Likely cause What to do
Name missing in a Markdown example The page relied on the JSDoc automatic import Import the name in that block using a path relative to the page
Permission failure The example asks for more than the parent test granted Grant the same minimal permission to the parent task
No matching files in a doc-only check The supplied directory did not select Markdown in the probe Name the Markdown files and confirm the checked paths
Old API survives in an ignored block The block was skipped and not type-checked Review and update it, or make it executable
Node cannot resolve a Deno import A Deno-specific block was sent to the engine’s Node runner Verify it with Deno; treat the engine finding in that context
depends-on-context for Deno The engine does not provide the Deno runtime Use the Deno test and record the scan limitation
A passing command checked too little Selection or an earlier skip reduced coverage Review the selected files and skipped blocks before accepting the result

Where DocsAlive fits

Use a Deno task in local development and CI for the examples whose correctness depends on Deno. Add the scan where the same documentation contains other supported block types, and review each classification rather than equating every failure with a documentation bug. A scan can run in a fresh container per page and report findings with their locations; its findings guide explains the categories.

The engine compares printed output only in Python pycon (>>>) sessions. For a Deno example whose result matters, write an assertion such as the ones above. A comment showing an expected value is useful to a reader, but it is not an assertion.

Use this checklist in a review or CI change:

Deno documentation test checklist

[ ] Select the module, README, and Markdown pages that contain examples.
[ ] Import every needed module item in each Markdown example.
[ ] Use assertions for values the example promises.
[ ] Keep each hashbang's permissions minimal.
[ ] Grant matching permissions to the parent Deno test task.
[ ] Run the doc test and investigate type errors before assuming tests ran.
[ ] Name Markdown files explicitly for the doc-only check and inspect coverage.
[ ] Review every ignored example separately for API drift.
[ ] Use Deno for Deno-specific imports, globals, and permissions.
[ ] Review scan findings in context and record skipped or unsupported coverage.

The sources we checked

These sources were read on November 15, 2026. Engine behavior was checked against engine 0.6.3 on the same day.

Source What it covers
Deno documentation tests JSDoc and Markdown examples, imports, permissions and ignored blocks
Deno test reference The test command and its options
Deno check reference Documentation-aware type-checking
Deno testing The broader Deno testing workflow

FAQ

Does Deno test Markdown and JSDoc examples?

Yes. The doc test command evaluates eligible fenced examples in both. Exports from the documented module are automatically imported into its own JSDoc examples; Markdown examples need their own imports.

Does DocsAlive run Deno documentation tests?

No. Engine 0.6.3 does not run Deno or read JSDoc from source files. It runs supported fences under Node: a Deno global was classified as depends-on-context, while import-map and jsr: imports produced runtime-error findings in probes. It does not honor ignore, and it skips deno shell lines as host-tool commands.

Why did an example fail despite its permission hashbang?

The parent test command must also have the permission. An example cannot receive a broader grant than its parent. Give both the smallest permission the example needs.

Does an ignored example still get type-checked?

It did not in the probe. An ignored example retained a renamed function without an error, so review ignored content separately and use the attribute sparingly.

Is an ordinary Deno check enough?

Not for the examples in the probe. A check of the module alone passed after an API rename that broke its documentation. Use the doc-aware flags and confirm which files were selected.

What should a Deno guide use for expected values?

Use assertions in executable examples when a particular result matters. The test can then fail when the value changes, even if the example still parses and runs.

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 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 Markdown code examples in any language with txm

Test annotated Markdown examples with txm: program, in, out, err, check and exit annotations, TAP output, exact matching, and blocks it never runs.

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.