This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xref to numbered code line?


>| What's the best way to mark up a code listing if I want it to appear with
>| numbered lines and I want to refer to specific line numbers without hard
>| coding the line numbers? If I write "In line 25, the
<literal>free</literal>
>| command deallocates the memory" and then insert more code above line 25,
I
>| don't want to have to change that "25" by hand. 
>| 
>| I'm assuming it's some appropriate subelement of programlisting and then
an
>| xref to that, but I can't figure out what. 
>
>Well, this is kind of rough to deal with. The "obvious" answer
>of putting a marker, like <co>, in the programlisting at the
>appropriate location is tedious because it means you have to
>inject markup into your source code.

Thanks Norm! co is great, and I was happy to see what docbook.dsl did when I
tested it. The tedium wouldn't be as bad as you describe for me, because I
keep other markup in my programlistings anyway and have perl scripts to
convert them back and forth for testing and inserting: carriage return
placemarkers in case I accidentally fill the region in Emacs, < to &lt;,
losing the line numbers, etc. so a little more code there to deal with co
elements will be simple. 

Now I'll get in line with the people saying "Hey Norm! Here's an element
type that I'd love to see in the simplified DocBook!"

thanks,

Bob DuCharme          www.snee.com/bob           <bob@  
snee.com>  "The elements be kind to thee, and make thy
spirits all of comfort!" Anthony and Cleopatra, III ii


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]