Created
January 19, 2026 13:45
-
-
Save AlexanderBrevig/03377082a451b6af594a01afd9c91dbb to your computer and use it in GitHub Desktop.
Create an A5 booklet from a learnxinyminutes resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env fish | |
| set lang $argv[1] | |
| if test -z "$lang" | |
| echo "Usage: bookify.fish <language>" | |
| exit 1 | |
| end | |
| set title (string upper (string sub -l 1 $lang))(string sub -s 2 $lang) | |
| if not test -d docs | |
| echo "Cloning learnxinyminutes-docs..." | |
| git clone git@github.com:adambard/learnxinyminutes-docs.git docs | |
| end | |
| pandoc docs/$lang.md -o $lang.pdf \ | |
| -s --highlight-style kate \ | |
| -V geometry:margin=2cm \ | |
| -V fontsize=11pt \ | |
| -M title="Learn $title in Y Minutes" \ | |
| -M author="learnxinyminutes.com/$lang/" \ | |
| -M date="Bound 2026" \ | |
| --template=eisvogel \ | |
| -V titlepage=true \ | |
| -V titlepage-rule-height=0 | |
| pdfbook2 --short-edge $lang.pdf # will create "$lang-book.pdf" | |
| rm $lang.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment