The reference element defines a top-level container for a reference topic. Reference topics document programming constructs or facts about a product. Examples of reference topics include (but are not limited to) product specifications, environmental specifications, equipment lists, parts lists, required tools, language elements, class descriptions, commands, functions, and API information. All of these topics provide quick access to facts, but they do not contain a deeper explanation of related concepts or tasks.
Reference topics have the same high-level structure as any other topic type, with a title, short description, and body. Within the body, reference topics are typically organized into one or more sections, property lists, and tables. The reference topic type provides general rules that apply to all kinds of reference information, using elements like refsyn for syntax or signatures, and properties for lists of properties and values
- topic/topic reference/reference
<reference id="refexample"> <title>A reference topic</title> <refbody> <refsyn>Describe command or api syntax here, possibly using synph or syntax elements markup for explicit definition of syntax or prototype construction.</refsyn> <section><title>Some section title</title></section> <properties> <property> <proptype>type</proptype> <propvalue>value</propvalue> <propdesc>description</propdesc> </property> </properties> </refbody> </reference>
The following information could apply to an entire set of maintenance procedures, each of which would link to this topic.
<reference id="requiredTools"> <title>Tools required to maintain a big machine</title> <refbody> <section> <title>Small tools</title> <ul> <li>Hard hat</li> <li>Hammer</li> <li>Nail</li> <li>Metal polish</li> <!-- .... --> </ul> </section> <section> <title>Expensive tools</title> ... </section> </refbody> </reference>
- id (REQUIRED)
- An anchor point. This ID is usually required as part of the href or conref syntax when cross referencing or reusing content within the topic; it also enables topicref elements in DITA maps to optionally reference a specific topic within a DITA document. This attribute is defined with the XML Data Type ID.