Further tooling: commit log generation & copy in codio

This commit is contained in:
Ben Soroos
2024-03-16 21:54:48 +00:00
parent 5b5135f134
commit 84ac0c306d
3 changed files with 36 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
/build/ /build/
/.direnv/ /.direnv/
.DS_Store .DS_Store
/latex.out/
built.tar.gz

View File

@@ -18,6 +18,9 @@
simple-http-server simple-http-server
watchexec watchexec
(python3.withPackages (ps: with ps; [jinja2])) (python3.withPackages (ps: with ps; [jinja2]))
latexrun
texlive.combined.scheme-full
ansifilter
]; ];
}; };
}); });

View File

@@ -19,3 +19,34 @@ serve: build
watch: watch:
watchexec --restart -- just serve watchexec --restart -- just serve
log:
#!/usr/bin/env bash
set -exuo pipefail
{
cat <<EOP
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage[margin=0.25in]{geometry}
\usepackage{hyperref}
\newcommand{\ws}[1]{\textcolor[rgb]{0,0,0}{#1}}
\DeclareUnicodeCharacter{22EE}{│}
\usepackage{pmboxdraw}
\begin{document}
\ttfamily
\section*{}
EOP
git log -p --format=tformat:'(((RULE)))%h: %s%nBy %aN <%aE> at %ai%n%b%n' -n 5 \
| delta --light -w 110 --plus-style '"#339933" bold' --plus-emph-style '"#339933"' --minus-style 'red bold' --minus-emph-style 'red' --zero-style 'gray dim' --no-gitconfig --line-numbers --syntax-theme none \
| ansifilter --latex -f \
| sed -e '0,/(((RULE)))/s///' -e 's/(((RULE)))/\\hrule\n\\section*{}/g'
echo '\hrule'
echo '\end{document}'
} > build/commits.tex
latexrun -o build/commits.pdf build/commits.tex
rm build/commits.tex
codio: build log
tar c build/ | gzip > built.tar.gz