Skip to content

Commit

Permalink
Move shared pandoc options to external yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill committed Jul 10, 2024
1 parent 9abda53 commit acac6b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ CHAPTERS=$(shell grep -Eoi '\([^\)]+' src/SUMMARY.md | sed -e 's,^.,src/,')

PANDOC_OPTIONS+=-f markdown+rebase_relative_paths
PANDOC_OPTIONS+=--metadata-file=metadata.yaml
PANDOC_OPTIONS+=--toc-depth=5 --toc
PANDOC_OPTIONS+=-V papersize:a5
PANDOC_OPTIONS+=-V geometry:margin=1.5cm

# PDF: Add cover and hide title text page
PANDOC_PDF_OPTIONS+=-B cover.tex -V title:
PANDOC_PDF_OPTIONS+=--pdf-engine=xelatex

PANDOC_EPUB_OPTIONS+=--epub-cover-image=cover.jpg

pdf:
pandoc $(CHAPTERS) $(PANDOC_OPTIONS) $(PANDOC_PDF_OPTIONS) -o r2book.pdf

epub:
pandoc $(CHAPTERS) $(PANDOC_OPTIONS) $(PANDOC_EPUB_OPTIONS) -o r2book.epub
pandoc $(CHAPTERS) $(PANDOC_OPTIONS) -o r2book.epub

texi:
pandoc $(CHAPTERS) $(PANDOC_OPTIONS) -o r2book.texi
Expand Down
2 changes: 2 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# mdBook configuration file

[book]
title = "The Official Radare2 Book"
author = "pancake <pancake@nopcode.org>"
Expand Down
8 changes: 8 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Pandoc metadata file
title: The Official Radare2 Book
lang: en-US
author:
Expand All @@ -8,3 +9,10 @@ keywords:
- radare2
- reversing
- radare

cover-image: cover.jpg
toc: true
toc-depth: 5
papersize: a5
geometry:
- margin=1.5cm

0 comments on commit acac6b2

Please sign in to comment.