[PATCH v3 4/4] filters: document environment variables in filter scripts

Lars Hjemli hjemli at gmail.com
Thu Mar 10 16:37:09 CET 2011


On Wed, Mar 9, 2011 at 09:13, Ferry Huberts <mailings at hupie.com> wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
>
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
>  cgitrc.5.txt                   |   45 +++++++++++++++++++++++++++++++++++----
>  filters/commit-links.sh        |   11 +++++++++
>  filters/syntax-highlighting.sh |   11 +++++++++
>  3 files changed, 62 insertions(+), 5 deletions(-)
>
> diff --git a/cgitrc.5.txt b/cgitrc.5.txt
> index c3698a6..369daf5 100644
> --- a/cgitrc.5.txt
> +++ b/cgitrc.5.txt
> @@ -31,7 +31,7 @@ about-filter::
>        about pages (both top-level and for each repository). The command will
>        get the content of the about-file on its STDIN, and the STDOUT from the
>        command will be included verbatim on the about page. Default value:
> -       none.
> +       none. See also: "FILTER API".
>
>  agefile::
>        Specifies a path, relative to each repository path, which can be used
> @@ -81,6 +81,7 @@ commit-filter::
>        The command will get the message on its STDIN, and the STDOUT from the
>        command will be included verbatim as the commit message, i.e. this can
>        be used to implement bugtracker integration. Default value: none.
> +       See also: "FILTER API".
>
>  css::
>        Url which specifies the css document to include in all cgit pages.
> @@ -316,7 +317,7 @@ source-filter::
>        and the name of the blob as its only command line argument. The STDOUT
>        from the command will be included verbatim as the blob contents, i.e.
>        this can be used to implement e.g. syntax highlighting. Default value:
> -       none.
> +       none. See also: "FILTER API".
>
>  summary-branches::
>        Specifies the number of branches to display in the repository "summary"
> @@ -349,7 +350,7 @@ REPOSITORY SETTINGS
>  -------------------
>  repo.about-filter::
>        Override the default about-filter. Default value: none. See also:
> -       "enable-filter-overrides".
> +       "enable-filter-overrides". See also: "FILTER API".
>
>  repo.clone-url::
>        A list of space-separated urls which can be used to clone this repo.
> @@ -357,7 +358,7 @@ repo.clone-url::
>
>  repo.commit-filter::
>        Override the default commit-filter. Default value: none. See also:
> -       "enable-filter-overrides".
> +       "enable-filter-overrides". See also: "FILTER API".
>
>  repo.defbranch::
>        The name of the default branch for this repository. If no such branch
> @@ -428,7 +429,7 @@ repo.section::
>
>  repo.source-filter::
>        Override the default source-filter. Default value: none. See also:
> -       "enable-filter-overrides".
> +       "enable-filter-overrides". See also: "FILTER API".
>
>  repo.url::
>        The relative url used to access the repository. This must be the first
> @@ -448,6 +449,40 @@ Note: the "repo." prefix is dropped from the option names in repo-specific
>  config files, e.g. "repo.desc" becomes "desc".
>
>
> +FILTER API
> +----------
> +- about filter::
> +  This filter is given no arguments.
> +  The about text that is to be filtered is available on standard input and the
> +  filtered text is expected on standard output.
> +- commit filter::
> +  This filter is given no arguments.
> +  The commit message text that is to be filtered is available on standard input
> +  and the filtered text is expected on standard output.

Nice.

> +- source filter::
> +  This filter is given a single parameter: the filename of the source file to
> +  filter. The filtered source file is expected in the same file when the filter
> +  exits.

Actually, the file content comes through stdin and is piped to stdout.
The filename argument is supposed to help the filter determine what
kind of syntax highlighting to produce (I'll fix this up before
committing).

Thanks.

-- 
larsh




More information about the CGit mailing list