-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildDoc.sh
More file actions
36 lines (31 loc) · 889 Bytes
/
BuildDoc.sh
File metadata and controls
36 lines (31 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Validate that tools are available in the global path ($env:PATH, %PATH%, ...)
mkdocs --help> /dev/null 2>&1
if [ "$?" -ne "0" ]; then echo "Can not find mkdocs."; exit; fi
pandoc --help> /dev/null 2>&1
if [ "$?" -ne "0" ]; then echo "Can not find pandoc."; exit; fi
if [ -d "out" ]
then
echo "Output directory [out] exists. Cleaning up."
rm -rf "out"
echo "Existing output directory deleted."
fi
# Create output directories
echo "Creating directories"
mkdir -p "out/pdf"
mkdir -p "out/html"
echo "Directories created"
# Generate outputs
cd "docs"
pandoc "README.md" \
../metadata.yml \
--data-dir=/usr/local/share/pandoc \
--metadata date=$(date +"%Y-%m-%d") \
--metadata titlepage-background="../background.pdf" \
--metadata logo=logo.png \
-o "../out/pdf/example.pdf" \
-f markdown \
--template eisvogel.latex \
--listing
cd ".."
mkdocs build -d "out/html"