Guide

Testing JSDoc documentation examples

JSDoc shows examples as code and never runs them. Export its doclets, copy the examples into a page a scan can run and assert stated results.

Published
Updated
November 17, 2026
Reading time
14 min
Facts checked against
JSDoc docs on the example tag, configuration, the command line, tutorials and the Markdown plugin, plus Node package self-reference, with every code block run on JSDoc 4.0.5, Node and Python 3 (November 15, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhere examples and pages come fromBuild an illustrative projectSee what the scan can reachMake a scan-ready copyMake the expected behavior testableTriage the findingsPut the checks in the workflowWriting JSDoc examples a check can verifyThe sources we checkedFAQ

The short answer

Build JSDoc, extract the examples it actually documents, and run checks that make expected behavior explicit. JSDoc displays example text as highlighted code; it does not run it or verify a result written in a comment. In engine 0.6.3, DocsAlive does not detect JSDoc or read source comments. With no top-level docs/ folder, its root scan reads the README and tutorials; once scan-docs/ exists, a root scan picks that up too. JavaScript fences run with Node, but their results and comments are never compared.

The workflow below uses JSDoc’s own JSON doclets to create a scan-ready page. A small rewrite turns one narrow returns-comment convention into an assertion. That gives an execution check something concrete to verify, while leaving other comments as comments. The package acme-units is illustrative and is not a published package.

Where examples and pages come from

The JSDoc example tag provides an example of using a documented item. The text after the tag is displayed as highlighted code. A doclet can have multiple examples, and a caption element immediately after a tag can provide a caption. Rendering those examples is useful to readers, but a successful documentation build says nothing by itself about whether a call still returns the value described beside it.

Source selection determines which doclets exist. source.include supplies paths. By default, source.includePattern selects files ending in .js, .jsdoc, or .jsx; the default source.excludePattern ignores files and folders beginning with an underscore. With recursive processing, the default recursion depth is 10. A file can therefore be present in the repository yet absent from the reference and from a JSON export made with the same configuration.

The -X or explain option prints doclets as JSON and exits. It is a useful boundary for an extraction script: the script can work from the material JSDoc reports rather than guessing how comments were parsed. It also inherits the configured source selection, so inspect that selection before treating the export as complete.

The README and tutorials are separate inputs. The readme option defaults to the first README.md found in the source paths. Tutorials require the tutorials option; if it is omitted, no tutorial pages are generated. Markdown tutorials are converted to HTML, and their identifier is the file name without its suffix. Tutorials can use link and tutorial inline tags, and a JSON file can supply titles and children.

The Markdown plugin converts Markdown in the default author, class description, description, parameter, property, returns, see and throws tags. Its default list does not include the example tag, which is shown as code anyway. Keep a leading asterisk on each comment line; configuration can add tags or remove defaults. For related language-level practices, see JavaScript docs testing and TypeScript docs testing.

Build an illustrative project

Install JSDoc for the sample project. The verification used JSDoc 4.0.5.

npm install --save-dev jsdoc

This manifest exposes the local package by name. Node’s package self-reference lets the examples require that name from inside the package when exports are configured.

{
  "name": "acme-units",
  "version": "1.0.0",
  "type": "commonjs",
  "exports": "./lib/units.js",
  "scripts": {
    "docs": "jsdoc -c jsdoc.json"
  },
  "devDependencies": {
    "jsdoc": "^4.0.5"
  }
}

The illustrative configuration reads lib/, enables the Markdown plugin, and selects a README and tutorial directory. It writes the generated reference to out/.

{
  "source": { "include": ["lib"] },
  "plugins": ["plugins/markdown"],
  "opts": {
    "destination": "out",
    "readme": "README.md",
    "tutorials": "tutorials"
  }
}

The source has two examples. One puts an expected result in a comment directly above a call; the other has a caption and a trailing comment. Neither comment is an assertion merely because it appears in an example.

/**
 * Unit conversions.
 * @module acme-units
 */

/**
 * Convert bytes to whole kibibytes, rounding down.
 * @param {number} bytes - A byte count.
 * @returns {number} The number of kibibytes.
 * @example
 * const { toKiB } = require("acme-units");
 * // returns 1
 * toKiB(1536);
 */
function toKiB(bytes) {
  return Math.floor(bytes / 1024);
}

/**
 * Format a byte count for people.
 * @param {number} bytes - A byte count.
 * @returns {string} The formatted size.
 * @example <caption>Formatting a file size.</caption>
 * const { formatSize } = require("acme-units");
 * console.log(formatSize(1536)); // 1.5 KiB
 */
function formatSize(bytes) {
  if (bytes < 1024) return `${bytes} B`;
  return `${(bytes / 1024).toFixed(1)} KiB`;
}

module.exports = { toKiB, formatSize };

The tutorial is a Markdown page with a JavaScript fence. It has an explicit import, so it can be tested as a reader-facing unit once the package is available.

# Getting started

Convert a size and print it:

```js
const { toKiB, formatSize } = require("acme-units");

console.log(toKiB(4096));
console.log(formatSize(512));
```

The README supplies another Markdown example and becomes the front page in this configuration.

# acme-units

Small helpers for byte counts.

```js
const { formatSize } = require("acme-units");

console.log(formatSize(2048));
```

Build the reference with the configuration. In the verified build, the output contained the README front page, module page, tutorial page and source page. Both comment examples appeared as code and the second caption appeared above its example.

npx jsdoc -c jsdoc.json

The functions appeared as inner members of the module because the exported object itself was not documented. That presentation did not change the examples. If a member is missing entirely, inspect the source paths and patterns before concluding that the extraction script failed.

See what the scan can reach

The command below plans a scan. In the verified execution, the project had no top-level docs/ folder, so the plain-project root scope found two pages: the README and tutorial. Their two JavaScript blocks passed. The example tags in lib/units.js were never read.

docsalive scan .

Once the generated scan-docs/ directory exists, a root scan lists it as a third page in this project. That can be useful, but it also makes regeneration important: stale generated content can otherwise be scanned alongside current source. The CLI without execution only extracts and plans; see /docs/cli/ for the available run options.

JSDoc item What JSDoc does What the engine does in 0.6.3
Example tag in a source comment Shows its text as code Never reads the comment
Multiple examples and captions Associates examples with a doclet and displays captions Does not see them until they are copied to Markdown
Source include and patterns Select files from which doclets are created Does not use JSDoc configuration to select source comments
JSON doclet export Prints doclets and exits Can scan a Markdown page generated from that export
README Can use it as the front page Scans the root README
Tutorial Markdown Converts it to a tutorial page when configured Scans it under the root scope in this project
JavaScript fence Displays it in a page Runs it with Node; results and comments are not compared

Make a scan-ready copy

The script below is illustrative. It reads the doclets produced by JSDoc, preserves a leading caption as prose, and writes each example as a JavaScript fence. For one specific convention—a returns comment directly above a one-line call ending in a semicolon—it writes an assertion in the generated copy.

This is a test transformation, not a JSDoc rule. Review both the original example and the generated page. The original remains the material a reader sees, while the assertion checks one stated expectation.

"""Copy JSDoc @example blocks into a Markdown page a docs scan can read.

Run `npx jsdoc -X -c jsdoc.json > doclets.json` first: -X prints JSDoc's own
doclets, so the examples are the ones JSDoc would publish.

A "// returns VALUE" comment directly above a one-line call becomes an
assertion, so the documented return value is checked when the block runs.
"""
import json
import re
import sys
from pathlib import Path

doclets = json.loads(Path(sys.argv[1]).read_text())
out = Path(sys.argv[2])
CAPTION = re.compile(r"^\s*<caption>(.*?)</caption>\s*\n?", re.S)
RETURNS = re.compile(r"^(\s*)//\s*returns\s+(.+?)\s*$")


def checked(code):
    lines = code.split("\n")
    result = []
    i = 0
    while i < len(lines):
        m = RETURNS.match(lines[i])
        nxt = lines[i + 1].strip() if i + 1 < len(lines) else ""
        if m and nxt.endswith(";") and "\n" not in nxt and not nxt.startswith(("const ", "let ", "var ")):
            expr = nxt[:-1]
            result.append(f'{m.group(1)}require("node:assert").deepStrictEqual({expr}, {m.group(2)});')
            i += 2
            continue
        result.append(lines[i])
        i += 1
    return "\n".join(result)


page = ["# API examples", ""]
count = 0
for d in doclets:
    if d.get("undocumented") or not d.get("examples"):
        continue
    for example in d["examples"]:
        m = CAPTION.match(example)
        caption = m.group(1).strip() if m else ""
        code = CAPTION.sub("", example, count=1)
        page += [f"## {d['longname']}", ""]
        if caption:
            page += [caption, ""]
        page += ["```js", checked(code), "```", ""]
        count += 1

dest = out / "api" / "examples.md"
dest.parent.mkdir(parents=True, exist_ok=True)
dest.write_text("\n".join(page))
print(f"wrote {dest} ({count} examples)")

Generate doclets using the same configuration as the reference, then generate the page and plan its scan. In the verified execution with --docs-dir scan-docs, the scope comprised the root README and generated API page. All three blocks passed.

npx jsdoc -X -c jsdoc.json > doclets.json
python3 tools/jsdoc_scan_copy.py doclets.json scan-docs
docsalive scan . --docs-dir scan-docs

The script reported two copied examples:

wrote scan-docs/api/examples.md (2 examples)

This is the illustrative page it produced. The first expected value is now part of an assertion. The trailing comment on the second example remains unchanged and is not checked.

# API examples

## module:acme-units~toKiB

```js
const { toKiB } = require("acme-units");
require("node:assert").deepStrictEqual(toKiB(1536), 1);
```

## module:acme-units~formatSize

Formatting a file size.

```js
const { formatSize } = require("acme-units");
console.log(formatSize(1536)); // 1.5 KiB
```

The script has deliberate limits. It rewrites only a returns comment directly above a one-line call ending in a semicolon, and the stated value must be a valid JavaScript expression. It does not check trailing comments such as the one on the formatting line. Examples that rely on names they never import can fail as depends-on-context or with a reference error.

It reads only what -X reports with the selected configuration. Files outside source.include, or files matching the exclusion pattern, will not be there. It does not read tutorials or the README; the scan covers those pages separately. It treats every example as JavaScript. Regenerate scan-docs in CI, and review the generated page when changing the convention or script.

Make the expected behavior testable

This change is broken on purpose. It changes rounding down to rounding to the nearest integer, so the illustrated call now yields two instead of one.

-  return Math.floor(bytes / 1024);
+  return Math.round(bytes / 1024);

JSDoc still built successfully. The original example also ran without error as an ordinary JavaScript block: its result and comment were not compared. The generated assertion failed, and the scan classified that failure as a runtime error needing review. Node’s assertion message began:

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:

2 !== 1

A runtime error is a prompt to investigate, not an automatic conclusion that the documentation is wrong. Here the function description says it rounds down, so the change and expectation conflict. In another case the API behavior may have intentionally changed and the example may need an update. Review the intended contract before deciding which side to change.

As writing advice, put a require or import line in every standalone example. An example without one may be understandable in a surrounding tutorial but fail in isolation because a name is missing. If it intentionally relies on earlier context, say so and test the sequence. Write expected results in a form a check can verify, such as an assertion, or show a call and explain the expected value in prose. Comments are never compared.

A scan that simply runs a call can still be valuable: it can reveal a missing import or an exception. It cannot establish that a successful call returned the intended value unless the example itself checks that value. Keep assertions focused on stable behavior, and avoid presenting a generated test setup as a prerequisite that the published page never gives readers.

Triage the findings

Finding Likely cause What to do
An example is missing from the doclet export Its file was outside the configured source paths or filtered by a pattern Inspect source.include, the include pattern and underscore-prefixed paths
The reference builds but an example fails Rendering did not run the example Reproduce with the intended package and correct the code or API
A copied example reports an undefined name It relies on context or an import absent from the example Add the reader-facing import or document and test the prerequisite
An assertion fails The stated value and current behavior differ Compare both with the intended contract before changing either
A plain example passes after a behavior change It has no assertion for the changed result Add a meaningful check for the promised behavior
A generated page is stale It was not regenerated after a source or configuration change Rebuild doclets and regenerate it in CI

Read the categories together with the evidence. In this project a runtime error came from an assertion the generated page added, so the first question is whether the stated value or the code is the intended contract. A failure in the README or tutorial is different: those pages are what readers copy directly, so a missing import or a changed function name there is a reader-facing problem even if the reference pages look fine. See findings for how a likely documentation bug differs from a result that needs review.

Two quieter outcomes deserve the same attention. A block that passes may simply have run without checking anything, which is what happened to the unchanged example after the rounding change. And an example that never reached the generated page, because its file sat outside the source selection, is not reported at all. Compare the number of examples the script wrote with the number you expect from the reference before reading the scan totals.

Put the checks in the workflow

Run the reference build and extraction on changes to comments, source selection or the public API. Run the generated examples against the package version under review, and keep the README and tutorial scan in scope. On release, check the artifact readers will actually install where practical; a checkout and a published artifact can expose different packaging problems.

A local hook can provide fast feedback, but a CI run remains useful because local hooks can be skipped or absent. The pre-commit guide describes that boundary. For a reference that combines source comments and separate pages, API reference docs testing covers the wider mapping problem.

Use this checklist with a change:

[ ] Confirm JSDoc source paths and file patterns include intended files.
[ ] Build the reference and inspect examples and captions.
[ ] Export doclets with the reference configuration.
[ ] Regenerate the scan-ready API examples in CI.
[ ] Give standalone examples their required imports.
[ ] Add assertions for stable results that must be verified.
[ ] Scan the README, tutorials and generated examples.
[ ] Review runtime errors and skipped blocks in context.
[ ] Check the package artifact intended for readers.

Writing JSDoc examples a check can verify

Most of the work happens in the comment itself, before any tool runs. A few habits make the extraction and the scan far more useful, and they are writing advice rather than JSDoc rules.

Start each example with the line that brings the API into scope. JSDoc renders whatever text follows the tag, so an example that begins with a bare call reads well in a reference page but cannot run on its own. The same line tells readers which module name to use, which matters when a package exposes several entry points.

State results in a form a machine can check. The returns-comment convention in this guide works because the script recognizes one narrow shape and rewrites it. If your project prefers another convention, adapt the script deliberately and keep the convention written down in the contributor guide, so authors know which comments are checked and which are ordinary prose. A comment at the end of a line, like the one on the formatting example, stays a comment.

Keep one idea per example and use captions to say what it shows. Several short examples under one doclet are easier to check and easier to fix than one long example that mixes setup, happy path and error handling. When an example must show an error, show the thrown error in prose or with an assertion that expects it, rather than leaving a failing call in the code.

Avoid hidden state. An example that only works after an earlier example in a tutorial has run belongs in the tutorial, where readers see the order, and it should still repeat its import, because each JavaScript block is run as its own file. In the reference, each example is copied on its own, so it should stand alone.

DocsAlive fits after extraction: it runs supported Markdown examples and helps sort failures for review. It does not read JSDoc comments, infer assertions from comments, or establish that every source file was included by JSDoc. Use the doclet export and your own assertions to make those boundaries visible. For a first look at an existing public repository, the health check runs the engine on up to 40 docs pages; plans and limits are on pricing.

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
JSDoc example tag Examples, multiple examples and captions
JSDoc configuration Source paths, patterns and recursion
JSDoc command line Explain, readme, tutorials and output options
JSDoc tutorials Tutorial files, identifiers and relationships
JSDoc Markdown plugin Default converted tags and configuration
Node packages Package exports and self-reference

FAQ

Does JSDoc execute example tags?

No. JSDoc displays their text as highlighted code. A successful build does not verify imports, calls or expected values in those examples.

What does DocsAlive scan in this project?

In engine 0.6.3 it does not detect JSDoc or read source comments. With no docs folder it scans from the repository root, including the README and tutorials. Once scan-docs exists, a root scan picks it up too. JavaScript runs with Node, but results and comments are never compared.

Why did a returns comment fail to catch a changed result?

A comment is not an assertion. The illustrative extraction script rewrites one narrow comment convention into an assertion in a generated page; other comments remain unchecked.

Why is a source file absent from the exported doclets?

Check the configured source paths and patterns. The defaults select certain JavaScript file suffixes and ignore files and folders beginning with an underscore. The export can contain only what JSDoc processes.

Can an example omit its import?

It can rely on surrounding context, but that context must be clear and tested. For a standalone example, including the require or import line makes the reader's starting point and the test boundary clearer.

Does the extraction script cover tutorials?

No. It reads example strings from the doclet export. Scan the README and tutorial Markdown separately, and regenerate the copied API examples in CI.

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 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 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.