From: John Labovitz Date: 2005-01-17T06:03:59+09:00 Subject: Re: What's the best way to write a Textile-to-PDF::Writer converter? On Jan 16, 2005, at 12:32 PM, Austin Ziegler wrote: > On Mon, 17 Jan 2005 03:51:29 +0900, Andreas Semt > wrote: >> I am relative new to Ruby, so i ask: >> What's the best way to develop a *pure* Ruby Textile-to-PDF::Writer >> converter? > 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). (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. 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. -- John Labovitz Macintosh support, research, and software development John Labovitz Consulting, LLC johnl@johnlabovitz.com | +1 503.949.3492 | www.johnlabovitz.com/consulting