mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
072677351b
Assignment using "foo = bar" instead of "var foo = bar" or "set foo = bar" is not yet deprecated, but will be soon. This addresses #645.
23 lines
410 B
Bash
Executable File
23 lines
410 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/elvdoc.bin -filter < $1 |
|
|
$mydir/highlight.bin |
|
|
$mydir/macros.bin |
|
|
pandoc -f gfm+smart+attributes --data-dir=$mydir/pandoc-data --metadata title=${1%.md} -o $2 $opts
|