aboutsummaryrefslogtreecommitdiff
path: root/cgit/filters/about.sh
blob: 0236b7efeae880d9ca1931a9b1156b03c61eee03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

case "$(printf '%s' "${1}" | tr '[:upper:]' '[:lower:]')" in
    *.adoc|*.asciidoc)
        exec asciidoctor \
            -S secure \
            -b html5 \
            -a source-highlighter=pygments \
            -a sectlinks \
            -e \
            -o - \
            -
        ;;
    *.md|*.mkd|*.markdown)
        exec cmark-gfm \
            -t html \
            --width 0 \
            --smart \
            -e footnotes \
            -e table \
            -e strikethrough \
            -e autolink \
            -e tagfilter \
            -e tasklist
        ;;
    *)
        exec /usr/lib/cgit/filters/html-converters/txt2html
        ;;
esac