content_processor

Description

These extensions process content, i.e. they either convert data from one format to another or make other changes to the data. Content processors are used, for example, in the transformation pipeline of page and template paths.

It is not specified how content processors have to process the content, they are free to do anything, even binary transformations (e.g. creating a thumbnail from a picture). Each content processor is identified by one or more short names (used, for example, in the pipeline option of a block in a path in Webgen Page Format) which are listed on the documentation page of a content processor.

Information about how to create a content processor is found in the Webgen::ContentProcessor API documentation.

Content processors can be divided into several groups which are shown below.

Special purpose processors

These processors perform very useful tasks which are nearly always used in the transformation pipeline of page/template paths.

content_processor.blocks
Replaces a special xml tag with the rendered block of a node in Webgen Page Format
content_processor.tags
Provides a very easy way for adding dynamic content
content_processor.fragments
Generates fragment nodes from all HTML headers which have an id attribute set
content_processor.html_head
Inserts various HTML tags like links to CSS/Javascript files into the HTML head tag

Markup Processors

These processors convert markup text that is easy to read and write to a more structured format like HTML. This allows you to write an HTML page without knowing HTML.

content_processor.kramdown
Fast superset-of-Markdown to HTML converter
content_processor.maruku
Converts content written in a superset of Markdown to HTML
content_processor.rdiscount
Converts content written in Markdown to HTML
content_processor.rdoc
Converts content written in RDoc markup to HTML
content_processor.redcloth
Converts content written in Textile markup to HTML

Template Engines

These processors are used to add dynamic parts to the processed content.

content_processor.builder
Allows one to programatically create valid XHTML/XML documents
content_processor.erb
Allows one to use ERB (embedded Ruby) in the content
content_processor.erubis
Allows one to use ERB (embedded Ruby) in the content (faster than the erb processor)
content_processor.haml
Allows one to write HTML with the Haml markup language
content_processor.ruby
Generate arbitrary output using plain Ruby

CSS Preprocessors

These processors allow you to write CSS files in an easier way, for example, they allow the usage of variables to avoid spreading the same data over the whole file.

content_processor.sass
Converts content written in the Sass meta language to valid CSS
content_processor.scss
Converts content written in the Sassy CSS language to valid CSS

Post Processors

These processors are used to post-process HTML files.

content_processor.cssminify
Compresses CSS files
content_processor.rainpress
Compresses CSS files
content_processor.tidy
Uses the tidy program to convert the content into valid (X)HTML
content_processor.xmllint
Uses the xmllint program to check the content for well-formedness and/or validness

Other Processors

These processors don’t fit into any of the above categories.

content_processor.tikz
Converts the content (LaTeX TikZ picture commands) into an image