diff options
author | Jason A. Donenfeld | 2013-05-27 21:39:43 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2013-05-27 21:54:16 +0200 |
commit | 8149be213f1c8f52b0dbe6c213f6073af57fa954 (patch) | |
tree | e4d0315f53022bb7335f782ad394d8e7602f1b52 /filters/about-formatting.sh | |
parent | readme: use string_list instead of space deliminations (diff) | |
download | cgit-8149be213f1c8f52b0dbe6c213f6073af57fa954.tar.gz cgit-8149be213f1c8f52b0dbe6c213f6073af57fa954.zip |
filters: import more modern scripts
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'filters/about-formatting.sh')
-rwxr-xr-x | filters/about-formatting.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/filters/about-formatting.sh b/filters/about-formatting.sh new file mode 100755 index 0000000..313a4e6 --- /dev/null +++ b/filters/about-formatting.sh | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # This may be used with the about-filter or repo.about-filter setting in cgitrc. | ||
4 | # It passes formatting of about pages to differing programs, depending on the usage. | ||
5 | |||
6 | # Markdown support requires perl. | ||
7 | # RestructuredText support requires python and docutils. | ||
8 | # Man page support requires groff. | ||
9 | |||
10 | # The following environment variables can be used to retrieve the configuration | ||
11 | # of the repository for which this script is called: | ||
12 | # CGIT_REPO_URL ( = repo.url setting ) | ||
13 | # CGIT_REPO_NAME ( = repo.name setting ) | ||
14 | # CGIT_REPO_PATH ( = repo.path setting ) | ||
15 | # CGIT_REPO_OWNER ( = repo.owner setting ) | ||
16 | # CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) | ||
17 | # CGIT_REPO_SECTION ( = section setting ) | ||
18 | # CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) | ||
19 | |||
20 | cd "$(dirname $0)/html-converters/" | ||
21 | case "$(tr '[:upper:]' '[:lower:]' <<<"$1")" in | ||
22 | *.md|*.mkd) exec ./md2html; ;; | ||
23 | *.rst) exec ./rst2html; ;; | ||
24 | *.[1-9]) exec ./man2html; ;; | ||
25 | *.htm|*.html) exec cat; ;; | ||
26 | *.txt|*) exec ./txt2html; ;; | ||
27 | esac | ||