summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.html.do8
-rw-r--r--default.nix12
-rwxr-xr-xdo'3
-rw-r--r--lists/default.md.do6
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 @@
1redo-ifchange $2.md build/tex-filter.hs build/template.html5 1redo-ifchange $2.md build/tex-filter.hs build/template.html5
2 2
3texfilter() {
4 runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ 2>/dev/null
5}
6
7CSS=/style.css 3CSS=/style.css
8 4
9pandoc -t json $2.md | texfilter "$(pwd)" \ 5pandoc -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
17pandoc -S -f markdown -t json $2.md \ 13pandoc -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 @@
1let
2 pkgs = import <nixpkgs> {};
3 stdenv = pkgs.stdenv;
4 hs = pkgs.haskellPackages;
5in 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}
diff --git a/do' b/do'
deleted file mode 100755
index 1c3cc95..0000000
--- a/do'
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/zsh
2
3exec 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
2redo-ifchange "$2/title" 2redo-ifchange "$2/title"
3 3
4extracttitle() {
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
8POSTS=() 4POSTS=()
9while read -r -d $'\0'; do 5while read -r -d $'\0'; do
10 post=$(realpath --relative-to=. "$REPLY") 6 post=$(realpath --relative-to=. "$REPLY")
@@ -24,7 +20,7 @@ EOF
24 20
25POST_TITLES=() 21POST_TITLES=()
26for x in "${POSTS[@]}"; do 22for 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")
29done 25done
30 26