OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Better rendering for programlisting

Hello world,

The current rendering for verbatim environments, when line numbers are
enabled, has a significant deficiency: you can't cut-and-paste the
listing without also getting the line numbers and separators.

Looking around at other sites with numbered program listings, the
solution seems to be to use tables. Put the line numbers in the first
column and the listing in the second.

That works, mostly, but if anything in the listing causes a variation in
line height (such as a larger callout), the numbers and the lines get
out of sync.

Using one-line-per-row fixes this, but then cut-and-paste doesn't work
again; the selection crosses over all the columns in each row.

An alternative solution uses nested divs and some slightly fancy CSS.
Naturally, it doesn't work in IE.

I've put an example online: http://nwalsh.com/scratch/out.html

The callout graphics in the listing are intentionally broken because
that was the easiest way to introduce variation. At this font-size,
the callouts are actually ok.


1. Stick with what we have now.
2. Use the table solution and accept the limitation that all lines
   must always be the same height.
3. Find a way to tweak the CSS solution so that IE doesn't fall over

I'm open to suggestions on 3, but I'm not likely to figure it out myself.

Thoughts? Other suggestions?

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com>      | Ahhh. A man with a sharp wit.
http://www.oasis-open.org/docbook/ | Someone ought to take it away from
Chair, DocBook Technical Committee | him before he cuts himself.--Peter
                                   | da Silva

Attachment: pgpe7JzGQAowi.pgp
Description: PGP signature

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]