diff options
| -rw-r--r-- | default.html.do | 8 | ||||
| -rw-r--r-- | default.nix | 12 | ||||
| -rwxr-xr-x | do' | 3 | ||||
| -rw-r--r-- | lists/default.md.do | 6 |
4 files changed, 15 insertions, 14 deletions
diff --git a/default.html.do b/default.html.do index da9d0b2..e900e4a 100644 --- a/default.html.do +++ b/default.html.do | |||
| @@ -1,12 +1,8 @@ | |||
| 1 | redo-ifchange $2.md build/tex-filter.hs build/template.html5 | 1 | redo-ifchange $2.md build/tex-filter.hs build/template.html5 |
| 2 | 2 | ||
| 3 | texfilter() { | ||
| 4 | runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ 2>/dev/null | ||
| 5 | } | ||
| 6 | |||
| 7 | CSS=/style.css | 3 | CSS=/style.css |
| 8 | 4 | ||
| 9 | pandoc -t json $2.md | texfilter "$(pwd)" \ | 5 | pandoc -t json $2.md | build/tex-filter.hs "$(pwd)" \ |
| 10 | | while read -r x; do | 6 | | while read -r x; do |
| 11 | [[ -z "${x}" ]] && continue | 7 | [[ -z "${x}" ]] && continue |
| 12 | echo $x/image.svg | 8 | echo $x/image.svg |
| @@ -15,5 +11,5 @@ pandoc -t json $2.md | texfilter "$(pwd)" \ | |||
| 15 | | xargs -d '\n' redo-ifchange | 11 | | xargs -d '\n' redo-ifchange |
| 16 | 12 | ||
| 17 | pandoc -S -f markdown -t json $2.md \ | 13 | pandoc -S -f markdown -t json $2.md \ |
| 18 | | texfilter "$(pwd)" \ | 14 | | build/tex-filter.hs "$(pwd)" \ |
| 19 | | pandoc --template=build/template.html5 --base-header-level=3 --standalone --email-obfuscation=none -f json -t html5 -c $CSS >$3 2>/dev/null | 15 | | pandoc --template=build/template.html5 --base-header-level=3 --standalone --email-obfuscation=none -f json -t html5 -c $CSS >$3 2>/dev/null |
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4b377cb --- /dev/null +++ b/default.nix | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | let | ||
| 2 | pkgs = import <nixpkgs> {}; | ||
| 3 | stdenv = pkgs.stdenv; | ||
| 4 | hs = pkgs.haskellPackages; | ||
| 5 | in rec { | ||
| 6 | blogEnv = stdenv.mkDerivation rec { | ||
| 7 | name = "blog-env"; | ||
| 8 | version = "1"; | ||
| 9 | src = ./.; | ||
| 10 | buildInputs = [ hs.pandoc hs.pandocTypes hs.cryptohash hs.strict ]; | ||
| 11 | }; | ||
| 12 | } | ||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/zsh | ||
| 2 | |||
| 3 | exec env PATH="$PATH:$(pwd)/.cabal-sandbox/bin" ./do $@ | ||
diff --git a/lists/default.md.do b/lists/default.md.do index 121955e..55abe6f 100644 --- a/lists/default.md.do +++ b/lists/default.md.do | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
| 2 | redo-ifchange "$2/title" | 2 | redo-ifchange "$2/title" |
| 3 | 3 | ||
| 4 | extracttitle() { | ||
| 5 | runhaskell -package-conf=$(find ../.cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) ../build/extract-title.hs $@ 2>&1 | grep 'title: ' | cut -d ' ' -f '2-' | ||
| 6 | } | ||
| 7 | |||
| 8 | POSTS=() | 4 | POSTS=() |
| 9 | while read -r -d $'\0'; do | 5 | while read -r -d $'\0'; do |
| 10 | post=$(realpath --relative-to=. "$REPLY") | 6 | post=$(realpath --relative-to=. "$REPLY") |
| @@ -24,7 +20,7 @@ EOF | |||
| 24 | 20 | ||
| 25 | POST_TITLES=() | 21 | POST_TITLES=() |
| 26 | for x in "${POSTS[@]}"; do | 22 | for x in "${POSTS[@]}"; do |
| 27 | title=$(pandoc -t json "$x" | extracttitle) | 23 | title=$(pandoc -t json "$x" | ../build/extract-title.hs) |
| 28 | POST_TITLES+=("$title") | 24 | POST_TITLES+=("$title") |
| 29 | done | 25 | done |
| 30 | 26 | ||
