[ANN] TagTreeScanner 0.6

G

Gavin Kistner

From http://phrogz.net/RubyLibs/rdoc/OWLScribble/doc/tts.html:

"The TagTreeScanner class provides a generic framework for creating a
nested hierarchy of tags and text (like XML or HTML) by parsing text.
An example use (and the reason it was written) is to convert a wiki
markup syntax into HTML."

It's not yet as easy as I'd like to understand the core concepts, but
in a nutshell you specify a series of states which your parser may go
through, and for each state supply a set of tags to look for in that
state. Though both it and the Syntax library use StringScanner (and
thus regular expressions) to do the job, TagTreeScanner is distinct
in that:

1) It automatically handles the opening and closing of tags for you
(particularly the "close_match" property of a TagFactory)

2) It automatically handles state (the @tag_genres hash and the
allowed_genre property of factories)

3) It keeps track of a nested tree during building, automatically
pushing and popping nodes as necessary, and (when no tags can be
found) pushing text into the current tag.

I'm not yet cool enough to put this into a gem...hopefully I'll do
that in the next week or so.

This library is useless by itself; it exists to allow you to define
your own syntax parser as a subclass of TagTreeScanner. Which is what
I've done with the OWLScribble class, documented along side
TagTreeScanner.

I appreciate all feedback, positive and negative, about the
efficiency of the code, clarity of the documentation, or interface to
the class.
 
T

Takashi Sano

Hi,=20

2005/7/5 said:
From http://phrogz.net/RubyLibs/rdoc/OWLScribble/doc/tts.html:
=20
"The TagTreeScanner class provides a generic framework for creating a
nested hierarchy of tags and text (like XML or HTML) by parsing text.
An example use (and the reason it was written) is to convert a wiki
markup syntax into HTML."
=20

I'm very interested in this library, but where can I download it? It
seems that the link above only takes me to its rdoc. Thanks.

Takashi Sano
 
G

Gavin Kistner

--Apple-Mail-1-536860927
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

I'm very interested in this library, but where can I download it? It
seems that the link above only takes me to its rdoc. Thanks.

Sorry, I should have pointed that out.
The TagTreeScanner.rb page has in its documentation a link to the
TagTreeScanner.rb file, at:
http://phrogz.net/RubyLibs/rdoc/OWLScribble/TagTreeScanner.rb

You can also just browse the directory at:
http://phrogz.net/RubyLibs/rdoc/OWLScribble/

and get at things like test cases.

--Apple-Mail-1-536860927--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top