Chronicle::Plugin::Filter - Filter individual blog entries.
This plugin is designed to allow blog entries to be filtered via external commands.
This is achieved by opening the specified command and using it as a filter for the entry prior to the insertion into the database.
As an example the following blog-post would be 100% upper-cased:
Title: My Title Date: 10th March 2015 Filter: tr a-z A-Z <p>This is a line of text.</p>
Now follows documentation on the available methods.
The on_insert method is automatically invoked when a new blog post must be inserted into the SQLite database, that might be because a post is new, or because it has been updated.
on_insert
The method is designed to return an updated blog-post structure, after performing any massaging required. If the method returns undef then the post is not inserted.
This plugin will look for a series of headers in the blog-post:
This will be called first.
This will be called in the middle.
This will be called last.
Any such header will be assumed to contain a command that the blog-post should be piped through. The post itself will be replaced with STDOUT from that command.
STDOUT
Because only single headers are examined there can be no more than three filters per-post. This constraint exists for compability purposes.
We want this plugin to be called after the other plugins which filter new entries.
This method is present such that Module::Pluggable::Ordered can order our plugins.
This module is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Perl "Artistic License".
Steve Kemp <steve@steve.org.uk>
To install App::Chronicle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Chronicle
CPAN shell
perl -MCPAN -e shell install App::Chronicle
For more information on module installation, please visit the detailed CPAN module installation guide.