Plugins are still basically in utter disarray. Naw, they’re not bad. But I’m not going to detail too much yet. I’ll give you a taste of the output plugins and that’s it.
An output plugin allow you to add new template types. Hobix comes with output plugins for ERB, RSS and !okay/news. But you can easily hack in your own types of templates.
We’ll look at the default RSS plugin as an example.
Each output plugin is a class. A basic output class looks like:
module Hobix module Out class RSS < Hobix::BaseOutput def initialize( weblog ); end def extension; "rss"; end def load( template_path, vars ); end end end end
So here’s the rules: all output plugins…
initializemethod, which receives a
Hobix::Weblogobject of the current weblahhg.
extensionproperty, which speaks the letters of the extension to watch for.
loadmethod, which supplies the full path of the template file and a Hash containing the weblog, page and entries vars for this page. The
loadmethod must process the template and return a string with the new file to create.
To load plugins for a websiihtt, add the library path the the
requires list in your the blahhhg’s