forked from bigdatagenomics/adam
/
build.sh
executable file
·68 lines (60 loc) · 1.77 KB
/
build.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#/usr/bin/env bash
git_version=$(git log -1 --pretty=format:%H)
output_dir="output"
pdf_output="$output_dir/ADAM_${git_version}.pdf"
html_output="$output_dir/ADAM_${git_version}.html"
md_output="$output_dir/ADAM_${git_version}.rst"
date_str=$(date '+%Y-%m-%d')
mkdir -p ${output_dir}
title="ADAM User Guide"
date="$date_str git:$git_version"
author="http://bdgenomics.org/"
highlight_style="tango"
which pandoc >/dev/null 2>&1
if [ $? -ne "0" ]; then
echo "WARNING! Pandoc not found on path. Documentation will not be generated!"
exit 0
fi
# Generate a PDF of the docs
pandoc -N -t rst \
--mathjax \
--filter pandoc-citeproc \
--highlight-style "$highlight_style" \
--variable mainfont="Georgia" \
--variable sansfont="Arial" \
--variable monofont="Andale Mono" \
--variable fontsize=10pt \
--variable version=$git_version \
--variable listings=true \
--variable title="$title" \
--variable date="$date" \
--variable author="$author" \
--toc \
--bibliography=source/bibliography.bib \
source/*.md -s -S -o $md_output
# Generate a PDF of the docs
pandoc -N --template=template.tex \
--filter pandoc-citeproc \
--highlight-style "$highlight_style" \
--variable mainfont="Georgia" \
--variable sansfont="Arial" \
--variable monofont="Andale Mono" \
--variable fontsize=10pt \
--variable version=$git_version \
--variable listings=true \
--variable title="$title" \
--variable date="$date" \
--variable author="$author" \
--toc \
--bibliography=source/bibliography.bib \
source/*.md -s -S -o $pdf_output
# Generate HTML of the docs
pandoc source/*.md -H style.css -s -S --toc \
--mathjax \
--filter pandoc-citeproc \
--bibliography=source/bibliography.bib \
--highlight-style "$highlight_style" \
--variable title="$title" \
--variable date="$date" \
--variable author="$author" \
-o $html_output