aboutsummaryrefslogtreecommitdiff
path: root/site/mdoc2html.sh
blob: 4cb718f9d31ec09d1bd023b5bd5aa3322e21f601 (plain)
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
#
# usage: mdoc2html.sh src out
#
# converts the manpage `src' to the HTML file `out', tweaking the
# style

set -e

: ${1:?missing input file}
: ${2:?missing output file}

man -Thtml -l "$1" > "$2"

exec ed "$2" <<EOF
/<style>
a
    body {
        max-width: 960px;
        margin: 0 auto;
        padding: 0 10px;
        font-size: 1rem;
    }

    pre {
        overflow: auto;
    }
.
wq
EOF