Guide

Testing pdoc documentation examples

Doctest runs prompted docstring examples but skips fenced ones, and pdoc only renders HTML. Run doctest and scan a copy of the fenced code.

Published
Updated
November 17, 2026
Reading time
13 min
Facts checked against
pdoc docs on docstrings, Markdown, __all__ and privacy, plus Python doctest and pytest doctest collection, with every code block run on pdoc 16.0.0, pytest 9.2.0 and Python 3 (November 14, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhat pdoc publishesWhy pdoc examples break or go untestedBuild the illustrative packageRun the prompted examplesUnderstand the engine's source scanCreate a scan-ready copy of public docstringsTriage the resultWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Use doctest for prompted Python sessions and a separate scan-ready copy for fenced docstring examples. pdoc can publish both, but doctest collects examples by their >>> prompts and does not collect ordinary fenced Python examples. Engine 0.6.3 does not detect pdoc or scan .py files, so DocsAlive reads the README as plain Markdown but never sees the docstrings. In the probe, it scanned the README session; if present, .pytest_cache/README.md was also listed as a page.

Run pytest --doctest-modules for prompted docstring examples and --doctest-glob for prompted examples in Markdown. Then generate a scan-ready copy of the public docstrings for fenced examples and triage. This split gives each tool a clear job and makes its blind spots visible. It does not replace a pdoc build or a review of the generated reference.

The walkthrough uses pdoc 16.0.0 and engine 0.6.3. It includes an illustrative package, a README fence trap, and a deliberately broken API call. For broader context, see Python docs testing and API reference docs testing.

What pdoc publishes

pdoc interprets docstrings as Markdown using markdown2, including support for fenced code blocks and pyshell, which treats unindented Python interactive sessions as code blocks. Its docformat can be set with a command option or __docformat__: markdown, restructuredtext, google, and numpy are available. The default is restructuredtext, which processes reStructuredText elements before Markdown.

An external Markdown file can be included with the reStructuredText include directive. Including a README from the top-level package's __init__.py is a common pattern. The directive supports selecting lines or boundaries, so the published text may be only part of the file. pdoc only outputs HTML, so anything you test has to come from the source files or from a copy you generate.

The public API is another selection boundary. If a module defines __all__, pdoc treats only the listed identifiers as public. Otherwise, public items are those defined in the module whose names do not start with an underscore. A docstring's @private can hide an item, while @public can show one. Specifying __all__ is the recommended way to exclude submodules.

A test run can therefore cover a different set of examples from the generated reference. A private helper can be tested by doctest even though pdoc does not publish it. Conversely, a fenced example can appear in the HTML while doctest never collects it.

Why pdoc examples break or go untested

pdoc makes it easy to keep reference text next to the code it describes, which is a good reason to use it. The same design creates a few predictable gaps.

The two example forms are checked by different tools. A bare >>> session in a docstring is something doctest can run. A fenced Python example in the same docstring is displayed by pdoc but never collected by doctest, because doctest looks for prompts, not fences. A project can have a fully green doctest run while every fenced example in its reference is stale.

What doctest runs and what pdoc publishes are different sets. Doctest runs every prompted docstring it collects, including those of private helpers that pdoc leaves out. pdoc publishes public items chosen by __all__ and underscore privacy. A green doctest run can therefore include examples no reader ever sees, and miss examples every reader sees.

The README is read twice. It is often included in the top-level module docstring and also published on its own. If it is tested with doctest as a text file, Markdown fence lines can collide with doctest's rule for where expected output ends.

Docstrings are not Markdown files. A tool that scans .md files, including engine 0.6.3, never reads a .py file, so docstring examples are invisible to it unless you generate a copy.

Finally, a successful pdoc build is not an execution check. pdoc renders whatever the docstring says, including a call with an argument the function no longer accepts.

Build the illustrative package

Set up the environment and install the local package for the walkthrough:

python3 -m venv .venv
. .venv/bin/activate
pip install pdoc pytest
pip install -e .

A clean environment makes the package under test explicit. For a real project, record the interpreter, package artifact, and dependencies used by CI so a reviewer can reproduce a failure. Installation from a checkout answers a different question from installation of a released artifact.

The following illustrative project metadata defines the package:

[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "acme-client"
version = "2.4.1"
requires-python = ">=3.10"

[tool.setuptools]
packages = ["acme"]

The package's top-level docstring includes the README, and its public list names two functions:

"""
.. include:: ../README.md
"""
from .version import parse_version, connect

__all__ = ["parse_version", "connect"]

The include lets the reference reuse the README. It also means that the same text can be encountered through more than one path: directly as Markdown and as included module documentation. Keep track of which check covers which copy so a report does not imply more independent coverage than it has.

The next illustrative file contains the two example forms and a private helper:

"""Version helpers for the acme client."""


def parse_version(text: str) -> tuple[int, ...]:
    """Split a release string into integers.

    >>> parse_version("2.4.1")
    (2, 4, 1)
    """
    return tuple(int(part) for part in text.split("."))


def connect(host: str, port: int = 8080) -> str:
    """Build the address the client connects to.

    ```python
    from acme import connect
    print(connect("localhost"))
    ```
    """
    return f"{host}:{port}"


def _retry_delay(attempt: int) -> float:
    """Private helper; pdoc leaves it out.

    >>> _retry_delay(3)
    4.0
    """
    return 0.5 * 2 ** attempt

The prompted session in parse_version is recognizable to doctest. The fenced example in connect is readable to pdoc and to a Markdown fence extractor once it is available in a Markdown page, but doctest does not collect it as an ordinary fenced Python example. The private helper has a prompted session that doctest can run even though pdoc leaves the helper out.

The README starts with a fenced interactive session. This first form is illustrative and is deliberately arranged to expose a doctest parsing problem:

# acme-client

Parse a release string:

```pycon
>>> from acme import parse_version
>>> parse_version("2.4.1")
(2, 4, 1)
```

Build the HTML reference:

pdoc acme -o html

The probe produced one module page, html/acme.html. It showed the included README session, the bare prompted example, and the fenced example. The acme.version submodule had no page of its own because the public list contained only the two functions, and the underscore-prefixed helper was omitted.

A successful pdoc build shows that pdoc could generate the reference under that configuration. It does not establish that each example ran or that every published call still matches the implementation. Check the HTML when changing public visibility or include boundaries, then run the examples separately.

Run the prompted examples

Use pytest's doctest collection for module docstrings:

python -m pytest --doctest-modules acme

The probe reported two passing examples: parse_version and the private _retry_delay. The fenced connect example was not collected. This is a useful result, but its scope is specific: it verifies the collected prompted sessions under the test environment, including one session that pdoc did not publish.

Run the README session as a text-file doctest too:

python -m pytest --doctest-glob="README.md" README.md

The first README form failed. The recorded failure illustrates what doctest treated as expected output:

Expected:
    (2, 4, 1)
    ```
Got:
    (2, 4, 1)

Doctest finds examples by the prompts and reads expected output until a blank line or the next prompt. With the closing fence directly after the displayed result, that fence became part of the expected output. The failure is about the boundary between Markdown markup and doctest's text parser, not necessarily about the function.

The tested fix adds a blank line before the closing fence:

 (2, 4, 1)
+
 ```

After that change, the same README doctest passed and pdoc still rendered the session. When applying this pattern, check both consumers: the text-file doctest must stop at the intended boundary, and the generated HTML should still show the example as intended.

Understand the engine's source scan

The next command plans a source scan with package setup for each page:

docsalive scan . --setup "pip install -e ."

The default CLI invocation only plans the run. In the probe, the engine treated the project as plain Markdown and scanned from the repository root. Without the pytest cache it collected one page, the README, and one block. With .pytest_cache present, its README was also listed as a second page, although it contained no code blocks.

When run with the package installed, the README session passed in both fence forms. Only pycon (>>>) sessions have their printed output compared by the engine; nothing else is compared. No docstring in the Python files was read. The README result therefore says nothing about the fenced example inside connect.

pdoc item What pdoc does What the engine does in 0.6.3
Module and member docstrings Converts selected docstrings into HTML documentation Never scans .py files as pages
Bare prompted session Displays it as code through pyshell Does not see it inside a docstring
Fenced Python docstring example Displays the fenced example Does not see it inside a docstring
Included README Can include selected external Markdown in a docstring Scans a collected README as a separate Markdown page; does not expand the directive
__all__ and privacy markers Select public documentation Does not apply pdoc's public API model to source files
Pytest cache README Is not the intended API reference Can list it as a page during a root scan
Generated HTML Publishes the reference Is not a scanned Markdown page

The collector reads .md, .mdx, and .markdown files. It skips certain named folders, but other hidden folders can be collected. If a top-level docs/ folder exists, the plain-project default is that folder plus the root README when present. An include filter only filters collected pages; it cannot add pages from a skipped folder.

Create a scan-ready copy of public docstrings

The following illustrative script uses pdoc's module model. It writes public docstrings to Markdown, wraps bare prompted sessions in fences, drops include directive lines, and skips docstrings containing @private.

"""Write the docstrings pdoc publishes to Markdown files that a docs scan can read."""
import re
import sys
import textwrap
from pathlib import Path

import pdoc.doc

PROMPT = re.compile(r"^>>> ")


def fence_sessions(text, setup=None):
    """Wrap bare >>> sessions (pdoc shows them as code) in pycon fences."""
    out, in_fence, in_session = [], False, False
    for line in text.split("\n"):
        if line.startswith("```"):
            in_fence = not in_fence
        if not in_fence and not in_session and PROMPT.match(line):
            out.append("```pycon")
            if setup:
                out.append(setup)  # doctest runs docstrings with the module's names
            in_session = True
        elif in_session and not line.strip():
            out.append("```")
            in_session = False
        out.append(line)
    if in_session:
        out.append("```")
    return "\n".join(out)


def page_for(module):
    parts = [f"# {module.modulename}", ""]
    doc = re.sub(r"^\.\. include::.*$", "", module.docstring, flags=re.M).strip()
    if doc:
        parts += [fence_sessions(doc), ""]
    for member in module.members.values():
        text = textwrap.dedent(member.docstring).strip()
        if not text or "@private" in text:
            continue
        setup = f">>> from {module.modulename} import *"
        parts += [f"## {member.qualname}", "", fence_sessions(text, setup), ""]
    return "\n".join(parts)


out = Path(sys.argv[2])
for name in sys.argv[1].split(","):
    module = pdoc.doc.Module.from_name(name)
    for mod in [module, *module.submodules]:
        target = out / "api" / f"{mod.modulename}.md"
        target.parent.mkdir(parents=True, exist_ok=True)
        target.write_text(page_for(mod))
        print(f"wrote {target}")

Using pdoc's own model aligns the basic module and member selection with what pdoc documents, including __all__ and underscore privacy. The generated files are a test representation, so inspect them when changing the package's documentation structure.

Generate the copy and plan a scan:

python tools/pdoc_scan_copy.py acme scan-docs
docsalive scan . --docs-dir scan-docs --setup "pip install -e ."

The recorded script output was:

wrote scan-docs/api/acme.md

The scan collected two pages: the root README, which the engine adds, and the generated API page. It extracted three blocks; when run, all three passed. The copy made the fenced docstring example available to the engine while retaining the README as its own page.

The script has important limits. Its star import brings in only names exported by the module; underscore names and names outside __all__ can still produce depends-on-context. It drops include directives instead of expanding them, so an included file other than the root README is not scanned through this copy. It does not apply reStructuredText, Google, or numpy docstring conversion.

It covers the module and submodules pdoc lists, but not class members' nested docstrings beyond what the module's members list provides. Private docstrings are not scanned, although doctest can still run them. Maintain an inventory of these gaps, especially if your published reference relies on nested members or included files.

The selected scan directory should also avoid a docs/ subfolder: in engine 0.6.3, that layout causes the scan to narrow to that subfolder. Regenerate the copy in CI so it reflects the checked-out code and public API.

Demonstrate the fenced-example gap

The following change is broken on purpose: the illustrative function does not accept the added argument.

-    print(connect("localhost"))
+    print(connect("localhost", timeout=5))

pdoc still built the reference, and the module doctest run still reported two passes because it did not collect the fenced example. When the scan-ready copy was run, the block failed as api-drift because the current API did not accept the argument.

This is the reason for the split. Doctest provides a direct check of prompted sessions, including expected values. The copy exposes fenced examples and gives triage a chance to identify a changed API. The pdoc build and HTML review establish what readers see. Each result covers a different boundary.

Triage the result

Finding Likely cause What to do
README doctest expects a closing fence No blank line separated the expected value from Markdown markup Add the boundary and rebuild the HTML
A private helper's doctest fails Doctest collected a docstring pdoc does not publish Fix or maintain the private test, and label it separately from published reference coverage
A fenced call is absent from doctest results It has no prompted session for doctest to collect Scan or test the fenced example separately
A generated session reports depends-on-context Its name was not imported by the copy's setup Review public exports and add an appropriate independent test where needed
A public call fails as api-drift An import, attribute, or argument no longer matches the installed API Reproduce against the intended package version and update the example or API
A page count changes after pytest A cache README was collected Inspect the page inventory before comparing counts
An included file is missing from the copy The script drops include directives Add a separate check for that file and inspect the generated reference

Do not treat every failure as the same kind of documentation defect. A missing fixture, missing tool, or name supplied elsewhere can need a different response from a call that no longer matches the public API. Likewise, an unfamiliar fence label can be reported as passing without execution or parsing in engine 0.6.3; confirm checker support before relying on it.

Use this checklist for a change to the package or reference:

[ ] Record the package version and environment used for the reference build.
[ ] Build pdoc and inspect public items, included content, and example formatting.
[ ] Run prompted module examples with pytest doctest collection.
[ ] Run prompted Markdown examples with the intended doctest glob.
[ ] Check blank-line boundaries before closing fences in text-file doctests.
[ ] Generate the scan-ready copy from the current public module model.
[ ] Scan fenced examples with the package setup required by the page.
[ ] Review private, nested, and externally included docstrings outside the copy's coverage.
[ ] Triage failures and skips against the version readers will use.

Where DocsAlive fits

DocsAlive can extract supported fences from the generated Markdown copy, run examples in page order, and classify findings. It does not render pdoc or read the original Python files in engine 0.6.3. The copy is a bridge for the examples it covers, not a claim that all generated HTML has been tested.

Use the CLI reference to choose scan scope and setup, and the findings reference to interpret categories. Every plan runs the scan on a schedule, and the Team plan and above add pull request checks and draft fix pull requests; pricing lists what each plan includes. To see a real report on a public repository you maintain, use the health check. For another Python documentation workflow, see Sphinx docs testing. The analogous source-to-page boundary appears in Hexo and Doxygen projects, although their source formats and checks differ.

The sources we checked

The following sources were read on November 14, 2026. Engine behavior was checked against engine 0.6.3 on the same day.

Source What it covers
pdoc documentation Docstring formats, Markdown, includes, public API selection, and HTML output
Python doctest documentation Prompted sessions and expected-output boundaries
pytest doctest guide Module and text-file doctest collection

FAQ

Does DocsAlive detect pdoc or scan docstrings?

Engine 0.6.3 does neither: it treats the project as plain Markdown and never scans Python files as pages. It scans a collected README, including supported pycon sessions, and can list the pytest cache README as another page.

Does doctest run fenced Python examples?

Doctest collects prompted sessions marked with the Python interactive prompt. An ordinary fenced Python example without those prompts needs a separate check.

Why can a private helper pass doctest but be absent from pdoc?

The tools select content differently. Doctest can run a prompted session in a private helper's docstring, while pdoc can omit that helper from the published reference.

Why did the README doctest include the closing fence?

Without a blank line after the expected value, doctest read the fence as another expected-output line. The tested blank-line change gave doctest a boundary while preserving the rendered session.

Does the scan-ready copy cover every pdoc page?

No. It has the stated limits around included files, docformat conversion, nested class members, private docstrings, and names outside public exports. Inspect the generated reference and maintain separate checks for those gaps.

What should run in CI?

Build the reference, run module doctests and the relevant Markdown doctest glob, regenerate and scan the public docstring copy, and review failures and uncovered examples against the intended package version.

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