Links, and links to hidden topics
Link with xref or related-links. A link to a topic the reader
cannot see turns into plain text, so it never gives away what is behind it.
Writing links
<xref href="install-cli.dita"/> <!-- another topic; text is its title -->
<xref href="preview.dita#preview/staff">the staff view</xref> <!-- an element in a topic -->
<xref href="#links/hidden"/> <!-- an element in this topic -->
<xref keyref="env-vars">environment variables</xref> <!-- through a key -->
<xref href="https://example.com" scope="external" format="html">Example</xref>
- An empty link shows the target topic's title as the reader sees it.
- Links to other local files, such as a sample YAML file, are served like images, only to readers who can see the linking topic.
- A link to a missing file, topic or element is an error,
broken-link. - External links may use
http,https,mailto,telorftp, and external imageshttporhttps. Any other scheme, such asjavascript:ordata:, renders as plain text. related-linkswithlinkelements render as a "Related information" list. Links whose target is hidden are left out of it.
Links to topics outside the navigation
A topic that is in no navigation entry is never published, so links to it are plain text for
everyone. Validation warns about them as link-to-unpublished. Add the topic to the
site map, with toc="no" if it should not be listed.
In PDF publications, links to topics in the same publication jump within the PDF; links to other topics point at the docs site when the reader can see them there.