mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
50b0db0a59
This fixes #1426.
22 lines
466 B
Bash
Executable File
22 lines
466 B
Bash
Executable File
#!/bin/sh
|
|
in=$1
|
|
out=$2
|
|
opts=
|
|
|
|
has() {
|
|
head -n1 $in | grep "$@" >/dev/null
|
|
}
|
|
|
|
has toc && {
|
|
opts="$opts --toc --template=toc-and-body"
|
|
}
|
|
has number-sections && {
|
|
opts="$opts --number-sections"
|
|
}
|
|
|
|
mydir=$(dirname "$0")
|
|
|
|
$mydir/macros.bin -repo $mydir/../.. -elvdoc $mydir/elvdoc.bin < $1 |
|
|
$mydir/highlight.bin |
|
|
pandoc -f gfm+smart+attributes --data-dir=$mydir/pandoc --lua-filter=$mydir/pandoc/header-anchors.lua --metadata title=${1%.md} -o $2 $opts
|