diff options
Diffstat (limited to 'bin/compile-book')
-rwxr-xr-x | bin/compile-book | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bin/compile-book b/bin/compile-book index 930e673..2907e98 100755 --- a/bin/compile-book +++ b/bin/compile-book @@ -8,6 +8,7 @@ BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." STRUCTURE="structure/book" +CONTENT="content/sections" OUTPUT="${1:-book}" REVISION="$2" DATE="$3" @@ -37,12 +38,14 @@ for file in $BASEDIR/$STRUCTURE/00*.md; do done # Sections -find content/sections -type f | grep '\.md$' | sort | while read file; do - cat $file >> $OUTPUT.md - echo "" >> $OUTPUT.md - cat $BASEDIR/templates/book/references.md >> $OUTPUT.md - echo "" >> $OUTPUT.md -done +if [ -d "$CONTENT" ]; then + find $CONTENT -type f | grep '\.md$' | sort | while read file; do + cat $file >> $OUTPUT.md + echo "" >> $OUTPUT.md + cat $BASEDIR/templates/book/references.md >> $OUTPUT.md + echo "" >> $OUTPUT.md + done +fi # Footers for file in $BASEDIR/$STRUCTURE/99*.md; do |