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…
Hobix::BaseOutput class.Hobix::Out module.initialize method, which receives a Hobix::Weblog object of the current weblahhg.extension property, which speaks the letters of the extension to watch for.load method, which supplies the full path of the template file and a Hash containing the weblog, page and entries vars for this page. The load method 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 hobix.yaml.