Definitions in same document - Fluid Topics - Latest

DITA Connector Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

To have glossary definitions in the same document that references them:

  1. Create a DITA map for the definitions (for example, glossary_keystore.ditamap).

    The DITA map acts as a reference point for the glossary terms. <glossref> elements must include the toc="yes" attribute.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
    <map>
        <title>Glossary Keystore</title>
    
        <!-- Topics -->
        <glossref href="dita-def.dita" keys="dita" toc="yes"></glossref>
    </map>
    
  2. Create a glossary entry topic (for example, dita-def.dita).

    The following is an example of glossary entry:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE glossentry PUBLIC "-//OASIS//DTD DITA Glossary Entry//EN" "glossaryentry.dtd">
    <glossentry id="dita-definition">
        <glossterm>Darwin Information Typing architecture</glossterm>
        <glossdef>
            <p>A specification that defines a set of document types for authoring and organizing topic-oriented information.</p>
        </glossdef>
        <glossBody>
            <glossSurfaceForm>DITA (format)</glossSurfaceForm>
        </glossBody>
    </glossentry>
    
  3. Create a DITA map for the main content (for example, my_document.ditamap).

    Users must reference the glossary map, as in the following example:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
    <map>
        <title>What is DITA?</title>
    
        <!-- Topics -->
        <topicref href="glossref-sample.dita"/>
    
        <!-- References -->
        <topicref>
            <topicmeta>
                <navtitle>Glossary</navtitle>
            </topicmeta>
            <mapref href="glossary_keystore.ditamap" format="ditamap"/>
        </topicref>
    </map>
    
  4. Reference the glossary entry in a topic (for example, glossref-sample.dita), as in the following example:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="glossref-sample">
        <title>Glossref tooltip DITA sample</title>
        <conbody>
            <p><term keyref="dita"/> is based on XML.</p>
        </conbody>
    </concept>
    
  5. Compress the parent folder and publish.

This example produces the following tooltip:

A documentation page showing a glossref element tooltip in DITA content published in Fluid Topics. The page has the word 'DITA (format)' underlined and in pink, signifying a tooltip is available. A grey tooltip box appears below this phrase, providing the definition.

Selecting the link takes the readers to the topic:

A documentation page showing a glossref element in DITA. The page has the word 'DITA (format)' underlined. It links to the 'Glossary' section of the page, with the definition of DITA.