On this page
The short answerWhy writers inherit broken examplesStart with what the style guides ask forAuthor examples a report can interpretRead the report without debugging every languageReview findings with engineersChoose a workflow for your teamReport progress to a docs managerWhere the product fitsPasteable review checklistThe sources we checkedFAQThe short answer
Put code examples through a repeatable check as part of the docs-as-code workflow, then review the results with the people who can resolve them. Writers do not need to debug every language to make the report useful: identify the page and line, distinguish likely documentation bugs from skipped or context-dependent examples, and bring uncertain behavior to an engineer. Keep a record of what ran, what was checked only for syntax, and what was not checked.
DocsAlive extracts fenced examples, plans how to handle them, runs supported examples and classifies the results. A report can give a docs team a practical starting point for review, but a passing status is not always proof that code ran. This guide explains how to read the findings, improve examples and divide the work with engineering. For the broader practice, see docs testing.
Why writers inherit broken examples
A writer may publish an example without owning the SDK, the service behind it or the language it uses. An engineer supplies a first draft; a writer makes it understandable, places it in a task and keeps the page current. Later, an API attribute is renamed, a package changes or a command assumes a shell that some readers do not use. The page can remain clear while its example stops working.
Other examples are intentionally incomplete. A reference page might show the middle of a larger program. A quickstart might require an API key or a local file. A shell command copied from one environment might use syntax that does not work in the shell a reader has chosen. These cases need explanation and review, but they should not all be treated as the same kind of documentation defect.
The challenge grows when one team publishes examples in several languages. A writer can check whether the introduction identifies prerequisites, whether the steps make sense and whether a placeholder is obvious. They may still need an engineer to determine whether a changed import is correct or whether a timeout comes from the service.
Automated testing gives that conversation a concrete starting point: a page, a line, a result and a reason. It does not replace editorial review or make the writer responsible for diagnosing every runtime error. It helps the team spend review time on findings that could affect readers.
Put the check into the docs-as-code workflow
Write the Docs describes docs as code as writing documentation with tools also used for code: issue trackers, version control, plain-text markup, code reviews and automated tests. It describes writers and developers following the same workflows and sharing ownership of documentation. It also notes that developers often write a first draft and that teams can block feature merges when documentation is missing.
For a docs team, that suggests a practical cycle:
- Track an example problem alongside the page or feature it affects.
- Change the source in version control and request review.
- Run checks on supported examples and inspect the report.
- Ask the right owner to resolve findings that need product or language expertise.
- Record gaps that the automated check cannot cover.
A pull request is a useful place to catch a changed example while its context is still fresh. Scheduled checks can reveal drift after the page was last edited. A release check can retest examples against the version just shipped. Decide separately which findings should delay a merge: a likely docs bug deserves attention, while a credential-gated example needs a different verification path.
Start with what the style guides ask for
The style guides already set expectations that make examples more useful to readers and easier to review. They do not make every sample independently executable. A writer still needs to explain the purpose and boundaries of each block.
| Guidance | What a writer can do |
|---|---|
| Google: code samples | Usually introduce a sample with a sentence or paragraph; follow the language’s indentation guidance; wrap lines at 80 characters; mark omitted code with a comment in the language’s syntax. |
| Google: omissions | Avoid three dots and the ellipsis character for omitted code. Do not make a block with an omission click-to-copy. |
| Microsoft: code examples | List requirements and dependencies, make the code easy to copy and run, and help readers identify what to modify. |
| Microsoft: results and security | Show expected output in a separate section or in comments; never hard-code passwords; compile and test code. |
Microsoft’s guidance observes that developers often copy or adapt documentation examples. That is a reason to make the boundaries visible. If a reader needs to replace a value, name it. If the code depends on a package, file or previous step, say so before the block. If a sample illustrates only one part of a larger file, do not present it as a complete program.
Handle omissions without hiding the coverage gap
There is a real tension between the Google guidance and one fragment rule in the engine. A block containing ... is treated as a fragment and skipped. Google instead asks authors to mark omitted code with a comment in the sample language.
A comment marking an omission does not trigger that fragment rule. If the resulting block cannot run on its own, it can appear as a failure for triage to classify. Do not assume a particular category in advance: the classification depends on the actual result. Review the page context and the report’s reason before deciding what to change.
For readers, keep following the style guidance appropriate to your documentation. For testing, identify the block as incomplete in the surrounding prose and record the coverage gap. Where useful, provide a complete runnable example elsewhere and link to it. Avoid inserting dots solely to make a check skip a block; that would make the report quieter without improving the reader’s path.
Author examples a report can interpret
The most useful preparation is to state what an example is and what a reader needs. A fence label is part of that statement. A python fence describes Python code; a pycon fence describes an interactive session with prompts and output. Do not label prose, a response or an incomplete fragment as runnable code just to obtain a green result.
Before publishing, check the following:
- Introduce the example and explain the task it performs.
- List required packages, tools, files, environment and prior steps before the example.
- Use a fence label that honestly describes the contents.
- Make values readers must change clear. Use a placeholder such as
YOUR_API_KEY, never a real password or key. - State which shell a command expects when shell choice matters.
- Show expected output when it helps readers understand the result, and explain which values may differ.
- Mark omissions in the language’s comment syntax and avoid presenting an incomplete block as click-to-copy.
- Keep lines within the relevant style guidance and ask a language owner to review behavior you cannot verify.
A placeholder protects the example from presenting a real secret, but it also affects coverage. The engine does not run examples needing credentials with real keys, and running them with customer-provided test credentials is not currently supported. A placeholder-dependent shell or request block is skipped and classified as needs-credentials. See testing examples that need credentials for the workflow around that gap.
Use a Python session when output must be checked
When a Python example has stable output that matters to the lesson, a pycon session puts the input and expected output together. The following example requires Python’s standard library only:
>>> from statistics import mean
>>> mean([2, 4, 6])
4
Save those three lines in a text file, such as sample.txt, and run:
python -m doctest -v sample.txt
Python’s doctest documentation describes finding interactive-looking sessions in text and executing them to check that they work as shown. The session above also gives the product a supported form in which to compare printed output line by line.
A separate output block can still be valuable to a reader. Introduce it clearly and explain whether it is representative or exact. The engine recognizes output blocks and skips them; it does not compare or validate their contents. The same limitation applies to output shown after commands in a console block. If the output must be verified, arrange a suitable check and record it separately.
Understand what a green result covers
The product executes supported Python, JavaScript and shell examples, and it syntax-checks some structured blocks. A result can therefore describe different kinds of evidence. Python and JavaScript examples run in page order; a fresh container is used for each page. One alternative is selected from a tabbed group, so other tabs need their own coverage plan.
Some boundaries matter especially when reporting progress:
- Go, Rust, Java, Ruby, PHP, C#, Kotlin and Swift are recognized but not executed. TypeScript handling is limited to simple type annotations; JSX and TSX are not judged.
- An unmapped fence label can be reported as
passwithout the block being run or parsed. A green result for such a label is not evidence of a check. - JSON and TOML blocks can receive syntax checks, not schema checks. YAML blocks are reported as passing with a skipped-parser detail; use a YAML parser or
yamllintin your own CI for YAML syntax. - Printed output is compared only in
pyconorpython-replsessions. Separate output blocks are skipped.
Check framework and language support when choosing labels and defining coverage. A report should tell the team both what it learned and what remains unverified.
Read the report without debugging every language
Start with the page and line, then read the status, category and reason together. A status tells you what happened to a block. A category supplies context for deciding whether the finding is likely to be a docs bug or requires another kind of review. The report also includes a docs-bug flag; it is a useful queue, not a substitute for reading the page.
Statuses
| Status | What it means for the writer | Who acts |
|---|---|---|
pass |
The result is reported as passing. It may reflect execution or a syntax check; an unmapped label can also pass without a check. Only supported interactive Python sessions compare printed output. | Writer checks coverage; nobody needs to fix a genuinely passing block. |
warn |
The block ran but has a warning, such as differing output or a dependency deprecation warning. Read the category and reason. | Writer reviews the reader impact; engineer helps when behavior or dependency changes are unclear. |
fail |
The block exited with an error. The category and context help determine whether the docs are at fault. | Writer routes it; engineer investigates product or language behavior as needed. |
skip |
The block was deliberately not run, with a reason. It is a coverage record, not evidence of a passing example. | Writer records the gap; engineer acts if another check is needed. |
Categories that flag likely documentation bugs
| Category | What it means for the writer | Who acts |
|---|---|---|
api-drift |
An import, attribute or keyword argument is missing from the installed version. The example may describe an older API. | Engineer confirms the current API; writer updates the explanation and sample. |
invalid-syntax |
A complete snippet does not parse, or a supported structured block has a syntax error. | Writer corrects an obvious editorial mistake; engineer reviews unfamiliar code. |
stale-output |
Code runs but documented output is from an older runtime. Check what form of output was actually compared. | Writer updates the expected result after engineer confirmation where needed. |
package-not-found |
A documented pip or npm package name does not exist. | Engineer confirms the intended package; writer corrects the instruction. |
Categories that need review or describe something other than a docs bug
| Category | What it means for the writer | Who acts |
|---|---|---|
runtime-error |
The run failed at runtime, but the cause is not automatically filed as a docs bug. | Engineer investigates; writer supplies page context. |
timeout |
The run did not finish within the limit. The report alone does not establish why. | Engineer investigates the operation; writer records the impact. |
network-external |
An external network result may need review and is not automatically a docs bug. | Engineer investigates when needed; otherwise writer records the coverage gap. |
depends-on-context |
The block uses a name defined elsewhere on the page or omitted from the sample. | Writer checks whether the necessary context is clear; engineer helps verify it. |
needs-credentials |
The example needs credentials and was not run with real keys. | Writer makes the requirement clear; engineer arranges any separate authorized verification. |
missing-install-step |
A package is imported without an install step on the page; the report provides a hint. | Writer checks prerequisites; engineer confirms the dependency. |
missing-fixture |
The example expects a local file or similar fixture. | Writer checks whether readers are told how to obtain it; engineer clarifies its contents if needed. |
missing-tool / host-tool |
The example needs a tool or host command the runner does not provide or execute. | Writer states the requirement; engineer chooses a separate check if needed. |
output-differs |
Output differs in a way such as timestamps, headers or ordering. Inspect the evidence and supported comparison scope. | Writer decides what readers should expect; engineer helps assess meaningful differences. |
deprecated-usage |
A dependency emitted a deprecation warning. | Engineer recommends the supported usage; writer updates the page when appropriate. |
illustrative |
A placeholder package or module name is intentional. | Writer makes the illustrative purpose clear; nobody fixes the placeholder as a real package. |
runner-gap / unsupported-syntax |
The runner cannot judge the construct. | Writer records the gap; engineer selects another check if the example matters. |
Categories skipped on purpose
| Category | What it means for the writer | Who acts |
|---|---|---|
output-block |
The block is presented as output and is skipped, not compared. | Writer checks that the presentation is useful; engineer verifies the result separately when needed. |
alt-variant |
Another tab was selected for this run. | Writer tracks which alternative lacks coverage; engineer helps test it. |
fragment |
The block contains ... and was skipped as a fragment. |
Writer checks whether the omission is explained and follows the applicable style guide. |
not-executable |
The block is configuration, prose or a recognized language the engine does not run. The reason names the language. | Writer records the limit; engineer supplies another check where appropriate. |
Use the category as a routing aid, not an automatic verdict on the page. For example, a missing fixture can be intentional, but the page may still need a sentence explaining where a reader gets it. Conversely, a failure caused by an external network does not establish that the example is wrong. The findings reference provides the product’s classification details.
Review findings with engineers
Agree on responsibilities before the first report arrives. The writer owns the reader’s path: introductions, prerequisites, labels, placeholders, explanations and the clarity of any correction. An engineer owns confirmation of API behavior, language-specific fixes and the cause of failures that require runtime knowledge. Both review a change that affects what readers copy.
For a likely docs bug, include the page, line, category and reason in the issue or pull request. Add the documented setup and the version or environment used when available. Ask a focused question: “Does this attribute still exist in the supported version?” is easier to answer than “Can you fix the docs test?” Once the engineer confirms the correction, the writer can check that the surrounding instructions still make sense.
For an uncertain runtime or network finding, ask engineering to establish whether the example, environment or external dependency caused the result. For a skipped credential example, do not describe the scan as an end-to-end verification. Record who will perform any separate authorized check and what evidence that check should produce.
Route docs changes with CODEOWNERS
A repository can use a CODEOWNERS file to identify individuals or teams responsible for docs paths. According to GitHub’s CODEOWNERS documentation, owners are automatically requested for review when a pull request changes a path they own. Draft pull requests do not request that review until marked ready.
An illustrative entry for a docs directory looks like this:
/docs/ @acme/docs-team
Use a real team with write access in your own repository. GitHub searches for the file in .github/, the repository root and docs/, in that order, and uses the first one found. Paths are case sensitive. People with the appropriate repository permissions can require code-owner approval before merge.
CODEOWNERS routes a review; it does not decide whether an API is correct. The docs team can request an SDK owner when the change needs that expertise, and the SDK owner can ask the writer to review the reader-facing explanation.
A weekly triage agenda
Keep the meeting focused on decisions that cannot be made from the report alone:
- New likely docs bugs: confirm the owner, reader impact and next action for each
is_docs_bugfinding. - Uncertain failures: assign an engineer to investigate runtime errors, timeouts or external network results that matter.
- Skipped coverage: review credential-dependent examples, untested alternatives and important unsupported languages.
- Reader context: decide whether missing setup, files, shell requirements or omitted code need clearer explanations.
- Open changes: check whether fixes have the right writer and engineering reviewers, and record anything deferred.
The outcome should be an owner and next step, not a meeting transcript full of raw failures. Close findings that require no action, while preserving the reason a block was not checked.
Choose a workflow for your team
| Team | A workable routine | Where to involve engineering |
|---|---|---|
| Lone writer | Start with a small set of high-value pages. Read the report, correct clear labeling and prerequisite problems, and keep a short list of unverified examples. | Bring likely API drift and unclear runtime failures to the relevant product or SDK owner with the page and line. |
| Small docs team | Divide page review, agree on category routing and hold a short weekly triage. Use shared review rules for examples and track skipped coverage. | Ask named owners to confirm behavior and review code changes; writers review the resulting reader path. |
| Docs platform team | Establish shared scan scope, report handling and coverage records across repositories. Review labels, unsupported languages and alternative tabs consistently. | Work with SDK and service owners on language-specific checks and release-related changes; keep responsibility for each docs path visible. |
Start with pages readers depend on, such as installation, a first successful task and frequently linked examples. Expand when the team can interpret and act on the report. A larger scan is useful only if someone can distinguish an actionable finding from a known limitation.
Report progress to a docs manager
A monthly report should make the scan’s scope and remaining gaps visible alongside the counts. report.json includes summary counts by status and category, including summary.likely_docs_bugs. Copy the relevant counts from that report; do not infer that a passing count means every block was executed.
| Month and scope | pass |
warn |
fail |
skip |
likely_docs_bugs |
What needs attention |
|---|---|---|---|---|---|---|
[month; repository and pages scanned] |
[report count] |
[report count] |
[report count] |
[report count] |
[report count] |
[owners, unresolved findings and coverage gaps] |
Add a sentence explaining changes in scope before comparing months. A new set of pages, a different selection of tabs or more unsupported labels can change the counts without representing a change in quality. Summarize the categories behind the numbers: for example, distinguish an API correction awaiting review from credential-dependent examples that the scan cannot execute.
Group docs-bug findings by page
The following small sample uses the keys needed by the script. Save it as report.json:
{
"summary": {
"likely_docs_bugs": 2
},
"findings": [
{
"status": "fail",
"category": "api-drift",
"page": "docs/start.md",
"line": 18,
"is_docs_bug": true
},
{
"status": "fail",
"category": "invalid-syntax",
"page": "docs/start.md",
"line": 42,
"is_docs_bug": true
},
{
"status": "skip",
"category": "needs-credentials",
"page": "docs/auth.md",
"line": 12,
"is_docs_bug": false
}
]
}
Save this standard-library script as group_findings.py in the same directory:
import json
from collections import defaultdict
from pathlib import Path
report = json.loads(Path("report.json").read_text(encoding="utf-8"))
groups = defaultdict(list)
for finding in report["findings"]:
if finding["is_docs_bug"]:
groups[finding["page"]].append(finding)
for page in sorted(groups):
print(page)
for finding in sorted(groups[page], key=lambda item: item["line"]):
print(
f" line {finding['line']}: "
f"{finding['status']} / {finding['category']}"
)
Run it with:
python group_findings.py
The script groups only findings marked as docs bugs. Review skipped and uncertain findings separately; their absence from this list does not mean those examples were verified. The CLI reference describes scan options and report output.
For developer advocates who own quickstarts, workshops and sample READMEs, see docs testing for DevRel teams.
Where the product fits
DocsAlive can scan a local directory or Git URL, extract fenced blocks, plan execution or skipping, and produce Markdown and JSON reports. It keeps supported blocks in page order and uses a fresh container per page. Triage classifies results using the actual error, helping a team separate likely documentation defects from context, credentials and runner limitations. When a model provider is configured, the product can draft a small fix and rerun the fixed page; maintainers decide whether to merge. See how it works.
A health check provides a one-off report for a public GitHub or GitLab repository you own, maintain or are authorized to test. The team runs the engine on up to 40 docs pages and emails the report within two business days; the checkout is deleted after the run.
The Open source plan is $0/month for qualifying public OSI-licensed projects and does not include pull-request checks or draft fix pull requests. Those capabilities start at Team. See pricing for plan details.
Keep the limits in the review record: compiled languages are recognized but not executed; TypeScript support is limited; credential-gated examples are classified rather than run with real keys; output is compared only in interactive Python sessions; and an unmapped fence label can report a pass without a check. A report helps prioritize review, but it does not assess whether prose is clear or whether an unsupported journey works end to end.
Pasteable review checklist
Copy this into an issue or pull request and fill in the missing context:
- [ ] Page and intended reader task are identified.
- [ ] Requirements, dependencies, files and shell are stated before use.
- [ ] Each fence label describes its contents honestly.
- [ ] Values readers must replace are clear; no real passwords or keys appear.
- [ ] Omissions are marked and incomplete samples are not presented as copyable.
- [ ] Expected output is useful to the reader and its variability is explained.
- [ ] Stable Python output that needs comparison has a pycon check.
- [ ] Separate output blocks are understood to be shown, not compared.
- [ ] Report statuses, categories and reasons were reviewed together.
- [ ] Likely docs bugs have an owner and a next step.
- [ ] Runtime, timeout and network findings have been routed for review.
- [ ] Credential, language, tab and runner coverage gaps are recorded.
- [ ] A writer reviewed the reader path after any engineering correction.
For a broader reusable process, see the docs testing checklist and documentation drift guide.
The sources we checked
These sources were read on November 12, 2026.
| Source | What it covers |
|---|---|
| Write the Docs: Docs as code | Shared documentation and development tools, workflows, reviews and automated tests |
| Google developer documentation style guide: Code samples | Introductions, formatting, line length and marking omissions |
| Microsoft Writing Style Guide: Code examples | Requirements, copyable code, modifications, expected output, security and testing |
Python documentation: doctest |
Checking interactive Python sessions in documentation |
| GitHub Docs: About code owners | CODEOWNERS locations, ownership patterns and review requests |
FAQ
Do technical writers need to know every language in the documentation?
No. Writers can identify the reader task, prerequisites, page context and report finding, then ask an engineer to confirm language or API behavior. Shared review makes the correction both technically sound and understandable.
Should every failed block become a documentation bug?
No. Read the category and reason. API drift and invalid syntax can identify likely docs bugs, while runtime errors, timeouts, external network results and missing context need investigation before the team decides what action to take.
How should a writer mark omitted code?
Follow the applicable style guide. Google asks authors to use a comment in the sample language and avoid making an incomplete block click-to-copy. A comment does not trigger the engine's ellipsis fragment rule, so an incomplete block may fail and need triage.
Does a separate output block get checked?
No. A separate output block can show readers what to expect, but the engine skips it without comparing or validating its contents. Printed output is compared in supported pycon or python-repl sessions.
Can the product test an example that needs an API key?
Credential-gated examples are classified rather than run with real keys. Running them with customer-provided test credentials is not currently supported. Record the gap and arrange a separate authorized check if the full flow needs verification.
What does a passing report tell a docs manager?
It is evidence about the checks that actually ran or parsed supported blocks, within the reported scope. Review skipped blocks and language limits as well: an unmapped fence label can be reported as passing without execution or parsing.




