1#============================================================================== 2# Copyright (c) 2017-2018 Daniel James 3# 4# Use, modification and distribution is subject to the Boost Software 5# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6# http://www.boost.org/LICENSE_1_0.txt) 7#============================================================================== 8 9#!/usr/bin/env bash 10 11cd $(dirname $0) 12 13cd .. 14b2 -q || exit 1 15cd - 16 17find . -name "*.gold" | while read gold_file 18do 19 flags="--debug" 20 21 quickbook_file=$(echo $gold_file | sed 's/[.]gold/.quickbook/') 22 html_file=$(echo $gold_file | sed 's/[.]gold/.gold-html/') 23 24 if [[ $gold_file =~ .*xinclude/.*-alt\.gold ]] 25 then 26 quickbook_file=$(echo $quickbook_file | sed 's/-alt\.quickbook/.quickbook/') 27 flags="$flags --xinclude-base xinclude/sub" 28 elif [[ $gold_file =~ .*xinclude/.*\.gold ]] 29 then 30 flags="$flags --xinclude-base xinclude/../.." 31 fi 32 33 if [[ $gold_file =~ .*include/filename[-_]path.* ]] 34 then 35 flags="$flags -I include/sub" 36 fi 37 38 if [[ $gold_file =~ .*command_line_macro.* ]] 39 then 40 flags="$flags -D__macro__=*bold* -D__empty__" 41 fi 42 43 ../../../dist/bin/quickbook $quickbook_file $flags --output-file $gold_file || 44 echo "*** Error generating boostbook from $quickbook_file" 45 ../../../dist/bin/quickbook $quickbook_file $flags --output-file $html_file --output-format onehtml || 46 echo "*** Error generating html from $quickbook_file" 47done 48