diff options
| -rw-r--r-- | .Xresources | 3 | ||||
| -rw-r--r-- | .bashrc | 2 | ||||
| -rwxr-xr-x | .vim/pack/mvertes/install.sh | 2 | ||||
| -rwxr-xr-x | bin/wag | 44 |
4 files changed, 50 insertions, 1 deletions
diff --git a/.Xresources b/.Xresources index ec47c2e..274ee87 100644 --- a/.Xresources +++ b/.Xresources @@ -13,7 +13,8 @@ URxvt.cursorColor: red Urxvt.font: 6x13 !URxvt.font: xft:Mono:size=12 !URxvt.font: xft:Mono:size=10 -URxvt.letterSpace: -1 +!URxvt.letterSpace: 0 +URxvt.letterSpace: 0 URxvt.perl-ext-common: font-size URxvt.keysym.C-Prior: font-size:increase URxvt.keysym.C-Next: font-size:decrease @@ -145,3 +145,5 @@ meteo() { eval "$(direnv hook bash)" #export GITHUB_TOKEN=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 + +set -o vi diff --git a/.vim/pack/mvertes/install.sh b/.vim/pack/mvertes/install.sh index 48d5950..90cd4b3 100755 --- a/.vim/pack/mvertes/install.sh +++ b/.vim/pack/mvertes/install.sh @@ -5,6 +5,8 @@ git@github.com:mvertes/vimki git@github.com:fatih/vim-go git@github.com:othree/xml.vim git@github.com:junegunn/fzf.vim +git@github.com:mattn/libcallex-vim +git@github.com:bytesnake/vim-graphical-preview ' ht='test -d doc && vim -c "helptags doc" -c "q"' @@ -1,6 +1,8 @@ #!/bin/sh ## wag is a tool to generate static web sites +## +## Commands: unset CDPATH export LC_ALL=C IFS='
@@ -8,6 +10,48 @@ export LC_ALL=C IFS=' cmd=$(command -v "$0") +dest=./public + +footer() { + : +} + +# front parses front matter +front() { + { + read a b && [ "$a" = "---" ] && [ "$b" = "" ] || return + while read a b; do + [ "$a" = "---" ] && [ "$b" = "" ] && break + eval "front_${a%:}=\"$b\"" + done + } < "$1" +} + +## gen generates site content from source files +gen() { + [ -d "$dest" ] || mkdir -p "$dest" + for f in *.md; do + [ "$f" = "*.md" ] && continue + g="$dest/${f%.md}.html" + [ "$f" -ot "$g" ] && continue + echo "f: $f $g" + front "$f" + { + header + md2html "$f" + footer + } > "$g" + done +} + +header() { + cat <<- EOT + <title>$front_title</title> + <meta charset="utf-8"> + <style>body {max-width: 52em; margin: 1em auto; padding: 1em}</style> + EOT +} + ## help prints this program documentation help() { awk '/^## / {print substr($0, 4)}' "$cmd"; } |
