# Separate sample output from instructions readers should type

Canonical: https://githtml.com/guides/separate-sample-output-from-input-html
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Mark quoted program output with samp and label it as output, keeping it distinct from instructions or input. Do not rely solely on monospace typography, because commands and results often share that appearance. State which parts of the output are illustrative and which values a reader should expect to differ.

## Choose the right representation

A troubleshooting note may show a command followed by a response with no explanation. Someone reading quickly can mistake the response for another instruction. The risk increases when both are presented as identical blocks and the output contains imperative-looking words.

## Apply the pattern deliberately

Use a visible Expected output label and explain the relevant line before the sample. Redact sensitive values while keeping the structure needed to interpret the result. Avoid presenting synthetic output as a captured observation; label an illustrative example honestly.

1. Label input and output explicitly rather than relying on different background colors.
2. Identify variable values and explain which part of the output establishes the result.
3. Keep long output focused on the lines necessary to understand the documented condition.

````html
<p>Illustrative output:</p><pre><samp>Status: ready
Items: 12</samp></pre>
````

## Show exactly what the reader should compare

A diagnostic guide should distinguish the action from the observation. Put the command in one labeled block and its illustrative output in another. Avoid placing a shell prompt, the command, and several response lines in one unlabeled example when a reader might copy everything. If an interactive transcript is genuinely useful, explain its notation first and identify which lines are typed by the operator. Monospace typography alone cannot carry that distinction.

Tell readers which fields are stable and which are expected to vary. A timestamp, temporary path, item count, or generated identifier will often differ from the example without indicating failure. Point to the specific status or relationship that establishes the result. Conversely, do not reduce a complex response to a cheerful success line if the omitted fields determine whether the operation was complete. The excerpt should support the conclusion the surrounding paragraph draws.

Label invented output as illustrative rather than implying that you ran a particular command. For captured output, record enough context to interpret it, such as the relevant tool version or selected mode, without exposing secrets. Redact sensitive values consistently and explain the replacement convention. Check whether the remaining sample still demonstrates the problem after redaction. When the guide is exported to HTML, preserve line breaks and distinguish long wrapped lines from separate records so a reader does not misread the structure.

## Check the finished reading experience

Ask whether a reader can identify what to do and what merely to compare. If the distinction disappears when styles are removed, strengthen the labels.

## Sources and further reading

- [MDN: samp](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/samp)

## Related guides

- [Try gitHtml with sample documents before connecting GitHub](https://githtml.com/guides/try-githtml-sample-documents-before-sign-in)
- [How to evaluate a GitHub HTML reader on iPhone](https://githtml.com/guides/evaluate-github-html-reader-iphone)
- [Align numeric report columns without adding spaces](https://githtml.com/guides/align-report-numbers-tabular-nums)
- [Why justified text creates gaps in phone-sized reports](https://githtml.com/guides/avoid-justified-text-phone-reports)

Editorial approach: https://githtml.com/guides/about
