From 3e1c9bcb3eceec96005e6ed939fd16a769314ab8 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sat, 14 Apr 2007 10:04:22 -0400 Subject: [PATCH] Output filters --- docs/config.html | 4 ++++ docs/filters.html | 18 +++++++++++------- planet/shell/__init__.py | 3 ++- planet/shell/tmpl.py | 13 ++++++++----- planet/splice.py | 18 +++++++++++++++++- tests/data/apply/config-filter.ini | 21 +++++++++++++++++++++ tests/data/apply/rebase.py | 24 ++++++++++++++++++++++++ tests/test_apply.py | 8 ++++++++ 8 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 tests/data/apply/config-filter.ini create mode 100644 tests/data/apply/rebase.py diff --git a/docs/config.html b/docs/config.html index abb3f19..4a08ed7 100644 --- a/docs/config.html +++ b/docs/config.html @@ -68,6 +68,9 @@ can be found
filters
Space-separated list of filters to apply to each entry
+
filter_directories
+
Space-separated list of directories in which filters +can be found
@@ -148,6 +151,7 @@ processed as templates. With Planet 2.0, it is possible to override parameters like items_per_page on a per template basis, but at the current time Planet Venus doesn't implement this.

+

Filters can be defined on a per-template basis, and will be used to post-process the output of the template.

[filter]

Sections which are listed in [planet] filters are diff --git a/docs/filters.html b/docs/filters.html index 865aa41..425d189 100644 --- a/docs/filters.html +++ b/docs/filters.html @@ -15,11 +15,13 @@ Anything written to stderr is logged as an ERROR message. If no stdout is produced, the entry is not written to the cache or processed further; in fact, if the entry had previously been written to the cache, it will be removed.

-

Input to a filter is a aggressively +

There are two types of filters supported by Venus, input and template.

+

Input to an input filter is a aggressively normalized entry. For example, if a feed is RSS 1.0 with 10 items, the filter will be called ten times, each with a single Atom 1.0 entry, with all textConstructs expressed as XHTML, and everything encoded as UTF-8.

+

Input to a template filter will be the output produced by the template.

You will find a small set of example filters in the filters directory. The

Notes