Skip to content

Commit

Permalink
feat(makefile) Produce a combined .epub file including the arf.md and…
Browse files Browse the repository at this point in the history
… all the annexes available in .md eu-digital-identity-wallet#190
  • Loading branch information
skounis committed Jun 26, 2024
1 parent 9ed6250 commit 3249aa1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

SOURCE_DOCS := $(wildcard docs/*.md)
BUILD_DIR :=./build
EPUB_OUTPUT := $(BUILD_DIR)/epub/arf+annexes.epub
MD_FILES := docs/arf.md $(sort $(wildcard docs/annexes/*/*.md))
SITE_DIR :=./site
EXPORTED_DOCS=\
$(SOURCE_DOCS:.md=.pdf) \
Expand All @@ -32,6 +34,13 @@ PANDOC_PDF_OPTIONS= --pdf-engine=xelatex
PANDOC_DOCX_OPTIONS=
PANDOC_EPUB_OPTIONS=--to epub3

# Check if the pandoc is installed
check-pandoc:
@which pandoc > /dev/null || (echo "Pandoc not found, installing..." && make install-pandoc)

install-pandoc:
sudo apt-get update && sudo apt-get install -y pandoc

# Pattern-matching Rules

%.pdf : %.md
Expand All @@ -49,10 +58,15 @@ PANDOC_EPUB_OPTIONS=--to epub3

# Targets and dependencies

.PHONY: all clean
.PHONY: all clean combined.epub

all : $(EXPORTED_DOCS) mkdocs

# Target to create an EPUB from arf.md and all the annexes.
epub: check-pandoc
mkdir -p $(BUILD_DIR)/epub
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_EPUB_OPTIONS) -o $(EPUB_OUTPUT) $(MD_FILES)

mkdocs:
$(MKDOCS) build

Expand Down

0 comments on commit 3249aa1

Please sign in to comment.