Commit 49286f4b authored by Felix Hilsky's avatar Felix Hilsky
Browse files

add date of last commit to md pdf output

parent 966f49b2
......@@ -23,3 +23,4 @@
# hence ignore it since it is automatically created
tags
*synctex(busy)
out/
#! /usr/bin/env bash
infile="$1"
outfile="${2:-$HOME/Desktop/pandoc.pdf}"
headertext="$(git log -1 --format=%aI\ %h)"
echo infile: $infile
echo outfile: $outfile
echo headertext: $headertext
mkdir -p .maindir/out
cp .maindir/scripts/md-preamble.tex .maindir/out/md-preamble-orig.tex
sed -i 's#CURRENTCOMMIT#'$(git rev-parse --short HEAD)'#' .maindir/scripts/md-preamble.tex
pandoc --pdf-engine lualatex --lua-filter .maindir/scripts/pandoc-gitlab-math.lua --include-in-header=.maindir/scripts/md-preamble.tex' "$1" -o "${2:-~/Desktop/pandoc.pdf}"
sed -i 's#CURRENTCOMMIT#'"${headertext}"'#' .maindir/scripts/md-preamble.tex
pandoc --pdf-engine lualatex --lua-filter .maindir/scripts/pandoc-gitlab-math.lua --include-in-header=.maindir/scripts/md-preamble.tex "${infile}" --output="${outfile}"
cp .maindir/out/md-preamble-orig.tex .maindir/scripts/md-preamble.tex
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment