gmid/site/mdoc2html.sh

22 lines
296 B
Bash
Raw Normal View History

2021-10-04 12:42:35 +02:00
#!/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; }
.
wq
EOF