]> git.cameronkatri.com Git - cgit.git/blob - filters/about-formatting.sh
git: update to v2.30.1
[cgit.git] / filters / about-formatting.sh
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 python and markdown-python.
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 "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in
22 *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;;
23 *.rst) exec ./rst2html; ;;
24 *.[1-9]) exec ./man2html; ;;
25 *.htm|*.html) exec cat; ;;
26 *.txt|*) exec ./txt2html; ;;
27 esac