Description | A static content generator. |
Newcomen::Manual::Hooks - Hooks to be implemented by plugins.
The following is a complete list of hooks plugins may implement. The hooks are run in the order they are listed below.
Note: In the following description, the term standard hook simply means that this hook is called without any parameters and its return value will be ignored.
For filter hooks, parameters and behaviour are described below. Please see Newcomen::Plugins' run_filter() method for more information.
Standard hooks.
Standard hook.
Called without any parameters. This hook must return a list of Newcomen::Source instances, or an empty list. All sources returned will be added automatically to the global Newcomen::Crawler instance.
Standard hook.
Standard hook.
Filter hooks. These hooks will be called for every Newcomen::Source instance of the global Newcomen::Crawler instance. The source instance will be supplied as the only parameter. If one filter hook returns a false value for a source instance, this source instance will be removed from the global crawler instance.
Standard hook.
Standard hook.
Called without any parameters. This hook must return a list of Newcomen::Collection instances, or an empty list. All instances returned will be added to global Newcomen::Catalog instance.
Standard hook.
Standard hook.
Filter hook. This hook will be called with three parameters: An Newcomen::Source instance, an Newcomen::Collection instance and an integer (in that order). The collection instance contains the source instance at the position specified by the third parameter. If the hook returns a false value, the source instance will be removed from the collection.
Standard hook.
Standard hook.
Filter hooks. These hooks will be called with an Newcomen::Collection instance as the only parameter. If a hook returns a false value for a collection, the collection will be removed from the global Newcomen::Catalog instance.
Standard hook.
Standard hook.
Called without any parameters. This hook must return a list of Newcomen::Page instances, or an empty list. Every instance returned will be added to the global Newcomen::Site instance.
This hook is called every time a new Newcomen::Page instance is created. It will be called with two parameters: the first parameter is the current page target, the second specifies the creator ID of the page. Both are strings. The hook must return a string, specifying the (possibly rewritten) page target. These hooks will be chained, so every hook_rewrite_target() method implemented by a plugin will see the return value of the previous hook_rewrite_target() hook of another plugin as first parameter (except the first hook called, obviously). The return value of the last hook will then be used as the page target for the new Newcomen::Page instance.
Standard hook.
Standard hook.
Filter hooks. These hooks will be called with an Newcomen::Page instance as the only parameter. If a hook returns a false value for a page instance, this instance will be removed from the global Newcomen::Site instance.
Standard hook.
Standard hook.
This hook will be called with three parameters: an Newcomen::Content instance, an Newcomen::Page instance and an integer, in that order. The integer specifies the index of the content instance in the page instance. The hook should set formatters for the content instance as required. Once all plugins implementing this hook have been called for a specific content instance, this content instance will automatically be formatted.
Standard hook.
Standard hook.
This hook will be called for every page of the global Newcomen::Site instance with one parameter: an Newcomen::Page instance. The hook should set the renderer for the page. Once the hooks of all plugins have been called for a page instance, this page will be rendered automatically.
Standard hook.
Standard hook.
Similar to the hook_renderer() hook, this hook will be called for every page of the global Newcomen::Site instance with one parameter: an Newcomen::Page instance. The hook should set the writer for the page. Once the hooks of all plugins have been called for a page instance, this page will be written by the writer backend automatically.
Standard hook.
Standard hooks.
Standard hooks.
This is version 2014052501
.
Stefan Goebel - newcomen {at} subtype {dot} de
Copyright 2013-2014 Stefan Goebel.
This file is part of Newcomen.
Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.
Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.