citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 7fba811c0422484c74d76249c55d7bc2d143adf7
parent 510e829c1b43a608c3d9f6eba8268f282dc5ba0a
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  4 May 2021 03:39:26 -0700

pandoc helpers

Diffstat:
Abin/pandoc-nice | 7+++++++
Abin/pandocweb-open | 13+++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/bin/pandoc-nice b/bin/pandoc-nice @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +pandoc \ + --pdf-engine=xelatex \ + --metadata=fontfamily:libertine \ + -V geometry:margin=1.2in \ + --variable urlcolor=cyan \ + "$@" diff --git a/bin/pandocweb-open b/bin/pandocweb-open @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +url="${2:-$(xclip -o)}" +typ="${1:-pdf}" + +function get_tmpname() { + hashpart=$(sha256sum <<<"$url" | awk '{print $1}') + printf "/tmp/out-${hashpart:0:8}.$typ\n" +} + +file="$(get_tmpname)" +(pandocweb "$url" "$file" && open "$file") || notify-send -u critical failed +