Guide

Testing Hugo documentation examples

Find the code a Hugo theme renders, including highlight shortcodes and Docsy tabs that a fence scanner misses, then scope the scan and run the examples that readers copy.

Published
Updated
November 17, 2026
Reading time
11 min
Facts checked against
Hugo docs on syntax highlighting, the highlight shortcode, front matter and hugo new content, Docsy shortcodes and the Hugo v0.169.0 release, with every code block run on Hugo 0.169.0 and Python 3.13 (November 12, 2026)
Outlined documentation pages with a lime pulse line running out of the stack
On this pageThe short answerWhere Hugo holds documentation codeWalk through a Hugo exampleWhat the engine seesMake the check repeatableWhere DocsAlive fitsThe sources we checkedFAQ

The short answer

Test Hugo documentation examples as reader-facing programs, and check that your test actually finds the forms your theme renders. In engine 0.6.3, DocsAlive treats Hugo as plain Markdown: it can run supported fenced examples, but code inside the highlight shortcode or Docsy code tabs is invisible to its extractor. Limit the scan to the intended content, inspect skipped and unchecked blocks, and separately check the rendered site and any shortcode content.

Hugo gives documentation teams several ways to present code. That flexibility is useful for authors, but it also makes coverage easy to overestimate. A page can show three code samples in a browser while a Markdown fence scanner finds only two. A successful site build establishes that Hugo rendered the page; it does not establish that a reader can run the examples.

This guide walks through a small Hugo site, a check for code hidden in shortcodes, and a practical way to interpret a scan. The sample host used in the configuration is fictional.

Where Hugo holds documentation code

Hugo highlights fenced code blocks by default. A fence can name a language and add options in braces, such as line numbering or highlighted lines. Those options affect presentation; they do not make the code itself valid. A copied highlight marker, a stale line number, or an option left over after editing can make a sample misleading even when the program still runs.

The built-in highlight shortcode is another way to render code. Themes can add their own forms. Docsy has tabpane and tab shortcodes whose tab content can be rendered as code without a Markdown fence. Other themes use tabs whose bodies contain ordinary fenced blocks. These forms may look similar on the published page but expose different source text to a scanner.

Front matter also varies. Hugo accepts YAML, TOML, and JSON front matter. New content can start as a draft, depending on the archetype. A repository can contain the real documentation under content/docs, an old blog under content/blog, and a theme's demonstration site under themes/. Decide which of those readers rely on before treating a scan as representative.

Examples drift for familiar reasons: a package is renamed, a command-line flag changes, or the version installed in CI differs from the version readers use. Tabs can drift independently when only the first variant receives attention. Code inside a shortcode may never reach a fence-based check. Drafts and older sections can preserve broken instructions long after the main documentation is updated.

Classify before running

Use the intended role of a block to choose a check:

Kind of block Treatment
Runnable example Execute in page order with documented prerequisites and a known version.
Fragment Mark omitted context and review the surrounding explanation.
Credential-gated example Check the shape and instructions separately; do not insert real secrets into a general docs run.
Illustrative configuration Parse with an appropriate tool and, where useful, validate against the actual application.
Output Treat as an assertion to check with a suitable tool or review; do not assume a nearby fence is compared.

A complete runnable example can still depend on a file or service that the page has not established. Record those dependencies instead of silently supplying them. For a broader approach to site generators, see testing static-site documentation.

Walk through a Hugo example

Start with the Hugo CLI. This creates a site and a documentation page; the exact generated date depends on when the command runs.

hugo new site example-docs
cd example-docs
hugo new content docs/getting-started.md
cat content/docs/getting-started.md

The generated page in this example has TOML front matter and starts as a draft. Hugo normally excludes drafts from a build unless drafts are requested, but a file scanner can still read the source.

+++
date = '2026-11-12T11:17:08-08:00'
draft = true
title = 'Getting Started'
+++

The following illustrative site configuration sets a title, locale, and highlight options. It configures presentation; it does not test the examples. The host is fictional.

baseURL = 'https://docs.acme-docs-demo.test/'
locale = 'en-us'
title = 'Acme Docs'

[markup.highlight]
  lineNos = false
  noClasses = true
  style = 'monokai'

Now consider the page before the coverage fix. The first two examples are fenced. The Python fence has Hugo brace options, while the final Python sample is inside the highlight shortcode. It renders as code in Hugo, but it is not a Markdown fence.

+++
title = 'Getting started'
draft = false
+++

Check that pip is available:

```bash
python3 -m pip --version
```

Build a request body:

```python {linenos=inline,hl_lines=[3]}
import json

payload = {"name": "ada", "plan": "team"}
print(json.dumps(payload, sort_keys=True))
```

{{< highlight python >}}
import json
print(json.dumps({"legacy": True}))
{{< /highlight >}}

A build can show all three samples while a fence scanner plans only the first two. The following small inventory script looks for highlight shortcodes and Docsy-style code tabs outside fences. It also points out tab groups that need review. It is a focused aid for this example, not a full Hugo parser; inspect unfamiliar nesting and theme syntax separately.

"""Find Hugo shortcodes that hide code from a Markdown fence scanner."""
import pathlib
import re
import sys

OPEN = re.compile(r"\{\{[<%]\s*(highlight|tabpane|tabs|tab)\b([^>%]*)[>%]\}\}")
FENCE = re.compile(r"^\s*(`{3,}|~{3,})")

root = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else "content")
hidden = 0
for page in sorted(root.rglob("*.md")):
    in_fence = False
    for n, line in enumerate(page.read_text(encoding="utf-8").splitlines(), 1):
        if FENCE.match(line):
            in_fence = not in_fence
            continue
        m = None if in_fence else OPEN.search(line)
        if not m:
            continue
        name, args = m.group(1), m.group(2).strip()
        if name == "highlight" or (name == "tab" and "lang=" in args):
            hidden += 1
            print(f"{page}:{n}: code inside {name} shortcode ({args}) is not a fence")
        elif name in ("tabs", "tabpane"):
            print(f"{page}:{n}: {name} group; fenced tabs inside are tested one by one")
print(f"{hidden} shortcode code block(s) need a fence or another check")
sys.exit(1 if hidden else 0)

Run the inventory against the content directory. A nonzero result asks the maintainer to resolve or explicitly cover hidden code.

python3 scripts/find_shortcode_code.py content

On the page above, it identifies the highlight shortcode and exits with status 1.

content/docs/getting-started.md:21: code inside highlight shortcode (python) is not a fence
1 shortcode code block(s) need a fence or another check

One fix is to replace that shortcode with an ordinary Python fence, provided the theme can present the sample as intended. The code below is the replacement for the hidden sample.

import json
print(json.dumps({"legacy": True}))

Build the site and inspect the rendered code-block count. In this minimal example, Hugo renders three blocks. The scanner planned two before the replacement and three afterward. A count is a useful coverage signal, though equal counts alone do not prove that the right code ran.

hugo --quiet
grep -c "<pre" public/docs/getting-started/index.html

The following command scopes the scan to the documentation section. With this directory layout, the folder rule selects content/docs. Without --execute, this command extracts and plans; add that flag when you intend to run the planned blocks.

docsalive scan . --docs-dir content --include "content/docs/*"

This illustrative GitHub Actions YAML runs the shortcode inventory and builds the site. It is a starting point for the example repository: ensure that the Hugo release and actions fit your own environment and review changes to them. Add a separate execution check if you want runnable fences tested in CI.

name: docs-examples
on:
  pull_request:
    paths:
      - "content/**"
      - "hugo.toml"
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-python@v7
        with:
          python-version: "3.13"
      - name: Find code hidden in shortcodes
        run: python3 scripts/find_shortcode_code.py content
      - name: Build the site with Hugo
        run: |
          curl -sSL -o hugo.tgz https://github.com/gohugoio/hugo/releases/download/v0.169.0/hugo_extended_0.169.0_linux-amd64.tar.gz
          tar xzf hugo.tgz hugo
          ./hugo --minify

What the engine sees

DocsAlive does not detect Hugo as a framework in engine 0.6.3. It handles the repository as plain Markdown and scans .md, .mdx, and .markdown pages, not Hugo content stored in other formats such as HTML.

Without --docs-dir, it selects a top-level docs/ directory if one exists; otherwise it scans the repository. With --docs-dir X, it selects X/docs if that exists, otherwise X. The --include filter matches paths relative to the repository root. Check the selected pages as well as the number of extracted blocks: selecting a plausible folder is not proof that it contains the published documentation.

At any depth, the scanner skips directories named node_modules, .git, dist, build, .next, site, __pycache__, vendor, _snippets, snippets, changelog, blog, i18n, and versioned_docs. Consequently, content/blog is skipped. If a root scan reaches themes/, Markdown in a theme's example site can be scanned. Drafts are scanned because the engine reads source files rather than Hugo's build output.

Only YAML front matter delimited by --- on the first line is stripped. TOML and JSON front matter are treated as ordinary text; their delimiters do not prevent a later fence from being found. For a fence, the first info-string word supplies the language, so Hugo brace options after it do not change the selected language.

Block form → what the engine does in 0.6.3 Practical consequence
Supported Python or shell fence with Hugo brace options Extracts the fence using the first word as its language and plans the supported check.
Highlight shortcode containing code Does not extract the shortcode body as a fenced block.
Docsy code tab whose body is not fenced Does not see that code as a fence.
Other theme tabs containing fences Extracts the fences but does not group those tabs; each variant is planned separately.
Unmapped fence label Reports a pass without running or parsing it. This is a known limitation; a pass is not evidence of a check.
Recognized non-executable form or output block Skips it with a reason.
Python pycon or python-repl session Executes the session and compares its printed output. This is the engine's only printed-output comparison.

A block introduced as output can be skipped rather than checked. Console lines beginning with a prompt are run, while other console lines are treated as output and not compared. Use a dedicated assertion or a suitable external check for important results.

Triage the findings

A raw failure count is not the same as a count of documentation defects. Inspect the category and evidence, then reproduce the reader's conditions.

Finding Likely next action
Invalid syntax or an API that changed Confirm the intended version and correct the published example.
Missing install step Decide whether the page must state the prerequisite; the engine reports a hint.
Missing tool Check whether the documented setup promises that tool and whether the runner has it.
Depends on context Find the earlier definition or fixture; establish whether a reader actually receives it.
Needs credentials Record the gap and use a separate authorized check where appropriate.
Timeout or runtime error Investigate the evidence; these need review rather than automatic blame.
Hidden shortcode code or unchecked label Add another check or change the source form, then verify coverage again.

For details on categories and reports, see findings. The CLI reference describes scan options and report output.

Make the check repeatable

Choose the package version, fixture, and environment deliberately. A check against a repository checkout answers a different question from one against a published package. Keep documented setup visible, and avoid making a page pass solely because CI installed something the reader was never told to install.

Review each tab as a reader path. If two variants are alternatives, each should be independently understandable and should not depend on a prior tab's state. Since the Hugo theme forms described here are not grouped by the engine, a run may expose missing tools in variants that a particular reader would not select. That is useful information, but it needs interpretation.

Use the following checklist in a pull request or release review:

  • Identify the published content directory and the intended version.
  • Check scan scope, including drafts, skipped folders, and theme example sites.
  • Inventory highlight shortcodes and code-bearing theme tabs.
  • Check each fenced tab variant and its prerequisites.
  • Run complete examples in page order in a clean environment.
  • Review fragments, credentials, fixtures, and missing tools separately.
  • Verify important displayed results with an appropriate assertion.
  • Build the Hugo site and inspect the rendered examples.
  • Review unchecked labels, skipped blocks, and finding categories.
  • Repeat the relevant checks when packages, flags, or theme behavior change.

Where DocsAlive fits

DocsAlive can extract and plan examples from a local checkout or Git URL, execute supported blocks in isolated page containers when requested, and report findings with their locations and categories. Page order matters: supported Python blocks later on a page can use state established earlier on that page. A new page starts in a fresh container, so do not rely on one page's state leaking into another.

Use it alongside the Hugo build and a check for shortcode content. A build checks rendering, the shortcode inventory helps expose code the fence extractor misses, and execution checks help find examples that no longer work. None of these alone establishes that the prose is clear or that every displayed variant reflects a real reader journey. See how docs testing works and the framework coverage reference.

For a Git-synced knowledge base with different source forms, see testing GitBook documentation examples. For database snippets, see testing SQL examples.

Zola, another static site generator, renders page content as a Tera template before Markdown; see testing Zola documentation examples for what that means for code examples.

The sources we checked

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

Source What it covers
Hugo syntax highlighting Fences and highlighting options.
Hugo highlight shortcode The alternative shortcode form.
Hugo front matter YAML, TOML, JSON, and draft metadata.
Hugo new content Creating content from archetypes.
Docsy shortcodes Theme tab and code presentation.
Hugo v0.169.0 release The release used in the example.
Framework coverage Supported checks and framework behavior.

FAQ

Does a Hugo build test the examples?

A build tests whether Hugo can process the source and produce the site. Run or otherwise check the examples separately, and inspect the rendered page for presentation problems.

Are Hugo brace options understood by the scanner?

The engine takes the first word of the fence info string as the language and ignores the subsequent brace options for language selection. Check presentation options in the rendered site.

Does the engine scan draft pages?

Yes. It reads source files, including drafts, rather than relying on Hugo's published build. Limit scope with the documented selection options when that matches your testing goal.

What happens to code inside the highlight shortcode?

It is not a Markdown fence, so the engine does not extract it. Convert it to a suitable fence or cover it with a separate check, and verify the rendered result.

Are all Hugo tab variants tested?

Fences in unrecognized theme tab forms are planned separately, while code that exists only as the body of a Docsy code tab is invisible to the fence extractor. Inspect the actual source form.

Does a passing scan prove every sample works?

No. Review the scope, skips, unsupported forms, and unchecked labels. The site build and human review still matter, as do checks for any behavior outside the engine's coverage.

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