module Webgen::ContentProcessor::Blocks

Replaces special XML tags with the rendered content of a node block.

The module provides a ::call method so that it can be used by the content processor extension. However, it also provides the ::render_block method that contains the actual logic for rendering a block of a node given a render context.

Public Class Methods


Replace the webgen:block xml tags with the rendered content of the specified node.

render_block(context, options)

Render a block of a page node and return the result.

The Webgen::Context object context is used as the render context and the options hash needs to hold all relevant information, that is:

:name (mandatory)

The name of the block that should be used.


The node chain used for rendering. If this is not specified, the node chain from the context is used. It needs to be a String in the format '(A)LCN;(A)LCN;…' or an array of nodes.


Defines which node in the node chain should be used. Valid values are next (= default value; the next node in the node chain), first (the first node in the node chain with a block called name) or current (the currently rendered node, ignores the chain option).


If this property is set to ignore, a missing block will not raise an error. It is unset by default, so missing blocks will raise errors.