From: Andreas Semt Date: 2005-01-17T23:00:45+09:00 Subject: Re: What's the best way to write a Textile-to-PDF::Writer converter? John Labovitz wrote: > On Jan 16, 2005, at 12:32 PM, Austin Ziegler wrote: >> >> I don't know, offhand, but if you want to definitely do this and >> contribute it to PDF::Writer, I will happily work with you on that -- >> this has been part of a goal of PDF::Writer (the specification of a >> better formatting language than the simple one that I support right >> now). > Hello Austin! I want just a little converter for my Soks content, no big deal. However i could (later) expand this little converter to a more general tool for converting Textile-to-PDF using PDF::Writer. > > (This is mostly a response to Andreas; it probably won't be news to > Austin.) > > I've been using PDF::Writer to do some graphical charting, so I'm not so > familiar with its text processing. But I'll take a guess on how to do > this. > > When you use the #ez_text method, the text you pass in can be a big > block of text, possibly spanning multiple pages. The text can have > HTML-like markup. The text processing code in PDF::Writer will > apparently handle all the details of wrapping lines, spacing paragraphs, > and breaking pages. So for a first pass (assuming you don't need to > control page breaks), you might work on a simple Textile-to-ez_text > converter. Hello John! Thanks for that hint. However "ez_text" does not support formatting of any kind (for example: bold, italic, ...). So i will use other methods. > If you haven't seen it, you should look at RedCloth, which is an > implementation of a Textile-to-HTML converter. It doesn't appear to be > very extensible -- its HTML generation seems all wrapped up in the > parsing -- but at only 1000 lines of code, maybe it would be a good > thing to build on. > Yes, it's a good starting point. "redcloth.rb" and Austin Ziegler's "readme.rb" example will guide me ;-) Greetings, Andreas > -- > John Labovitz > Macintosh support, research, and software development > John Labovitz Consulting, LLC > johnl@johnlabovitz.com | +1 503.949.3492 | www.johnlabovitz.com/consulting > > > >