[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [ANN] ClothRed (HTML to Textile

Victor 'Zverok' Shepelev

4/11/2007 8:52:00 PM

From: Phillip Gawlowski [mailto:cmdjackryan@googlemail.com]
Sent: Wednesday, April 11, 2007 10:26 PM
>Victor "Zverok" Shepelev wrote:
>
>> A bit OT, but I'm dreaming/planning (for a long time) about library,
>which
>> can handle "greatest common divisor" of all simple text format and
>perform
>> uniformly conversions like
>>
>> Textile <=> <=> HTML
>> Markdown <=> <=> PDF
>> Mediawiki <=> gcd <=> PS
>> RDOC <=> <=> OpenOffice
>>
>> There are several projects performing only [some markup]=>html
>conversions.
>> There is also Maruku[1], which seems to handle virually any
>Markdown=>[rich
>> format] conversion (and seems to embody some common intermediate format).
>> There is now your project.
>>
>> Isn't now a time to do something more generic?
>
>Well, once there are libraries to do any one of these tasks, you can
>build a tool chain, similar to DBI, for example.
>
>I know that there's a PDF generator written in Ruby, but i don't know
>about the other file formats. Creating markup parsers isn't that much of
>a challenge, so that could be done quite easily.
>
>I'd be happy to, once ClothRed is feature-complete in the HTML ->
>Textile area, to write an API to integrate ClothRed into other tools.
>

My point was, to have some intermediate format, and have couple of parsers
TO this format and generators FROM it.

Now, authors of all libraries are solving 2 problems - parse & generate. It
should be nice to have one common HTML parser, which could be used either
for HTML->Textile, or for HTML->Markdown (only generators will differ).

From some poin of view, we can use Textile as intermediate, your library
would be "parser", RedCloth would be "generator". But this leaves Markdown,
Rdoc "off the game", while we have no Markdown->Textile and similar
convertors.

V.


4 Answers

Gary Wright

4/11/2007 9:10:00 PM

0


On Apr 11, 2007, at 4:52 PM, Victor Zverok Shepelev wrote:
> My point was, to have some intermediate format, and have couple of
> parsers
> TO this format and generators FROM it.

Seems like XHTML would be the obvious choice for the intermediate
format, no?
Unless you want to reinvent that particular wheel.

Gary Wright




Phillip Gawlowski

4/12/2007 6:57:00 AM

0

Victor "Zverok" Shepelev wrote:

> Now, authors of all libraries are solving 2 problems - parse & generate. It
> should be nice to have one common HTML parser, which could be used either
> for HTML->Textile, or for HTML->Markdown (only generators will differ).

Well, ClothRed has to parse HTML to output Textile. It does not more
than that. If you plug it into a converter suit, you can use HTML as an
intermediary format (RedCloth can parse Textile and Markdown into HTML,
so you'd have already a little part of such a converter).

>>From some poin of view, we can use Textile as intermediate, your library
> would be "parser", RedCloth would be "generator". But this leaves Markdown,
> Rdoc "off the game", while we have no Markdown->Textile and similar
> convertors.

Granted, the scope of my library is limited, but purposefully so, to
keep it a) manageable, and b) keep it in line with my skills. Once
ClothRed is feature-complete, I can add to its functionality, but not
sooner, if I can avoid it.

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....

Rule of Open-Source Programming #8:

Open-Source is not a panacea.

Gregory Seidman

4/12/2007 1:30:00 PM

0

On Thu, Apr 12, 2007 at 03:56:50PM +0900, Phillip Gawlowski wrote:
> Victor "Zverok" Shepelev wrote:
> >Now, authors of all libraries are solving 2 problems - parse & generate. It
> >should be nice to have one common HTML parser, which could be used either
> >for HTML->Textile, or for HTML->Markdown (only generators will differ).
>
> Well, ClothRed has to parse HTML to output Textile. It does not more
> than that. If you plug it into a converter suit, you can use HTML as an
> intermediary format (RedCloth can parse Textile and Markdown into HTML,
> so you'd have already a little part of such a converter).

Are you using Hpricot for your parsing? If so, it should be pretty easy to
do the conversion. If not, why not? (Disclaimer: I've been following the
thread but haven't looked at or even installed/run the code.)

> >From some poin of view, we can use Textile as intermediate, your library
> >would be "parser", RedCloth would be "generator". But this leaves Markdown,
> >Rdoc "off the game", while we have no Markdown->Textile and similar
> >convertors.
>
> Granted, the scope of my library is limited, but purposefully so, to
> keep it a) manageable, and b) keep it in line with my skills. Once
> ClothRed is feature-complete, I can add to its functionality, but not
> sooner, if I can avoid it.

I understand where you are with this. At the same time, I have an actual
need to do something very much like this in my own work. I suspect there
are others out there in a similar situation. We're hoping that this will
become useful to us sooner rather than later and that we can avoid rolling
our own.

> Phillip "CynicalRyan" Gawlowski
--Greg


Phillip Gawlowski

4/12/2007 1:46:00 PM

0

Gregory Seidman wrote:

> Are you using Hpricot for your parsing? If so, it should be pretty easy to
> do the conversion. If not, why not? (Disclaimer: I've been following the
> thread but haven't looked at or even installed/run the code.)

No, I don't. I want to avoid dependencies as much as I can, so that
ClothRed can stand on its own as much as possible.

> I understand where you are with this. At the same time, I have an actual
> need to do something very much like this in my own work. I suspect there
> are others out there in a similar situation. We're hoping that this will
> become useful to us sooner rather than later and that we can avoid rolling
> our own.

Regarding the time frame, I'm trying to make it feature-complete as soon
as I can. There isn't much left to do for the core engine, and after
that I can pretty it up a bit (with rule sets and the like).

If all goes well, ClothRed will hit the big 1.0.0 at the weekend, as a
full HTML to Textile parser. After that, I'm very open to ideas
regarding its future.

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....
http://clothred.rub...

Rules of Open-Source Programming:

22. Backward compatibility is your worst enemy.

23. Backward compatibility is your users' best friend.