Google AIPs を PDF で読む

必要なもの

Arch Linux の場合

sudo pacman -Syu mandoc textlive-most
yay -Syu pandoc-bin

スクリプト

#!/bin/sh

set -e

root=${AIP_TO_PDF_ROOT:-$HOME/aip-pdf}

id="$(printf "%04d" "$1")"
out="$root/aip-$id.pdf"

if [ -e "$out" ]; then
  echo "$out is already exists"
else
  mkdir -p "$(dirname "$out")"
  curl "https://raw.githubusercontent.com/aip-dev/google.aip.dev/master/aip/general/$id.md" | pandoc -f markdown -o "$out"
fi

使い方

aip-to-pdf 161