no more make, no more watch loops
This commit is contained in:
parent
3af586c63a
commit
3677cbb698
4 changed files with 25 additions and 14 deletions
3
Makefile
3
Makefile
|
@ -1,3 +0,0 @@
|
|||
index.html: index.md head.html
|
||||
./bin/mmark-linux-amd64 -head head.html -html index.md > index.html
|
||||
./bin/toc.sh index.html index.md
|
|
@ -44,7 +44,9 @@ fi
|
|||
ts="<\!--ts-->"
|
||||
te="<\!--te-->"
|
||||
|
||||
existingTOC="$(cat "$MARKDOWN" | sed -n "/${ts}/,/${te}/p" | sed '1,1d; $d')"
|
||||
|
||||
if [ "$toc" != "$existingTOC" ]; then
|
||||
tmp="$(mktemp)"
|
||||
function finish {
|
||||
rm "$tmp"
|
||||
|
@ -57,3 +59,4 @@ echo "${toc}" > "${tmp}"
|
|||
$sed "/${ts}/,/${te}/{//!d;}" "$MARKDOWN"
|
||||
# insert toc
|
||||
$sed "/${ts}/r ${tmp}" "$MARKDOWN"
|
||||
fi
|
6
build.sh
Executable file
6
build.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
$DIR/bin/mmark-linux-amd64 -head "$DIR/head.html" -html "$DIR/index.md" > "$DIR/index.html"
|
||||
$DIR/bin/toc.sh "$DIR/index.html" "$DIR/index.md"
|
7
watch.sh
7
watch.sh
|
@ -1,3 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
./bin/reflex --decoration=none --start-service=true --glob='*' --inverse-regex='index\.html' -- sh -c "make"
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
(
|
||||
cd "$DIR"
|
||||
./bin/reflex --decoration=none --start-service=true --glob='*' --inverse-regex='index\.html' -- sh -c "./build.sh"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue