XML technologies / DocBook / Block elements / Callouts / Callout markers directly in the content

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

The simplest and quickest way to annotate content is to insert callout markers directly in the text:

Example: Inserting callout markers

<programlisting language="python2">#!/usr/bin/python -u
import sys
import string
import commands <co ANKER="co.commands"/>

cmd = ["file", sys.argv[1], "| cut -d',' -f2" ] <co ANKER="co.cmd"/>
cmd = string.join(cmd) <co ANKER="co.join"/>

(res, out) = commands.getstatusoutput(cmd) <co ANKER="co.run"/>

print res, out
</programlisting>

Replace the placeholder ANKER with id in DocBook 4 and xml:id in DocBook 5.

To describe the marked locations, use a callout list (Callout lists (calloutlist)). Each list contains the element callout, whose attribute arearefs refers to one or more callout markers:

Example: Referencing callout markers

<calloutlist>
   <callout arearefs="co.commands">
      <para>Importiert </para>
   </callout>
   <callout arearefs="co.cmd co.join">
      <para>...</para>
   </callout> 
   ... 
</calloutlist>

This method works only when content and markers are together. It cannot be used when the content is in an external file. In that case, use the indirect method described on the next page.

  

back to top