From 0ee035d4ec40f2308e99ab6d450cf606deadef17 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 3 Jul 2018 21:02:15 +0200 Subject: Rename about-filter to render-filter Signed-off-by: Jason A. Donenfeld --- cgit.c | 6 +++--- cgitrc.5.txt | 8 ++++---- filters/about-formatting.sh | 27 --------------------------- filters/render-formatting.sh | 27 +++++++++++++++++++++++++++ tests/setup.sh | 4 ++-- ui-summary.c | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) delete mode 100755 filters/about-formatting.sh create mode 100755 filters/render-formatting.sh diff --git a/cgit.c b/cgit.c index e2d7891..2ef1b71 100644 --- a/cgit.c +++ b/cgit.c @@ -96,7 +96,7 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va else if (!strcmp(name, "ignore")) repo->ignore = atoi(value); else if (ctx.cfg.enable_filter_overrides) { - if (!strcmp(name, "about-filter")) + if (!strcmp(name, "render-filter")) repo->about_filter = cgit_new_filter(value, ABOUT); else if (!strcmp(name, "commit-filter")) repo->commit_filter = cgit_new_filter(value, COMMIT); @@ -205,7 +205,7 @@ static void config_cb(const char *name, const char *value) ctx.cfg.cache_snapshot_ttl = atoi(value); else if (!strcmp(name, "case-sensitive-sort")) ctx.cfg.case_sensitive_sort = atoi(value); - else if (!strcmp(name, "about-filter")) + else if (!strcmp(name, "render-filter")) ctx.cfg.about_filter = cgit_new_filter(value, ABOUT); else if (!strcmp(name, "commit-filter")) ctx.cfg.commit_filter = cgit_new_filter(value, COMMIT); @@ -816,7 +816,7 @@ static void print_repo(FILE *f, struct cgit_repo *repo) fprintf(f, "repo.enable-log-linecount=%d\n", repo->enable_log_linecount); if (repo->about_filter && repo->about_filter != ctx.cfg.about_filter) - cgit_fprintf_filter(repo->about_filter, f, "repo.about-filter="); + cgit_fprintf_filter(repo->about_filter, f, "repo.render-filter="); if (repo->commit_filter && repo->commit_filter != ctx.cfg.commit_filter) cgit_fprintf_filter(repo->commit_filter, f, "repo.commit-filter="); if (repo->source_filter && repo->source_filter != ctx.cfg.source_filter) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 6b4efa2..f7924fa 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -26,7 +26,7 @@ defined, use its value instead. GLOBAL SETTINGS --------------- -about-filter:: +render-filter:: Specifies a command which will be invoked to format the content of about pages (both top-level and for each repository). The command will get the content of the about-file on its STDIN, the name of the file @@ -449,8 +449,8 @@ virtual-root:: REPOSITORY SETTINGS ------------------- -repo.about-filter:: - Override the default about-filter. Default value: none. See also: +repo.render-filter:: + Override the default render-filter. Default value: none. See also: "enable-filter-overrides". See also: "FILTER API". repo.branch-sort:: @@ -877,7 +877,7 @@ source-filter=/var/www/cgit/filters/syntax-highlighting.py # Format markdown, restructuredtext, manpages, text files, and html files # through the right converters -about-filter=/var/www/cgit/filters/about-formatting.sh +render-filter=/var/www/cgit/filters/about-formatting.sh ## ## Search for these files in the root of the default branch of repositories diff --git a/filters/about-formatting.sh b/filters/about-formatting.sh deleted file mode 100755 index 85daf9c..0000000 --- a/filters/about-formatting.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# This may be used with the about-filter or repo.about-filter setting in cgitrc. -# It passes formatting of about pages to differing programs, depending on the usage. - -# Markdown support requires python and markdown-python. -# RestructuredText support requires python and docutils. -# Man page support requires groff. - -# The following environment variables can be used to retrieve the configuration -# of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) - -cd "$(dirname $0)/html-converters/" -case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in - *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; - *.rst) exec ./rst2html; ;; - *.[1-9]) exec ./man2html; ;; - *.htm|*.html) exec cat; ;; - *.txt|*) exec ./txt2html; ;; -esac diff --git a/filters/render-formatting.sh b/filters/render-formatting.sh new file mode 100755 index 0000000..a223452 --- /dev/null +++ b/filters/render-formatting.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# This may be used with the render-filter or repo.render-filter setting in cgitrc. +# It passes formatting of about pages to differing programs, depending on the usage. + +# Markdown support requires python and markdown-python. +# RestructuredText support requires python and docutils. +# Man page support requires groff. + +# The following environment variables can be used to retrieve the configuration +# of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + +cd "$(dirname $0)/html-converters/" +case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; + *.rst) exec ./rst2html; ;; + *.[1-9]) exec ./man2html; ;; + *.htm|*.html) exec cat; ;; + *.txt|*) exec ./txt2html; ;; +esac diff --git a/tests/setup.sh b/tests/setup.sh index 7590f04..1f3c0b4 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -134,7 +134,7 @@ repo.desc=spaced repo repo.url=filter-exec repo.path=$PWD/repos/filter/.git repo.desc=filtered repo -repo.about-filter=exec:$FILTER_DIRECTORY/dump.sh +repo.render-filter=exec:$FILTER_DIRECTORY/dump.sh repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh @@ -146,7 +146,7 @@ EOF repo.url=filter-lua repo.path=$PWD/repos/filter/.git repo.desc=filtered repo -repo.about-filter=lua:$FILTER_DIRECTORY/dump.lua +repo.render-filter=lua:$FILTER_DIRECTORY/dump.lua repo.commit-filter=lua:$FILTER_DIRECTORY/dump.lua repo.email-filter=lua:$FILTER_DIRECTORY/dump.lua repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua diff --git a/ui-summary.c b/ui-summary.c index 8e81ac4..d643c9d 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -129,7 +129,7 @@ void cgit_print_repo_readme(char *path) } /* Print the calculated readme, either from the git repo or from the - * filesystem, while applying the about-filter. + * filesystem, while applying the render-filter. */ html("
"); cgit_open_filter(ctx.repo->about_filter, filename); -- cgit v1.2.3-18-g5258