Using different content-types in PubTal.
PubTal supports several different content types, i.e. different ways of writing web page content. Support for additional content types can be added using Plugins.
All content types except Binary have support for name-value pairs, or headers, at the start of the file. An unlimited number of headers can be defined, or none at all. The body of the content must be separated from the headers with a single blank line (including when no headers are used).
An example of some headers:
title: This is a test
description: Two test headers.
This is the body of the page.
The HTMLText content type will have paragraph tags (<p>) and newline tags (<br>) automatically added to it by PubTal. The rest of the markup is written in ordinary HTML, for example <b> tags for bold, and <a> for links.
If the template's output-type is set to 'HTML' then newlines will be replaced with <br> tags. If XHTML is set then <br /> tags will be used instead. It is up to the author of the content to use the correct HTML/XHTML tags in the main content.
The Catalogue content type allows for collections of items (e.g. photos) to be organised with a master index page and individual pages for each item in the collection. Details on how to use the Catalogue content type can be found in the section Using Catalogues.
The raw content type is similar to the HTMLText type, except that no new tags are added to the PubTal output, and so the author must enter all tags manually. For example:
title: Raw content test
<p>This is the first paragraph - note the tags!</p>
<p>And this is the second paragraph.</p>
The Binary content type does a straight copy of the content file to the destination directory, creating any required directories. No parsing of the content file is done and no template is used.
PubTal supports the use of OpenOffice word processing files (.sxw) for web page content. Only a subset of the OpenOffice document features are supported:
When publishing OpenOffice documents PubTal provides additional context to the template used:
There are several tricks to making best use of OpenOffice for editing PubTal content. Bear these in mind and OpenOffice can provide an excellent environment for writing web content, certainly superiour to writing pages in a text editor.
Tables in OpenOffice provide optional support for a heading row. PubTal will convert these into <th> HTML tags, which allows a different style to be applied to the heading cells and the body cells. To instruct OpenOffice to use a heading row select the "Header" option in the Insert Table dialog. If a table is generating only <td> tags then it's headers have become disabled - highlight the whole table and select "Split Table" to enable them.
To use a URL to link to another document on the same website (a relative link) the OpenOffice "Document" hyperlink option must be used, not the "Internet" option. This is because OpenOffice treats all links entered using the "Internet" panel of the Hyperlink dialog as being absolute addresses (fine for external links). To check that the correct type of link has been created enable the Hyperlink Bar using "View -> Toolbars -> Hyperlink Bar". If the hyperlink you have entered beging with 'file://' then it is a relative link, otherwise it is an absolute link.
PubTal Version 2.0