# Make replaceable placeholders clear in HTML examples

Canonical: https://githtml.com/guides/placeholder-variables-html-examples
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Explain replaceable values explicitly and use var where it represents a variable rather than a literal string. Do not assume italics or angle brackets tell every reader what to substitute. Pair each placeholder with its meaning and a clearly illustrative value, especially when copying the example unchanged would produce a misleading result.

## Choose the right representation

A sample can be syntactically correct but unusable because readers do not know which parts are fixed. Ambiguous names such as value or token compound the problem. Describe the role of the placeholder before giving an example of its shape.

## Apply the pattern deliberately

Keep the convention consistent within the document. If braces denote placeholders, say so and avoid using the same braces for unrelated notation without explanation. The var element communicates a variable role, but it does not perform substitution or validate an entered value.

1. List each replaceable value with its meaning and where the reader obtains it.
2. Use one placeholder convention and label illustrative values as examples.
3. Verify that the literal and replaceable parts remain distinguishable without italic styling.

````html
<p>Replace <var>document-id</var> with the identifier of the document you selected.</p>
````

## Describe the replacement operation, not just the styling

An instruction such as replace document-id is incomplete if the reader cannot tell which document identifier is intended. Explain whether it comes from a URL, a command response, a configuration file, or a named field in the interface. Give an obviously illustrative value that demonstrates the expected shape without resembling a secret. If the value belongs to a specific environment, say so before the example invites the reader to use it elsewhere.

Distinguish documentation placeholders from shell syntax. Angle brackets can look like replace-me notation to an author while carrying a different meaning in a command interpreter. Prefer a convention that the surrounding instructions explain, and never imply that var performs substitution. A rendered variable name is still just text. If you offer a copyable command, identify the edits required before running it and show the completed form with safe fictional values when that clarifies the process.

Review the example by listing all literal punctuation and all replaceable segments. Check whether quotation marks belong in the final value, whether a path is relative to a particular directory, and whether spaces are significant. A reader should not have to discover those rules through trial and error. For credentials, explain the approved way to supply the value without asking people to paste secrets into public documents. Keep the explanatory placeholder distinct from a real token in every screenshot and exported copy.

## Check the finished reading experience

Check a sample with someone unfamiliar with the system. Ask them to identify every replacement and its source. Missing information about where a value comes from is a documentation problem, not a formatting problem.

## Sources and further reading

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

## Related guides

- [Read technical HTML comfortably on iPad in portrait and landscape](https://githtml.com/guides/read-technical-html-ipad-portrait-landscape)
- [Build a small GitHub document reading queue with favorites and recents](https://githtml.com/guides/favorites-recents-document-reading-queue)
- [Find answers in long HTML reports with better search queries](https://githtml.com/guides/search-long-html-report-with-better-queries)
- [Try gitHtml with sample documents before connecting GitHub](https://githtml.com/guides/try-githtml-sample-documents-before-sign-in)

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