2020-11-23 03:55:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
DIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
. "$DIR/../env.sh"
|
|
|
|
|
|
|
|
|
|
|
|
# install cmark-gfm: convert markdown to html,man,xml,latex,comman-mark
|
|
|
|
case "$PM" in
|
|
|
|
apt)
|
2020-11-23 04:12:55 +00:00
|
|
|
sudo apt install -y cmark-gfm entr
|
2020-11-23 03:55:55 +00:00
|
|
|
;;
|
|
|
|
pacman)
|
2020-11-23 04:12:55 +00:00
|
|
|
sudo pacman -S --noconfirm --needed cmark-gfm entr
|
2020-11-23 03:55:55 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-11-23 04:12:55 +00:00
|
|
|
# live server for html previewing
|
|
|
|
. "$PDIR/devel/nodejs.sh"
|
|
|
|
sudo $NPM_BIN install -g live-server
|
|
|
|
|
|
|
|
# convert to html with embeded <style>: cmark-gfm input.md --to html --unsafe > /path/to/output.html
|
|
|
|
# entr watch input.md and rerun convert command
|
|
|
|
# live-server to observe html file and reload browser
|
|
|
|
|