Templates

Template names take the form name.ext.type, where name.ext identifies the name of the output file to be created in the output_directory, and type indicates which language processor to use for the template.

Like with filters, templates may be written in a variety of languages and are based on the standard Unix pipe convention of producing stdout from stdin, but in practice two languages are used more than others:

htmltmpl

Many find htmltmpl easier to get started with as you can take a simple example of your output file, sprinkle in a few <TMPL_VAR>s and <TMPL_LOOP>s and you are done. Eventually, however, you may find that your template involves <TMPL_IF> blocks inside of attribute values, and you may find the result difficult to read and create correctly.

It is also important to note that htmltmpl based templates do not have access to the full set of information available in the feed, just the following (rather substantial) subset:

VARtypesource
authorStringauthor
author_nameStringauthor_detail.name
generatorStringgenerator
idStringid
iconStringicon
last_updated_822Rfc822updated_parsed
last_updated_isoRfc3399updated_parsed
last_updatedPlanetDateupdated_parsed
linkStringlink
logoStringlogo
rightsStringrights_detail.value
subtitleStringsubtitle_detail.value
titleStringtitle_detail.value
title_plainPlaintitle_detail.value
urlStringlinks[rel='self'].href
headers['location']

Note: when multiple sources are listed, the last one wins

In addition to these variables, Planet Venus makes available two arrays, Channels and Items, with one entry per subscription and per output entry respectively. The data values within the Channels array exactly match the above list. The data values within the Items array are as follows:

VARtypesource
authorStringauthor
author_emailStringauthor_detail.email
author_nameStringauthor_detail.name
author_uriStringauthor_detail.href
content_languageStringcontent[0].language
contentStringsummary_detail.value
content[0].value
datePlanetDatepublished_parsed
updated_parsed
date_822Rfc822published_parsed
updated_parsed
date_isoRfc3399published_parsed
updated_parsed
enclosure_hrefStringenclosures[0].href
enclosure_lengthStringenclosures[0].length
enclosure_typeStringenclosures[0].type
guid_isPermaLinkStringisPermaLink
idStringid
linkStringlinks[rel='alternate'].href
new_channelStringid
new_dateNewDatepublished_parsed
updated_parsed
rightsStringrights_detail.value
title_languageStringtitle_detail.language
title_plainPlaintitle_detail.value
titleStringtitle_detail.value
summary_languageStringsummary_detail.language
updatedPlanetDateupdated_parsed
updated_822Rfc822updated_parsed
updated_isoRfc3399updated_parsed
publishedPlanetDatepublished_parsed
published_822Rfc822published_parsed
published_isoRfc3399published_parsed

Note: variables above which start with new_ are only set if their values differ from the previous Item.

xslt

XSLT is a paradox: it actually makes some simple things easier to do than htmltmpl, and certainly can make more difficult things possible; but it is fair to say that many find XSLT less approachable than htmltmpl.

But in any case, the XSLT support is easier to document as the input is a highly normalized feed, with a few extension elements.