Wiki and Purple Numbering for Movable Type
February 10, 2003
Inspired by the Wiki plugin at 0xDECAFBAD I've done the first steps of a dirty integration between PurpleWiki and MovableType. (00003S)
I had hoped that I would be able to use Movable Type's plugin scheme but in the end I got confused and messed up, so I'm seeking feedback. (00003T)
PurpleWiki is a modification of UseModWiki to support Collab:PurpleNumbers (the marks that should be on the end of each of the structural units of this entry). The marks identify addressable sections of content for more effective referencing and will eventually help transclusion. (00003U)
Source for the parser is available at blueoxen.org. Source for the Movable Type changes are swirling around on my disk trying to settle down. Happy to share upon request. (00003V)
Instead of using the plugins I made changes in MT::Entry::save() and MT::Template::Context::_hdlr_entry_body(): (00003W)
- save() has been modified to take the entry text, parses it to a PurpleWiki::Tree format, adds the purple numbers on nodes without them, serializes the tree as 'wikitext' and saves it. The purple numbers are unique for an established domain. If you look at some of the other PurpleWiki parsed entries in this blog (see the trackbacks) you'll see the numbers are distinct. Eventually it will be possible to have just a domain and a purple number and get stuff via a straightforward retrieval mechanism. (00003X)
- _hdlr_entry_body() has been modified to, if the text contains purple number tags, to parse the wikitext format back to a PurpleWiki::Tree and from there into wikihtml. This does the formatting and also parses for WikiWords. When I was doing some testing with this portion using a filter plugin I ran into trouble because the test had already had some htmlification done to it before I had a chance to pass it to the parser. (00003Y)
What I would like to know from anyone who cares to answer: Can I move these functions into plugins, or am I stuck in the bowels of MT? If you don't know the answer but know how to find out, that would be helpful too. Thanks. (00003Z)
Comments
two thoughts. no, three. (0000LQ)
1) Use the plugin API. Others beyond MT will be adopting it as a blog and CMS extensibility standard. (0000LR)
2) seek dev help here: (0000LS)
http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3e483ba93c03ffff;act=SF;f=20 (0000LT)
(that's the plugins dev forum at MT's fora site - believe it or not, you'll find many experienced developers there - even highly perl-centric ones - and I believe you may feel it's worthwhile) (0000LU)
3) modding the guts of MT causes several problems in the long run. the most prominent is that since it's not classic open-source, mods don't even lead to forks, they just get overwritten by the next install. The next most prominent is that it drastically limits the userbase of the mad, both by strategic thinkes who see the problem above and by non-tech folk who fear the tinkering. (0000LV)
You can do it sir! (0000LW)
Geez, that's not what I think of as a helpful response over there. (0000LX)
http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3e4a8e542d8bffff;act=ST;f=20;t=14264 (0000LY)
Try requesting an informed opinion from this gent: (0000LZ)
http://bradchoate.com/ (0000M0)
who has done lots with perl-based plugins. (0000M1)
and then follow up in your post - cutting and pasting from here, otherwise people won't believe that you are serious about whnting help - with an explicit request for an opinion from Ben Trott, the lead dev guy on MT. He almost always responds. (0000M2)
Tom Munnecke has done something similar.
What Tom's doing is just putting purple numbers per entry. That's interesting, but the permalink already provides that function.
What I'm after is the granular addressibility that comes with purple numbers. I want to be able to make reference directly to structural elements within entries, like this:
http://www.burningchrome.com:8000/~cdent/Space.cgi/00004A
Or view it out of context, like this:
http://www.burningchrome.com:8000/~cdent/Space.cgi/00004A/c
Or eventually transclude it, like this:
http://www.burningchrome.com:8000/~cdent/Space.cgi/00004A/t
Granular accessibility is what I'm after.
Hi Chris,
Just wondering if you'd had chance to get any further with this - I've been looking at inserting full-content into feeds, I don't really like it but there may be some hidden benefits if purple numbers are thrown into the mix.
(still catching up with Oxen list - good piece btw)
Have you tried this: http://purpleslurple.net/ps.php?theurl=http://www.burningchrome.com:8000/~cdent/mt/archives/000034.html (0000LK)
(kidding ;) (0000LL)
Matt (0000LM)
Matthew: You know what I'm going to say to that :)
While PurpleSlurple is awesome for static content, it doesn't work out so well for content that is likely to change (like Wikis or Blogs).
Purple Wiki comments test.
HEAD 2
PurpleWiki link.
Not quite. (0000LI)
Does this get the numbers? Let's see. (0000LJ)