This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: how to comment programlisting or source code
At 10:41 22/08/2002, Bob Stayton wrote:
>Since programlisting is a verbatim block, can't you
>just line up your annotations manually as you write them?
>Maybe I'm not understanding what you are trying to do.
>If you are doing long comments that wrap, perhaps you could
>use callouts?
Callouts are a good option.
In html they do take a bit of tweaking, but look good.
Took me some time to imitate Norm, but this is what works
for me now. I could put them any position on the line.
<example id="bl.ch">
<title>Chapter page sequence</title>
<programlisting format="linespecific">
<fo:page-sequence
master-reference="chaps"
initial-page-number="1"
format="1"> <co id='pnf'/>
<fo:static-content
flow-name="xsl-region-before">
<fo:block text-align="outside"> <co id='hd'/>
Chapter <fo:retrieve-marker
retrieve-class-name="chapNum"/> <co id='cn'/>
<fo:leader leader-pattern="space" />
<fo:retrieve-marker
retrieve-class-name="chap"/> <co id='ttl'/>
<fo:leader leader-pattern="space" />
Page <fo:page-number font-style="normal" /> <co id='pna'/>
of <fo:page-number-citation ref-id='end'/> <co id='lp'/>
</fo:block>
</fo:static-content>
</programlisting>
<calloutlist>
<callout arearefs="pnf">
<para>The page number is formatted in Roman</para>
</callout>
<callout arearefs="hd">
<para>this block forms the header on these pages</para>
</callout>
<callout arearefs="cn">
<para>The chapter number is retrieved as a marker</para>
</callout>
<callout arearefs="ttl">
<para>The chapter title is retrieved as a marker.</para>
</callout>
<callout arearefs="pna">
<para>The page number is added</para>
</callout>
<callout arearefs="lp">
<para>Last page number of document</para>
</callout>
</calloutlist>
</example>
HTH DaveP