← Prev in month ← Prev in thread

Re: DOCBOOK-APPS: How do you %indent-programlisting-lines for anexternal file?

From
Lane Stevens <>
Date
2001-05-29T14:33:56+00:00
ID
Thread
Re: DOCBOOK-APPS: How do you %indent-programlisting-lines for anexternal file?
On Mon, May 28, 2001 at 06:36:07PM -0500, Brian Dellert wrote:
> When I convert my docbook to PDF, I want to have all the lines in
> <programlisting> blocks indented 8 spaces. To do this, I added this
> line to my custom stylesheet.
> 
>   (define %indent-programlisting-lines% "        ")
> 
> This works fine if the <programlisting> is embedded in the sgml, like
> this:
> 
> <programlisting>
> #!/usr/bin/perl
> 
> print "Hello ";
> print "World\n";
> </programlisting>
> 
> However, it doesn't work if the <programlisting> comes from an
> external file, like the following. Instead of indenting all the lines,
> only the *first* line of the file "source.pl" gets indented.
> 
>   <programlisting><inlinegraphic format='linespecific' fileref='source.pl'></inlinegraphic></programlisting>
> 
> Any ideas? I've attached sample files. To convert them, I run:
> 
How about defining an entity that references the source file?  I have not
tried this, but I believe that it will work.

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!ENTITY programFile SYSTEM "./source.pl">
]>

...

<programlisting>
&programFile;
</programlisting>

Thanks,
Lane.
-- 
Lane Stevens
Terrapin Technologies, Inc.
http://www.cycletime.com
← Prev in month ← Prev in thread