-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from paolo-de-rosa/feat/mkdocs
Feat/mkdocs
- Loading branch information
Showing
24 changed files
with
180 additions
and
1,235 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/*.docx | ||
node_modules | ||
dist | ||
build | ||
site |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,60 @@ | ||
# Makefile | ||
# Converts Markdown to other formats (HTML, PDF, DOCX, EPUB) using Pandoc and MkDocs | ||
# | ||
# Run "make" (or "make all") to convert to all other formats | ||
# Run "make clean" to delete converted files | ||
|
||
# Prerequisites | ||
# pandoc | ||
# | ||
# sudo apt install pandoc | ||
# Install pandoc, latex and mkdocs in your environment | ||
# | ||
# Parameters and Variables | ||
# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html#Automatic-Variables | ||
GENERATED= arf.html \ | ||
arf.docx | ||
# | ||
|
||
SOURCE_DOCS := $(wildcard docs/*.md) | ||
BUILD_DIR :=./build | ||
SITE_DIR :=./site | ||
EXPORTED_DOCS=\ | ||
$(SOURCE_DOCS:.md=.pdf) \ | ||
$(SOURCE_DOCS:.md=.docx) \ | ||
$(SOURCE_DOCS:.md=.epub) | ||
|
||
RM=/bin/rm | ||
PANDOC=pandoc | ||
MKDOCS=mkdocs | ||
|
||
PANDOC_OPTIONS=--toc --metadata title="The European Digital Identity Wallet Architecture and Reference Framework" --metadata lang="en" --data-dir docs/media | ||
PANDOC_PDF_OPTIONS= --pdf-engine=xelatex | ||
PANDOC_DOCX_OPTIONS= | ||
PANDOC_EPUB_OPTIONS=--to epub3 | ||
|
||
# Pattern-matching Rules | ||
|
||
%.pdf : %.md | ||
mkdir -p $(BUILD_DIR)/pdf | ||
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_PDF_OPTIONS) -o $(BUILD_DIR)/pdf/$(notdir $@) $< | ||
|
||
all: $(GENERATED) | ||
%.docx : %.md | ||
mkdir -p $(BUILD_DIR)/docx | ||
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_DOCX_OPTIONS) -o $(BUILD_DIR)/docx/$(notdir $@) $< | ||
|
||
# Gerenate html, doc from the html | ||
arf.html: arf.md | ||
pandoc -s -o ./dist/$@ $< --toc --metadata title="The European Digital Identity Wallet Architecture and Reference Framework" --metadata lang="en" --self-contained --css=styles/style.css | ||
node fix.js | ||
cd ./dist && cp output.html $@ && rm output.html | ||
pandoc -o ./dist/$@.docx ./dist/$@ --reference-doc=styles/reference.docx | ||
%.epub : %.md | ||
mkdir -p $(BUILD_DIR)/epub | ||
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_EPUB_OPTIONS) -o $(BUILD_DIR)/epub/$(notdir $@) $< | ||
|
||
# Generate docx | ||
arf.docx: arf.md | ||
pandoc -o ./dist/$@ $< | ||
|
||
# Run a local http server | ||
# Targets and dependencies | ||
|
||
.PHONY: all clean | ||
|
||
all : $(EXPORTED_DOCS) mkdocs | ||
|
||
mkdocs: | ||
$(MKDOCS) build | ||
|
||
serve: | ||
npx http-server . | ||
$(MKDOCS) serve | ||
|
||
prepare: | ||
mkdir -p dist | ||
npm install | ||
|
||
clean: | ||
echo $(GENERATED) | ||
rm -f $(GENERATED) arf.html.docx | ||
rm -f ./dist -R | ||
- $(RM) -rf $(BUILD_DIR) $(SITE_DIR) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.