2019-04-02 23:51:16 +02:00
|
|
|
#/usr/bin/env bash
|
|
|
|
here="$(pwd)"
|
|
|
|
|
2019-04-04 14:46:29 +02:00
|
|
|
echo Building log_combined.md...
|
2019-04-02 23:51:16 +02:00
|
|
|
(
|
2019-04-04 14:46:29 +02:00
|
|
|
cat log_part1_intro.md; echo;
|
|
|
|
cat log_part2_hills.md; echo;
|
|
|
|
cat log_part3_models.md; echo;
|
|
|
|
cat log_part4_optimizations.md; echo;
|
|
|
|
cat log_part5_scene.md; echo;
|
|
|
|
cat log_part6_effect.md; echo;
|
|
|
|
cat log_part7_daylight.md; echo;
|
|
|
|
) | sed -e "s/ i / I /g" | sed -e "s/ i'm / I'm /g" > log_combined.md
|
2019-04-02 23:51:16 +02:00
|
|
|
|
2019-04-07 00:18:43 +02:00
|
|
|
echo Building delivery_combined.md...
|
|
|
|
(
|
|
|
|
cat delivery_part1.md; echo;
|
|
|
|
cat delivery_part2.md; echo;
|
|
|
|
cat delivery_part3.md; echo;
|
|
|
|
cat delivery_part4.md; echo;
|
|
|
|
cat delivery_part5.md; echo;
|
|
|
|
) | sed -e "s/ i / I /g" | sed -e "s/ i'm / I'm /g" > delivery_combined.md
|
|
|
|
|
|
|
|
|
2019-04-02 23:51:16 +02:00
|
|
|
#ENGINE=pdflatex
|
|
|
|
#ENGINE=lualatex
|
|
|
|
ENGINE=xelatex
|
|
|
|
|
2019-04-07 00:18:43 +02:00
|
|
|
VARIABLES="$VARIABLES --filter pandoc-codeblock-include"
|
2019-04-02 23:51:16 +02:00
|
|
|
VARIABLES="$VARIABLES --filter pandoc-imagine"
|
2019-04-07 00:18:43 +02:00
|
|
|
VARIABLES="$VARIABLES --filter pandoc-crossref"
|
2019-04-02 23:51:16 +02:00
|
|
|
#VARIABLES="$VARIABLES --variable classoption=twocolumn"
|
|
|
|
VARIABLES="$VARIABLES --table-of-contents"
|
|
|
|
VARIABLES="$VARIABLES --number-sections"
|
|
|
|
#VARIABLES="$VARIABLES --number-offset=0,0"
|
2019-04-07 00:18:43 +02:00
|
|
|
VARIABLES="$VARIABLES --variable papersize=a4paper"
|
|
|
|
VARIABLES="$VARIABLES --variable geometry:margin=2cm"
|
2019-04-02 23:51:16 +02:00
|
|
|
VARIABLES="$VARIABLES --variable links-as-notes=true"
|
|
|
|
|
|
|
|
VARIABLES="$VARIABLES --highlight-style=pygments" # the default
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=haddock" # kinda nice for python at least
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=tango"
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=espresso"
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=zenburn"
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=kate"
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=monochrome"
|
|
|
|
#VARIABLES="$VARIABLES --highlight-style=breezedark"
|
|
|
|
|
2019-04-07 00:18:43 +02:00
|
|
|
|
2019-04-02 23:51:16 +02:00
|
|
|
ls -1 *.md | grep -v "part" |
|
|
|
|
( while read source; do
|
|
|
|
(
|
|
|
|
|
|
|
|
base="$(basename $source)"
|
|
|
|
dest="$(echo $base | rev | cut -c4- | rev)_out"
|
|
|
|
|
|
|
|
cd "$(dirname $source)"
|
|
|
|
|
2019-04-07 00:18:43 +02:00
|
|
|
if [ "$(md5sum "$source")" != "$(cat ${source}5_hash 2>/dev/null)" ]; then
|
|
|
|
md5sum "$source" > "${source}5_hash"
|
|
|
|
echo "Converting $source into $(dirname $source)/${dest}.pdf ..."
|
|
|
|
pandoc "$base" --pdf-engine="$ENGINE" $VARIABLES -o "$dest.pdf"
|
|
|
|
fi
|
2019-04-02 23:51:16 +02:00
|
|
|
|
|
|
|
) &
|
|
|
|
done
|
|
|
|
wait )
|