use redo
Signed-off-by: Christine Dodrill <me@christine.website>
This commit is contained in:
parent
c6eb3fa975
commit
b7434d1894
6
.gitignore
vendored
6
.gitignore
vendored
@ -1 +1,5 @@
|
|||||||
result
|
result
|
||||||
|
*.epub
|
||||||
|
*.mobi
|
||||||
|
*.pdf
|
||||||
|
.redo
|
||||||
|
11
default.epub.do
Normal file
11
default.epub.do
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
DEPS="$(ls ./src/**/*.md | grep -v plans)"
|
||||||
|
|
||||||
|
redo-ifchange $DEPS ./src/style.css ./src/pagebreak.lua ./src/title.txt
|
||||||
|
|
||||||
|
pandoc \
|
||||||
|
-o $3 \
|
||||||
|
--resource-path=./src \
|
||||||
|
--css ./src/style.css \
|
||||||
|
--lua-filter ./src/pagebreak.lua \
|
||||||
|
--to epub \
|
||||||
|
./src/title.txt $DEPS
|
5
default.mobi.do
Normal file
5
default.mobi.do
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
exec >&2
|
||||||
|
|
||||||
|
redo-ifchange ./out/$2.epub
|
||||||
|
|
||||||
|
ebook-convert ./out/$2.epub ./out/$2.mobi
|
@ -14,12 +14,14 @@ in pkgs.stdenv.mkDerivation {
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
calibre
|
calibre
|
||||||
nur.repos.mic92.pandoc-bin
|
nur.repos.mic92.pandoc-bin
|
||||||
|
redo-apenwarr
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cp -rf $src/src .
|
cp -rf $src/src .
|
||||||
mkdir out
|
cp -rf $src/*.do .
|
||||||
cd ./src && ./build.sh && cd ..
|
mkdir -p out
|
||||||
|
redo
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
@ -9,6 +9,7 @@ in pkgs.mkShell {
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
calibre
|
calibre
|
||||||
nur.repos.mic92.pandoc-bin
|
nur.repos.mic92.pandoc-bin
|
||||||
|
redo-apenwarr
|
||||||
|
|
||||||
# keep this line if you use bash
|
# keep this line if you use bash
|
||||||
bashInteractive
|
bashInteractive
|
||||||
|
18
src/build.sh
18
src/build.sh
@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
[[ $DEBUG ]] && set -x
|
|
||||||
|
|
||||||
FILES="$(ls ./**/*.md | grep -v plans)"
|
|
||||||
|
|
||||||
echo $FILES
|
|
||||||
|
|
||||||
pandoc \
|
|
||||||
-o ../out/Spellblade.epub \
|
|
||||||
--resource-path=. \
|
|
||||||
--css style.css \
|
|
||||||
--lua-filter ./pagebreak.lua \
|
|
||||||
title.txt $FILES
|
|
||||||
ebook-convert ../out/Spellblade.epub ../out/Spellblade.mobi
|
|
||||||
|
|
||||||
pandoc --lua-filter wordcount.lua $FILES
|
|
@ -0,0 +1 @@
|
|||||||
|
\pagebreak
|
5
wordcount.do
Normal file
5
wordcount.do
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
DEPS="$(ls ./src/**/*.md | grep -v plans)"
|
||||||
|
|
||||||
|
redo-ifchange $DEPS ./src/wordcount.lua
|
||||||
|
|
||||||
|
pandoc --lua-filter ./src/wordcount.lua $DEPS >&2
|
Loading…
x
Reference in New Issue
Block a user