Plugins and pluggable markups

3 views
Skip to first unread message

Johan Viklund

unread,
Jun 28, 2009, 2:07:56 PM6/28/09
to novemb...@googlegroups.com
I've been thinking both about how to make plugins work in a sane way
together with the idea of having multiple markups. My proposal for
this is the following.

1. When the markup is parsed a Syntax Tree is created, probably very
similar to a HTML DOM Tree. All calls to plugins from the page is
inserted into the tree where the plugin call was made.

2. The tree is traversed and plugins are called where necessary. There
will be at least three kinds of plugins:

a) Plugins that just add to the syntax tree at the position of the call.
b) Plugins that just add to the syntax tree at the position of the
call but that needs information from the surrounding page (a table of
content would need this).
c) Plugins that change the syntax tree (will of course need the syntax tree).

3. The syntax tree is serialized into the output format (HTML, RSS,
JSON and so forth).


I've been experimenting a little bit in a repo on my own and copied
the minimal markup and made it work with all its tests. I haven't yet
added plugin capability there, but that shouldn't be that difficult.

http://github.com/viklund/mom


I believe this will be quite similar to the Hitomi system as well.

--
Johan Viklund

Carl Mäsak

unread,
Jun 29, 2009, 5:45:10 AM6/29/09
to novemb...@googlegroups.com
Johan (>):

> a) Plugins that just add to the syntax tree at the position of the call.
> b) Plugins that just add to the syntax tree at the position of the
> call but that needs information from the surrounding page (a table of
> content would need this).
> c) Plugins that change the syntax tree (will of course need the syntax tree).

Intriguing. And it's of course for the two latter types that this
extra work is being made? MediaWiki only does the first type of
plugin, as far as I'm aware. The above scheme makes for some
interesting possibilities.

// Carl

raiph

unread,
Jun 29, 2009, 1:38:55 PM6/29/09
to november-wiki
Johan:
> a) Plugins that just add to the syntax tree at the position of the call.
> b) Plugins that just add to the syntax tree at the position of the
> call but that needs information from the surrounding page (a table of
> content would need this).
> c) Plugins that change the syntax tree (will of course need the syntax tree).

Hi Johan,

Hoping I've got the lingo right: what if pages are written in a
suitable Perl 6 slang and plugins are slang augments?

love, raiph
Reply all
Reply to author
Forward
0 new messages