[typo] TextFilters: Post Processors vs. Macros
ryanabrams at gmail.com
Fri Aug 26 16:17:20 EDT 2005
How is the new text filter plugins thing architected? As far as I can
tell, there are three types of plugins: Macros, Markup, and Post
Macros have a tag like <typo:something> and accept parameters via the
tag. This is useful for things like flickr and sparklines. These apply
across ALL filters, and cannot be disabled short of removing them from
the app itself.
Markup plugins are things like Markdown and Textile. You choose ONE
and only one of these when creating a filter.
Post Processors are tags that are enabled or disabled by filter.
Things like SmartyPants and Amazon. Some of them accept parameters in
the filter config (i.e. Amazon referral ID) and in the tag (i.e.
Amazon item ID).
My main question is how Macros and Post Processors differ enough to be
treated differently... why is there a distinction? Why can't i disable
flickr parsing for one filter type but not another? Why is it ok that
the amazon plugin uses an <amazon:ISSN> tag instead of
<typo:amazon>ISSN</typo:amazon>? What is the concept there?
The reason I ask is that I am working on a "review" plugin. I want to
be able to write something like
<typo:review type="Film" title="Fight Club" amazon="1FA33029"
imdb="443442" rating="4.5" img="fightclubcover.jpg" />
and have it parse that out into a nice, well laid out summary box that
goes wherever that tag is.
I've already created a plugin that works like the amazon one, and
replaces <review:4star> with an image of four stars. That was straight
forward. But now that I want to get more complex, I think maybe it
should be a Macro instead. But I don't really understand why the two
are separate in the first place.
More information about the Typo-list