forked from killbill/killbill-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·28 lines (21 loc) · 1.04 KB
/
make.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
#!/bin/bash -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Actual content
USERGUIDE_INPUT_DIR=$DIR/userguide
# Common options
COMMON_OPTS="-a sourcedir=$USERGUIDE_INPUT_DIR -a imagesdir=$USERGUIDE_INPUT_DIR/assets"
# Selfcontained options
SELFCONTAINED_EXTRA_OPTS="$COMMON_OPTS -T html5 -a stylesheet=kb.css -a stylesdir=../stylesheets -a source-highlighter=pygments"
# Google analytics
GOOGLE_ANALYTICS="-r ./lib/google-analytics-docinfoprocessor.rb -a google-analytics-account=UA-32705710-3"
BUILD_DIR=$DIR/build
SELFCONTAINED_BUILD_DIR=$BUILD_DIR/selfcontained
SELFCONTAINED_BUILD="asciidoctor $SELFCONTAINED_EXTRA_OPTS -B $USERGUIDE_INPUT_DIR -D $SELFCONTAINED_BUILD_DIR -r asciidoctor-diagram $GOOGLE_ANALYTICS -a doctype=book -a data-uri -a linkcss! -a homepage=http://killbill.io"
# Setup
rm -rf $BUILD_DIR && mkdir -p $BUILD_DIR
for dir in `find $USERGUIDE_INPUT_DIR -maxdepth 1 -type d \! -name assets \! -name common`; do
for doc in `find $dir -maxdepth 1 -type f`; do
echo "Building $doc"
$SELFCONTAINED_BUILD $doc
done
done