[Po4a-devel]New module (Dia)
Jordi Vilalta
jvprat@wanadoo.es
Fri, 21 May 2004 19:26:32 +0200 (CEST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---1463811584-569916405-1085160392=:10688
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi,
this week I had my first contact with perl. I took the simplest po4a
module I found (Html) and began changing things. The result has been the
support for a new format: the uncompressed Dia diagrams.
I've been testing it with the diagrams of a document I'm writing, and it
works very well for me (although it needs more testing). I'm sure it's not
perfect, since those are my first lines written in perl. It would be nice
if somebody could check it.
I hope you find it useful. The Dia diagrams are very interesting for
technical documentation, and the last version of Dia can export good
quality pngs (and other formats) without needing X. It's nice to have a
makefile automaticaly generating images in several languages from the
original diagrams ;)
I have to thank you (Denis and Martin) for beginning this great project
(po4a) and taking this to its current status. I was surprised by how easy
it is to add support for a new format using the packages you wrote :)
Don't give up!
When I have some free time I'll try to understand the Sgml module to help
you improve it.
Regards,
Jordi Vilalta
PS: Martin, about the last mail I wrote, there were more issues apart
from the missing files in CVS. I just want to make sure you saw them, I
don't want to rush you :P
---1463811584-569916405-1085160392=:10688
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Dia.pm"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.58.0405211926320.10688@r2d2.localdomain.com>
Content-Description:
Content-Disposition: attachment; filename="Dia.pm"
IyEvdXNyL2Jpbi9wZXJsDQoNCiMgUG80YTo6RGlhLnBtIA0KIyANCiMgZXh0
cmFjdCBhbmQgdHJhbnNsYXRlIHRyYW5zbGF0YWJsZSBzdHJpbmdzIGZyb20g
RGlhIGRpYWdyYW1zLg0KIyANCiMgVGhpcyBjb2RlIGV4dHJhY3RzIHBsYWlu
IHRleHQgZnJvbSBzdHJpbmcgdGFncyBvbiB1bmNvbXByZXNzZWQgRGlhDQoj
IGRpYWdyYW1zLg0KIw0KIyBDb3B5cmlnaHQgKGMpIDIw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