Skip to content

Commit d564724

Browse files
committed
author-info-blocks: automate png generation of sample doc
A PDF document is generated from the sample Markdown file and then converted to PNG via ImageMagick. The dependency used for PDF conversions seems to be a security nightmare when used on untrusted input, it is disabled on most systems but must be enabled for the make targets to build correctly.
1 parent 44adc33 commit d564724

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

author-info-blocks/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/sample.pdf

author-info-blocks/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@ test: sample.md author-info-blocks.lua
77
expected.native: sample.md author-info-blocks.lua
88
pandoc --lua-filter=author-info-blocks.lua --standalone --output $@ $<
99

10+
sample.pdf: sample.md author-info-blocks.lua
11+
@pandoc \
12+
--lua-filter=author-info-blocks.lua \
13+
--output $@ $<
14+
15+
sample.png: sample.pdf
16+
@# somewhat crude method of converting to PDF, removing the page number
17+
@# and trimming the image to the title block.
18+
@convert -density 300 $< -shave 0%x15% -trim -border 5% $@
19+
1020
.PHONY: test

author-info-blocks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ This will mark Jane Doe and John Q. Doe as equal contributors and
5656
Jane Doe as the sole corresponding author. Below is a screenshot
5757
of a document header created from this metadata.
5858

59-
![example document screenshot](document-screenshot.jpg)
59+
![sample output](sample.png)
-14.2 KB
Binary file not shown.

author-info-blocks/sample.png

41.7 KB
Loading

0 commit comments

Comments
 (0)