THE GITHTML FIELD GUIDE

Maintain repeated Markdown images with reference labels

Reference-style images let multiple Markdown image uses share one destination definition. Keep the alternative text on each individual use because the same image can serve different explanations. Use the pattern to maintain paths, not to hide a screenshot's meaning, and test the resulting image in every publication context that consumes the source.

Separate the image resource from its explanation

A screenshot destination and its alternative text answer different questions. The destination tells the renderer where to obtain the image; the text tells the reader what the image contributes here. If one settings screenshot appears in both installation and troubleshooting instructions, its useful information may differ. A shared reference can centralize the path without forcing identical explanations. Avoid labels such as screenshot-final-new, which become misleading after the next edit. Prefer the represented state, such as preview-settings. Keep the image close to the paragraph that explains why the reader should examine it.

Create a two-use fixture before reorganizing assets

The example references one image from two sentences with different explanatory purposes. Replace the illustrative path with an asset you are authorized to publish. Preview both uses after moving or renaming that asset. A reference definition does not make a relative path universal: its interpretation still depends on the renderer and publication location. Do not convert every image to an absolute website URL just to silence a local preview problem. First identify which system owns path resolution, and preserve a source layout that the actual documentation build understands. Record the image's revision if it depicts behavior that changes between releases.

markdown
![Preview setting enabled][preview-settings]

![Location of the preview control][preview-settings]

[preview-settings]: images/preview-settings.png

Keep screenshot maintenance separate from link maintenance

When a screenshot changes, review each context that uses its shared label. Updating the file can silently invalidate captions elsewhere in the guide even though every image still loads. Check the represented state, selected options, and visible terminology, not only the file path. Remove identifying information and test data that should not be published. If the image is purely decorative, follow the project's accessibility convention rather than adding a meaningless description. For an HTML reading copy, verify that the export includes or correctly references the image; a working Markdown reference is not evidence that the exported asset travels with the document. Prefer a small image inventory when many pages share screenshots. Record each label's intended state and owning page so a visual refresh has an explicit review list rather than relying on memory.

  1. Choose a label based on the pictured state rather than a temporary filename.
  2. Review every reference use whenever the shared image changes, including captions and surrounding instructions.
  3. Test the exact export separately and document whether it embeds the resource or expects another file.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All markdown and readme files guides →

Read as MarkdownAll guides

Maintain repeated Markdown images with reference labels · gitHtml