Skip to content

Instantly share code, notes, and snippets.

@infotexture
Created January 16, 2013 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infotexture/4547112 to your computer and use it in GitHub Desktop.
Save infotexture/4547112 to your computer and use it in GitHub Desktop.
DITA markup for (hidden) indexterms vs. (visible) keywords
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="ID">
<title id="Module">Module Name</title>
<prolog>
<metadata>
<keywords>
<!-- These keywords are included in index but not visible in output -->
<indexterm>$KEYWORD1$</indexterm>
<indexterm>$KEYWORD2$</indexterm>
<indexterm>$KEYWORD3$</indexterm>
</keywords>
</metadata>
</prolog>
<refbody>
<section>
<title>Keywords</title>
<!-- These keywords are visible in output but not included in index -->
<keyword>$KEYWORD1$</keyword>, <keyword>$KEYWORD2$</keyword>, <keyword>$KEYWORD3$</keyword>
</section>
</refbody>
</reference>
@infotexture
Copy link
Author

For a software reference project, I need to include keyword metadata in topics so that the keywords appear both in an index and in the topic body output.

<indexterm> elements specified in the prolog metadata are included in the index but not visible in output, whereas <keyword> elements that appear in the topic body are visible in output but not included in the index.

Is there any way to avoid this redundant markup and specify the keywords once so they appear in both the index and in output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment