On Sat, May 21, 2005 at 06:13:56PM +0200, Jordi Vilalta wrote:
Hi,
On Thu, 19 May 2005, Francois Gouget wrote:
>Wine's DobBook documentation is in SGML but I also tried the DocBook.pm
>module on it. The nice thing is that it translates the 'lang' attribute.
>The bad thing is that it does not handle including files using entities
>and this is extensively used in Wine's documentation :-(.
One solution would be to use configuration files (see po4a(1)) to
translate the files separated, and obtain a hierarchy like the original
document's one.
If it's very annoying (if there are lots of files to insert into the
config file...) I'll try to implement the file inclusion this summer. (I'm
out of time currently)
File inclusion should be easy to implement outside the Sgml.pm module.
That's indeed a shame that this is implemented in the module where it's the
more complicated (using an external parser requires a load of bookkeeping to
indicate the right position on error messages) and not in the others.
I guess that we just need a include_file(filename) function in TransTractor.pm
Its action would be much like the read() function already there. You only
need to read into a new array instead of @{$self->{TT}{doc_in}} Then, when
you got all the file,
while (defined(my ($l,$ref) = pop @newarray) {
$self->unshiftline($l,$ref);
}
or so. Ie, insert the content of the new file in the working spaces. I'll do
the trick for all modules using the popline function. Ie, Man.pm and Xml.pm
(for now. One day, Sgml.pm will be in this list).
I hope it makes sense to someone with more free time than me ;) If you want
to proceed and implement this, please go ahead.
Bye, Mt.