[MKDoc-dev] Client-specific Plugins
Bruno Postle
bruno at mkdoc.com
Mon Jan 31 11:42:57 GMT 2005
On Sun 30-Jan-2005 at 15:43 -0500, Sam Tregar wrote:
> I'm working on a client-specific registration system and I
> want to make sure I'm doing things the right way.
I'll try and explain the system we have for customising MKDoc,
though 1.8 has much more support for this kind of thing.
In 1.6 there is a template inheritance scheme. This doesn't have a
name or much documentation, but Petal allows any template or range
of templates to be overriden.
For example, if you want to customise the
$MKDOC_DIR/templates/document/foo/ template, you don't have to
change anything in the MKDoc source, just copy it to
$SITE_DIR/resources/templates/document/foo/ and edit it in place.
There is no need to restart apache to see template changes. All the
emails are templated in this way too.
The way to load plugins is to create a custom {www,users}.conf file
and change the plugin list to disable or enable whatever plugins you
like - plugins are just normal perl modules in the perl path.
With 1.8 the system is more extensive, the idea is that you
start-off with MKDoc::Core, which does little other than manage the
loading of plugins and Petal templates:
perl -MMKDoc::Setup -e mockup
An add-on installs much like any other perl module:
perl Makefile.PL && make test && make install
All the detail for configuring that plugin, installing sites,
whatever you need, is then invoked like so:
perl -MMy::Custom::Stuff -e do_stuff
So with MKDoc-1.8, the CMS is just another plugin. Though the rump
of it hasn't yet been refactored to this new system - 1.8 is still
very much unfinished.
--
Bruno
More information about the MKDoc-dev
mailing list