Skip to content

Instantly share code, notes, and snippets.

@noandrea
Last active February 26, 2022 14:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noandrea/1082b6649d526d301980b97365691b1c to your computer and use it in GitHub Desktop.
Save noandrea/1082b6649d526d301980b97365691b1c to your computer and use it in GitHub Desktop.
Makefile for Hackmd 2 PDF
AU_HACKMD_CODE = bfScafhcTdGzzhJ4B3evlQ
AU_OUTFILE = $(HOME)/$(AU_HACKMD_CODE).MD.$(shell date +%F).pdf
AU_FORMAT = article
hackmd2pdf:
@echo format doc
curl -s -L "https://hackmd.io/$(AU_HACKMD_CODE)/download" \
-o /tmp/$(AU_HACKMD_CODE).md
pandoc /tmp/$(AU_HACKMD_CODE).md -o $(AU_OUTFILE) \
--table-of-contents \
--pdf-engine=xelatex \
--highlight-style=monochrome \
--number-sections \
-V 'fontsize: 12pt' \
-V 'papersize: A4' \
-V 'urlcolor: blue' \
-V 'date: \today{}' \
-V 'documentclass:$(AU_FORMAT)' \
-V 'geometry:margin=3.8cm'
xdg-open $(AU_OUTFILE)
@echo done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment