Cross References
Technical documentation excels in cross references between sections and links to external resources. The end user must be able to follow these links both in printed form, and in on-screen PDF rendering software.
Internal links
For printed material, a cross reference cannot just be a simple link (although PDF renderers
support them for on-screen display). It should also display the page number of the target. In
CSS you can do this by using the target-counter function.
For example, to get:
For details see [Installation on page 34].
from:
<p> For details see <a href="#installation">Installation</a>.</p>
you can use a static content that is shown after the text from the link, consisting of a
fixed string " on page " and the number of the page of the element referred by the
href attribute:
a:after {
content: " on page " target-counter(attr(href, url), page);
}
The target-counter function may be used together with the
leader function to create table of contents. See: Creating a Table of Contents (TOC).
External links
Usually when linking to resources outside the documentation, normal web links are used.
There are two aspects to take in consideration when styling them:
- When printed on paper, show the entire URL so that the user can see it and type it in a browser.
- When displayed in a PDF reader, mark it as a link so that the user can click on it.
For example:
<p>This is a link to the <a href='http://www.w3.org/'>W3C</a> website. </p>
To fulfill both conditions, you can add text after the "W3C" text, with the entire value of
the href attribute, and use the link or
-oxy-link property to mark the generated content as being a link:
a:after {
content: "(" attr(href) ")";
link: attr(href);
}