XML technologies / DocBook / Block elements / Program listings / Annotating lines
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
There are two ways to annotate a specific point in your source code:
Callouts, described in Callout lists (calloutlist) and Callouts.
Line annotation with
lineannotation
Source code and annotations can be mixed within programlisting or screen:
<programlisting language="python">#!/usr/bin/python -u
import sys
import string
import commands
<lineannotation>Zusammensetzen des Befehls:</lineannotation>
cmd = ["file", sys.argv[1], "| cut -d',' -f2" ]
cmd = string.join(cmd)
(res, out) = commands.getstatusoutput(cmd) <lineannotation
>Ausführen des Befehls</lineannotation>
print res, out <lineannotation
>Rückgabewert und Ergebnis ausgeben</lineannotation>
</programlisting>
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top