Guide

Testing Astro Starlight documentation examples

Inventory every fence in src/content/docs, including Markdoc pages, run complete JavaScript examples, test package-manager tabs separately and know what a scan covers.

Published
Updated
November 17, 2026
Reading time
13 min
Facts checked against
Starlight pages, authoring, Tabs and getting-started docs, Expressive Code, the Astro Markdoc integration and setup-node, with the check script run on Python 3.13 and Node 24 (November 11, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerKnow where the examples liveWhy Starlight examples driftInventory and run JavaScript fencesAdd a build and check to CIHow DocsAlive reads StarlightTriage results in contextBuild a practical coverage planWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Test Starlight examples from their source files as well as building the site: inventory the fences, identify complete runnable examples and intentional fragments, and run representative reader paths in a clean environment. Check each package-manager alternative separately when it matters, and include Markdoc pages in your own coverage plan.

Starlight renders documentation from Markdown and MDX, with Markdoc available through an experimental integration. A successful site build shows that the site can render; it does not establish that an install command still names the right package, that a CLI flag still exists, or that a copied example works with the version a reader installs.

DocsAlive handles a Starlight repository as plain Markdown and MDX in engine 0.6.3. It recognizes Starlight’s MDX tab form and preserves fence language when Expressive Code metadata is present. It does not scan .mdoc pages or Astro component files. The local script below provides a small, explicit inventory and isolated JavaScript check, including .mdoc source files.

For the broader workflow, see testing documentation code and testing static-site documentation.

Know where the examples live

A conventional Starlight project keeps documentation pages in src/content/docs/. Markdown and MDX pages need no additional format configuration, and subdirectories contribute path segments. Custom pages can also live in src/pages/; those pages may use Astro components or other formats and need their own test strategy.

Markdoc support uses the experimental Astro Markdoc integration and the Starlight Markdoc preset. Its source pages use .mdoc. If a repository mixes formats, an inventory limited to .md and .mdx leaves part of the authored documentation out. The Starlight page guide and Astro Markdoc integration guide describe the layouts.

Starlight uses Expressive Code to render code blocks. A fence can have a language followed by metadata for a title, line markers, inserted or deleted text, or a terminal frame. The language is still the first word of the info string. The remaining metadata affects presentation and can be important to the reader, but it should not accidentally become part of the code passed to an interpreter.

Tabs often present package-manager choices or alternative languages. Starlight’s Tabs and TabItem components let authors label the choices; syncKey can keep groups with matching keys and labels in sync. A reader who chooses one package manager may expect that choice to persist through a tutorial. Test that path as a sequence, rather than assuming one passing tab proves every alternative.

Why Starlight examples drift

Package-manager tabs are easy to update unevenly. A package can be renamed in the npm tab while the pnpm or yarn tab retains the old name. A CLI flag can disappear in a new release, or a tutorial can install one framework version and use an API from another.

Expressive Code can make a change clear on screen while hiding the full context needed to execute it. Inserted and deleted lines may be shown as a teaching aid rather than a complete file. A reader who copies a marked diff can end up with marker characters or an incomplete program. Test the complete file that the reader should have after applying the change, and make clear whether the displayed block is a fragment.

MDX introduces component and import concerns alongside code fences. Markdoc pages introduce another source format. A custom page may assemble an example in an Astro component rather than store it as a fenced block. An inventory of fences is useful, but it is not an inventory of every piece of code visible on the published site.

Tutorial order matters as well. A JavaScript block may use a value defined earlier in the page. Running it alone can fail even though the tutorial is coherent; silently supplying that value in a test can hide a missing instruction. Record the intended starting state and test the full sequence when the page promises one.

Separate the promises

Source form Appropriate check Limit to record
Complete JavaScript example Execute in the documented environment An isolated run may omit earlier page state
Package-manager tab Run each supported path in an appropriate environment A single selected tab leaves alternatives unchecked
Intentional fragment Review or embed in a complete fixture A fragment alone may not be executable
Expressive Code diff or marked change Apply it to the stated starting file and test the result Display markers are not necessarily source code
Markdoc page Include .mdoc in a separate inventory and test The engine does not scan that file type
Output sample Assert stable claims in a dedicated test Rendering the sample does not verify it
Astro custom page Test the component and rendered behavior separately Fenced Markdown scanning does not cover .astro source

A useful inventory says what was checked, what was skipped and why. It should not turn an intentional fragment into an unexplained red build, or treat an unsupported form as evidence of a successful execution.

Inventory and run JavaScript fences

Save the following as check_starlight.py at the repository root. Run it with python3 check_starlight.py. It requires Python 3.12 or later and Node 20 or later.

The script walks src/content/docs, reads .md, .mdx and .mdoc files, and identifies fenced blocks. It uses the first word after the opening fence as the language, leaving metadata such as titles and line markers out of the language. It prints counts, flags unlabeled or unapproved labels, and runs js blocks in separate temporary files. A JavaScript block whose first line is // fragment is recorded as a fragment.

#!/usr/bin/env python3
from collections import Counter
from pathlib import Path
import re
import subprocess
import sys
import tempfile

ROOT = Path("src/content/docs")
SUFFIXES = {".md", ".mdx", ".mdoc"}
ALLOWED = {
    "bash", "sh", "shell", "console", "curl", "http",
    "js", "javascript", "jsx", "ts", "tsx", "json",
    "yaml", "yml", "toml", "text", "diff", "html",
    "css", "astro", "md", "mdx", "mdoc", "python", "py",
}
OPEN = re.compile(r"^ {0,3}(`{3,}|~{3,})(.*)$")


def blocks(path):
    lines = path.read_text(encoding="utf-8").splitlines()
    index = 0
    while index < len(lines):
        match = OPEN.match(lines[index])
        if not match:
            index += 1
            continue
        marker = match.group(1)
        info = match.group(2).strip()
        language = info.split()[0].lower() if info else ""
        start = index + 1
        index += 1
        body = []
        close = re.compile(
            r"^ {0,3}" + re.escape(marker[0])
            + r"{" + str(len(marker)) + r",}\s*$"
        )
        while index < len(lines) and not close.match(lines[index]):
            body.append(lines[index])
            index += 1
        yield start, language, "\n".join(body), index < len(lines)
        index += 1


def main():
    if not ROOT.is_dir():
        print(f"Missing directory: {ROOT}", file=sys.stderr)
        return 1

    counts = Counter()
    failures = 0
    executed = 0
    fragments = 0
    for path in sorted(p for p in ROOT.rglob("*") if p.suffix in SUFFIXES):
        for line, language, body, closed in blocks(path):
            counts[language or "(unlabeled)"] += 1
            location = f"{path}:{line}"
            if not closed:
                print(f"FAIL {location}: unclosed fence")
                failures += 1
            if not language:
                print(f"FAIL {location}: unlabeled fence")
                failures += 1
            elif language not in ALLOWED:
                print(f"FAIL {location}: label {language!r} is not allowed")
                failures += 1
            if language != "js":
                continue
            if body.splitlines() and body.splitlines()[0].strip() == "// fragment":
                print(f"SKIP {location}: fragment")
                fragments += 1
                continue
            with tempfile.TemporaryDirectory() as directory:
                script = Path(directory) / "block.js"
                script.write_text(body + "\n", encoding="utf-8")
                try:
                    result = subprocess.run(
                        ["node", str(script)],
                        capture_output=True,
                        text=True,
                        timeout=30,
                        check=False,
                    )
                except (OSError, subprocess.TimeoutExpired) as error:
                    print(f"FAIL {location}: {error}")
                    failures += 1
                    continue
            executed += 1
            if result.returncode:
                print(f"FAIL {location}: node exited {result.returncode}")
                print(result.stderr, end="")
                failures += 1
            else:
                print(f"PASS {location}")

    print("\nBlocks by language:")
    for language, count in sorted(counts.items()):
        print(f"  {language}: {count}")
    print(f"Executed: {executed}; fragments: {fragments}; failures: {failures}")
    return 1 if failures else 0


if __name__ == "__main__":
    sys.exit(main())

The allowed-label set is a policy for this script, not a claim that every listed language is executed. Adapt it to the labels your authors use. An unlabeled block fails the check so a maintainer must decide whether to label it or change the policy.

Each js block gets its own temporary file. That makes failures easy to locate, but it means page state is not preserved and relative imports resolve from the temporary directory. A tutorial depending on earlier blocks, repository files, installed packages or a particular working directory needs a separate complete test. The script also does not execute javascript labels; add a deliberate policy if those should receive the same treatment.

The parser handles ordinary backtick and tilde fences, including longer closing fences. It is a small source scanner, not a full Markdown, MDX or Markdoc parser. Review unusual nesting and generated content separately. Never run untrusted documentation code in a privileged environment.

Mark fragments deliberately

A fragment marker is useful only if reviewers understand what it means. Put // fragment on the first line of a JavaScript block when the block is intentionally incomplete for this script. Then identify the complete file or preceding steps in the surrounding page.

Do not mark a broken complete example as a fragment merely to make CI pass. If the page tells readers to copy and run it, provide the setup it needs or test the complete reader path. A fragment can still have a separate fixture that verifies its final context.

Add a build and check to CI

The following workflow is illustrative configuration. It assumes the repository has a lockfile, a build script and the Python checker above at its root. Adjust triggers and commands to match the project.

name: Documentation checks
on:
  push:
  pull_request:
jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: '24'
      - run: npm ci
      - run: npm run build
      - run: python3 check_starlight.py

The build and the script answer different questions. The build checks that the configured site can be produced. The script inventories source fences and runs a narrow subset of them. Neither alone verifies all tabs, remote services, prose or a multi-page tutorial.

Pin dependencies through the repository’s lockfile and decide which version of the documented package the examples should exercise. For release-sensitive docs, test the artifact intended for readers as well as the current checkout. The GitHub Actions documentation testing guide covers how to place checks in a wider workflow.

How DocsAlive reads Starlight

There is no dedicated Astro or Starlight detection in engine 0.6.3. The repository is handled as plain Markdown and MDX. If there is no top-level docs/ directory, the scan considers .md, .mdx and .markdown files under the repository root, including src/content/docs and the root README, while excluding known build, dependency and other ignored directories.

If a top-level docs/ directory exists, the default scan concentrates on that directory plus the README. Use the CLI option --docs-dir src/content/docs to point the scan at Starlight content stored there. Review the resulting page list: a repository can contain useful examples outside that directory.

The engine does not scan .mdoc files or .astro component files. Markdoc-specific syntax embedded in MDX is not understood. The local script above can inventory fences in .mdoc files, but a full Markdoc-aware test and site build remain useful when those pages contain significant examples.

Block or page form Engine behavior in 0.6.3
Markdown or MDX fence in a scanned page Extracted and planned according to its language and contents
Starlight Tabs with labeled TabItem choices Recognized as a tab group; package-manager alternatives use the preference order described below
Tabs labeled as different languages Every language tab is run rather than selecting one package-manager alternative
Expressive Code metadata The first word remains the language; a title is read as the block title
Fence titled output, response or result Recognized as output and skipped; contents are not validated
diff fence Skipped as not executable, including a diff configured to display JavaScript
.mdoc or .astro page Not scanned
mdoc fence label or another unmapped label Reported as pass without being run or parsed; this is a known limitation
jsx or tsx Not judged
ts Simple type annotations are stripped before execution; other TypeScript-only syntax is not fully judged

For package-manager alternatives, the preference order is npm, pip, uv, python, py, javascript, js, node, typescript, curl, bash, shell, linux and macos. A selected npm tab does not establish that a skipped pnpm tab works. Maintain separate coverage for alternatives you support.

Output handling has a specific boundary. A block introduced as output or response is skipped, and its contents are not compared. Printed output is compared only for pycon or python-repl sessions. If a JavaScript example promises a particular value, add your own assertion for that promise.

A network-requiring shell block can be skipped when --no-network is used. Credential placeholders are also skipped and classified as needing credentials. Commands for host tools such as pnpm or yarn may be skipped as host-tool commands. These reasons are coverage information, not evidence that the reader’s command succeeded.

Triage results in context

Result Question to ask Next step
JavaScript block fails alone Does it rely on earlier tutorial state? Test the full sequence and clarify prerequisites
npm tab passes, another tab is skipped Is the skipped package manager supported? Run that path in a suitable CI job
A complete example uses an old flag Which package version is the page meant to document? Update the example or version-specific guidance
A marked diff cannot run Is it intended to be a complete file? Apply it to a fixture and test the resulting file
.mdoc page is absent from the report Is its content covered elsewhere? Add a Markdoc-aware inventory and test
Unmapped label reports pass Was any checker actually applied? Treat it as unchecked and use an appropriate tool
Output sample is skipped Does the page promise a stable result? Add a separate assertion for the promised value
Network or credential result Is the environment authorized and available? Review separately from a likely docs defect

A failure should lead to a reproducible question, not an automatic rewrite. Record the source page and line, the runtime and package version, the setup and the expected reader path. A missing fixture may be a test setup issue, or it may reveal a prerequisite the page never explains.

Build a practical coverage plan

Start with high-value paths: installation, first use and common configuration. For each path, list the source files, relevant tabs, runtime, package version and expected outcome. Then decide which pieces can run in isolation and which need page-order state.

Test package-manager alternatives in separate clean environments when they have different lockfiles or tool requirements. Avoid executing all alternatives in one shell as though they were consecutive instructions. A tab is usually a choice, and its setup can conflict with another choice.

For Expressive Code, inspect the source as well as the rendered page. A highlighted line may be valid code, while an insertion or deletion display may describe a change to an existing file. Make the reader’s copyable final state clear. If a tutorial asks readers to edit a file, keep a fixture for the starting state and verify the resulting state.

For Markdoc, inventory .mdoc pages and document the coverage gap in the same report as Markdown and MDX results. The site build is valuable for rendering and integration errors, but a successful build does not execute every command shown to a reader.

Use this checklist in a pull request:

[ ] List the documentation source directories and formats.
[ ] Include Markdoc pages in a separate coverage plan.
[ ] Build the site with the intended dependency versions.
[ ] Inventory fence labels and review unlabeled blocks.
[ ] Mark intentional fragments and identify their complete context.
[ ] Test important package-manager alternatives separately.
[ ] Check tutorial sequences with their documented starting state.
[ ] Verify the final file represented by a diff or marked edit.
[ ] Assert important output in a dedicated test.
[ ] Review skipped, unsupported and credential-dependent blocks.
[ ] Record the package and runtime versions tested.

Where DocsAlive fits

DocsAlive extracts and plans supported examples, runs executable blocks in a fresh page environment and reports findings with reasons. It keeps blocks in page order, which can help with tutorials whose later examples depend on earlier setup. A scan without --execute only extracts and plans.

Use the CLI reference to choose the source directory and execution options, and the findings guide to interpret statuses. Keep your own checks for .mdoc, Astro components, unsupported labels, skipped tab alternatives and output assertions. The JavaScript documentation testing guide provides more detail on runtime and dependency choices.

For related layouts, compare Nextra documentation testing. If the pages contain API commands, use the curl and HTTP examples guide for status and response checks.

The sources we checked

These sources were read on November 11, 2026.

Source What it covers
Starlight pages Documentation locations and supported page formats
Starlight authoring Markdown authoring and code presentation
Starlight tabs Tabs, labels and synchronized choices
Expressive Code highlighting Code presentation and markers
Astro Markdoc integration Markdoc integration
GitHub checkout action Repository checkout in Actions
GitHub Node setup action Selecting Node in Actions

FAQ

Does a Starlight build test every example?

No. A build checks the site’s configured rendering path. Commands, package versions, response claims and tutorial sequences need their own tests.

Does DocsAlive scan Markdoc pages?

Engine 0.6.3 does not scan .mdoc files. Include those pages in a separate inventory and testing workflow.

Does the engine run every package-manager tab?

It recognizes Starlight tab groups and selects a preferred alternative for package-manager choices. Test supported alternatives separately, and review the report for skipped variants.

Do Expressive Code titles change the detected language?

The engine takes the first word of the fence info string as the language and reads a title as a block title. Display metadata does not turn a fragment or diff into a complete runnable example.

Why might the local script fail a valid tutorial fragment?

It runs each js block in a separate temporary file, so it does not preserve earlier page state or repository-relative imports. Mark intentional fragments and test complete sequences separately.

Is a passing unmapped label a successful test?

No. In engine 0.6.3 an unmapped label can be reported as passing without execution or parsing. Treat that result as unchecked and use a suitable independent checker.

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 Nextra documentation examples

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

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

Docs testing for open-source projects

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

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

Docs testing for technical writers and docs teams

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

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

Docs testing for DevRel teams

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

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

Testing Hugo documentation examples

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

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

Testing GitBook documentation examples

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

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

Testing SQL examples in documentation

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

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

Testing mdBook documentation examples

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

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

Testing Docsify documentation examples

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

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

Testing Jekyll documentation examples

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

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

Testing Antora and AsciiDoc documentation examples

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

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

Testing Fumadocs documentation examples

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

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

Testing versioned Docusaurus docs

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

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

Testing Read the Docs documentation examples

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

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

Testing Eleventy documentation examples

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

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

Testing Zola documentation examples

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

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

Testing Quarto documentation examples

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

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

Testing Hexo documentation examples

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

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

Testing pdoc documentation examples

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

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

Testing Doxygen documentation examples

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

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

Testing TypeDoc documentation examples

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

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

Testing JSDoc documentation examples

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

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

Testing docs examples with pre-commit hooks

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

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

Testing documentation examples with Deno

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

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

Testing documentation examples with Sybil

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

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

Testing Markdoc documentation examples

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

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

Testing Markdown examples with phmdoctest

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

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

Testing Markdown code blocks with pytest-markdown-docs

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

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

Testing command line docs with prysk and Cram

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

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

Testing Python docstring examples with xdoctest

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

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

Testing multi-language docs examples with byexample

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

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

Testing Markdown code blocks with mktestdocs

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

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

Testing README code blocks with pytest-codeblocks

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

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

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