diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/boost/tools/quickbook | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/quickbook')
661 files changed, 68072 insertions, 0 deletions
diff --git a/src/boost/tools/quickbook/Jamfile.v2 b/src/boost/tools/quickbook/Jamfile.v2 new file mode 100644 index 000000000..678b68c3c --- /dev/null +++ b/src/boost/tools/quickbook/Jamfile.v2 @@ -0,0 +1,57 @@ +#============================================================================== +# Copyright (c) 2002 2004 2006 Joel de Guzman +# Copyright (c) 2004 Eric Niebler +# Copyright (c) 2015 Rene Rivera +# http://spirit.sourceforge.net/ +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +project quickbook + : requirements + <toolset>gcc:<c++-template-depth>300 + <toolset>darwin:<c++-template-depth>300 + <toolset>gcc:<cflags>-g0 + <toolset>darwin:<cflags>-g0 + <toolset>msvc:<cflags>/wd4709 + <warnings>all + <define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE + : default-build + <cxxstd>0x + ; + +import boostcpp ; +import path ; +import option ; + +local DIST_DIR = [ option.get distdir ] ; +if $(DIST_DIR) { + DIST_DIR = [ path.root [ path.make $(DIST_DIR) ] [ path.pwd ] ] ; +} else { + DIST_DIR = [ path.join $(BOOST_ROOT) dist ] ; +} +local DIST_BIN = [ path.join $(DIST_DIR) bin ] ; + +# Install quickbook by default. + +install dist-bin + : + src//quickbook + : + <install-type>EXE + <location>$(DIST_BIN) + : + release + ; + +# Target for quickbook toolset's auto build. + +alias quickbook + : src//quickbook + : release + ; + +explicit quickbook + ; diff --git a/src/boost/tools/quickbook/_clang-format b/src/boost/tools/quickbook/_clang-format new file mode 100644 index 000000000..555e3b72f --- /dev/null +++ b/src/boost/tools/quickbook/_clang-format @@ -0,0 +1,57 @@ + +# Copyright 2017 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# Using clang format 4.0 +# http://llvm.org/releases/4.0.0/tools/clang/docs/ClangFormatStyleOptions.html + +BasedOnStyle: LLVM + +# Basic settings +ColumnLimit: 80 +NamespaceIndentation: All +ContinuationIndentWidth: 4 +IndentWidth: 4 +UseTab: Never +Language: Cpp +Standard: Cpp03 + +# Code layout +AlignAfterOpenBracket: AlwaysBreak +AlignTrailingComments: true +AllowShortBlocksOnASingleLine: true +AllowShortFunctionsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: true +BinPackParameters: false +BreakBeforeBraces: Custom +ConstructorInitializerAllOnOneLineOrOnePerLine: true +BreakConstructorInitializersBeforeComma: true +BraceWrapping: + AfterNamespace: true + AfterClass: true + AfterStruct: true + AfterUnion: true + AfterEnum: true + AfterFunction: true + AfterControlStatement: false + BeforeCatch: false + BeforeElse: true +PointerAlignment: Left + +PenaltyReturnTypeOnItsOwnLine: 1000 + +# Include order + +IncludeCategories: + - Regex: '^<windows.h>$' + Priority: 10 + - Regex: '^<boost/.*>$' + Priority: 30 + - Regex: '^<.*>$' + Priority: 20 + - Regex: '^".*"$' + Priority: 40 + +# Boost specific stuff +ForEachMacros: [ BOOST_FOREACH, QUICKBOOK_FOR ] diff --git a/src/boost/tools/quickbook/build/Jamfile.v2 b/src/boost/tools/quickbook/build/Jamfile.v2 new file mode 100644 index 000000000..6873ef424 --- /dev/null +++ b/src/boost/tools/quickbook/build/Jamfile.v2 @@ -0,0 +1,9 @@ +#============================================================================== +# Copyright (c) 2017 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +alias dist-bin : ..//dist-bin ; diff --git a/src/boost/tools/quickbook/build/publish-docs b/src/boost/tools/quickbook/build/publish-docs new file mode 100755 index 000000000..ab134474d --- /dev/null +++ b/src/boost/tools/quickbook/build/publish-docs @@ -0,0 +1,65 @@ +#============================================================================== +# Copyright (c) 2017 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +#!/usr/bin/env bash +set -e + +# Change to the quickbook root directory +cd $(dirname $0) +cd .. + +# Git settings +remote=git@github.com:boostorg/quickbook.git +branch=gh-pages + +main() { + git fetch "$remote" "$branch:$branch" + b2 -aq doc//fully-standalone + write_fast_import gh-pages | git fast-import --date-format=now --quiet + git push "$remote" "$branch" +} + +write_fast_import() { + committer="$(git config user.name) <$(git config user.email)>" + commit_message="Rebuild documentation" + branch=$1 + + # Start commit + echo "commit refs/heads/${branch}" + echo "committer ${committer} now" + echo "data ${#commit_message}" + echo $commit_message + echo "from ${branch}" + echo "merge HEAD" + + # Delete everything and rebuild tree from scratch. + echo "deleteall" + + # Copy all files from HEAD + git ls-tree -r HEAD | + while read mode type hash path ; do + echo "M $mode $hash $path" + done + + # Preserve index.html from the github pages branch + git ls-tree $branch -- index.html | + while read mode type hash path ; do + echo "M $mode $hash $path" + done + + # Check in documentation + find doc/html -type f | while read path; do + size=$(wc -c "$path") + echo "M 100644 inline $path" + echo "data $size" + cat "$path" + echo + done +} + +main
\ No newline at end of file diff --git a/src/boost/tools/quickbook/build/warning-check b/src/boost/tools/quickbook/build/warning-check new file mode 100755 index 000000000..064d49932 --- /dev/null +++ b/src/boost/tools/quickbook/build/warning-check @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +cd $(dirname $0)/../src + +tmpfile=$(tempfile) + +CXX=${CXX:-g++} +BOOST_ROOT=${BOOST_ROOT:-../../..} + +failure=0 + +for filename in *.cpp +do + set -x + if ! $CXX -c -O0 --std=c++11 -isystem $BOOST_ROOT $filename -o $tmpfile \ + -pedantic -Wstrict-aliasing -fstrict-aliasing \ + -Werror -Wall -Wextra \ + -Wunused-parameter -Wshadow \ + -Wfloat-equal \ + -Wsign-promo -Wconversion -Wno-sign-conversion + then + failure=1 + fi + + set +x +done + +rm $tmpfile +exit $failure diff --git a/src/boost/tools/quickbook/examples/simple-boostbook/Jamfile.v2 b/src/boost/tools/quickbook/examples/simple-boostbook/Jamfile.v2 new file mode 100644 index 000000000..4b511c112 --- /dev/null +++ b/src/boost/tools/quickbook/examples/simple-boostbook/Jamfile.v2 @@ -0,0 +1,10 @@ + +# Copyright 2013-2018 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using boostbook ; + +boostbook simple : simple.xml : + <xsl:param>boost.root=../../../../.. + ; diff --git a/src/boost/tools/quickbook/examples/simple-boostbook/simple.xml b/src/boost/tools/quickbook/examples/simple-boostbook/simple.xml new file mode 100644 index 000000000..6064d5d1e --- /dev/null +++ b/src/boost/tools/quickbook/examples/simple-boostbook/simple.xml @@ -0,0 +1,13 @@ +<!-- +Copyright Daniel James 2013-2018 +Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +--> + +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" + "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article> + <title>Simple Example</title> + <para>Interesting stuff goes here.</para> +</article> diff --git a/src/boost/tools/quickbook/examples/simple-quickbook/Jamfile.v2 b/src/boost/tools/quickbook/examples/simple-quickbook/Jamfile.v2 new file mode 100644 index 000000000..8af6ba878 --- /dev/null +++ b/src/boost/tools/quickbook/examples/simple-quickbook/Jamfile.v2 @@ -0,0 +1,13 @@ + +# Copyright 2013-2018 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using boostbook ; +using quickbook ; + +xml simple-boostbook : simple.qbk ; + +boostbook simple : simple-boostbook : + <xsl:param>boost.root=../../../../.. + ; diff --git a/src/boost/tools/quickbook/examples/simple-quickbook/simple.qbk b/src/boost/tools/quickbook/examples/simple-quickbook/simple.qbk new file mode 100644 index 000000000..df93471a2 --- /dev/null +++ b/src/boost/tools/quickbook/examples/simple-quickbook/simple.qbk @@ -0,0 +1,13 @@ +[/ + Copyright 2013-2018 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[article Simple Example + [quickbook 1.6] +] + +Interesting stuff goes here. diff --git a/src/boost/tools/quickbook/examples/standalone-quickbook/Jamfile.v2 b/src/boost/tools/quickbook/examples/standalone-quickbook/Jamfile.v2 new file mode 100644 index 000000000..28b20b43f --- /dev/null +++ b/src/boost/tools/quickbook/examples/standalone-quickbook/Jamfile.v2 @@ -0,0 +1,21 @@ + +# Copyright 2013-2018 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using boostbook ; +using quickbook ; + +xml simple-boostbook : simple.qbk ; + +boostbook simple : simple-boostbook : + <dependency>css + <dependency>images + ; + +install css : [ glob $(BOOST_ROOT)/doc/src/*.css ] + : <location>html ; +install images : [ glob $(BOOST_ROOT)/doc/src/images/*.png ] + : <location>html/images ; +explicit css ; +explicit images ; diff --git a/src/boost/tools/quickbook/examples/standalone-quickbook/Jamroot.jam b/src/boost/tools/quickbook/examples/standalone-quickbook/Jamroot.jam new file mode 100644 index 000000000..055b03e52 --- /dev/null +++ b/src/boost/tools/quickbook/examples/standalone-quickbook/Jamroot.jam @@ -0,0 +1,45 @@ +# +# Copyright (c) 2006 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +## +## IMPORTANT NOTE: This file MUST NOT be copied over a boost installation +## + +path-constant top : . ; + +import modules ; +import path ; + +local boost-root = [ modules.peek : BOOST_ROOT ] ; + +if ! $(boost-root) +{ + local boost-search-dirs = [ modules.peek : BOOST_BUILD_PATH ] ; + + for local dir in $(boost-search-dirs) + { + if [ path.glob $(dir)/../../../ : boost/version.hpp ] + { + boost-root += $(dir)/../../../ ; + } + } + + if $(boost-root) + { + boost-root = [ path.make $(boost-root[1]) ] ; + } + else + { + ECHO "Warning: couldn't find BOOST_ROOT in" $(boost-root) ; + } +} + +path-constant BOOST_ROOT : $(boost-root) ; +modules.poke : QUICKBOOK_ROOT : $(top) ; + +use-project /boost : $(BOOST_ROOT) ; diff --git a/src/boost/tools/quickbook/examples/standalone-quickbook/simple.qbk b/src/boost/tools/quickbook/examples/standalone-quickbook/simple.qbk new file mode 100644 index 000000000..df93471a2 --- /dev/null +++ b/src/boost/tools/quickbook/examples/standalone-quickbook/simple.qbk @@ -0,0 +1,13 @@ +[/ + Copyright 2013-2018 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[article Simple Example + [quickbook 1.6] +] + +Interesting stuff goes here. diff --git a/src/boost/tools/quickbook/extra/katepart/install.sh b/src/boost/tools/quickbook/extra/katepart/install.sh new file mode 100644 index 000000000..c6bfeeadf --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/install.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash + +# boost::hs installer +# +# Copyright 2006 Matias Capeletto +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# This script install the .xml kate syntax files in KDE + +echo "Installing boost::hs" +echo "A few xml files will be copy to the place KDE store katepart sources." +echo "Files to install" + +ls syntax/*.xml -1 + +echo "Installing..." + +cp syntax/*.xml /usr/share/apps/katepart/syntax + +echo "Done!" +echo "" + diff --git a/src/boost/tools/quickbook/extra/katepart/katepart.qbk b/src/boost/tools/quickbook/extra/katepart/katepart.qbk new file mode 100644 index 000000000..5af40afa7 --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/katepart.qbk @@ -0,0 +1,125 @@ +[/ + Boost.hs + + Copyright 2007 Matias Capeletto + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[section KDE Support] + +[heading boost::hs::quickbook] + +boost::hs::quickbook is a syntax highlighting designed to work with Katepart. +It can be used in KWrite, Kate, Konqueror and KDevelop, and supports all the +constructs of Quickbook 1.4 including tables, list, templates and macros. + +[variablelist +[[.qbk loaded in a text editor][ +[$../../tools/quickbook/doc/html/images/extra/katepart/table.text.editor.png] +]] +[[.qbk loaded with boost::hs support][ +[$../../tools/quickbook/doc/html/images/extra/katepart/table.boost.hs.png] +]] +] + +[*html generated from this .qbk file] + +[table Code examples +[[Name][Code][Description]] +[[for loop ][` for(int k=0; k<10; k++) v+=k; ` ][Sums some numbers. ]] +[[while loop ][` { int k; while( k < 10 ) { v+=k; k++ } } `][Same effect. ]] +[[infinite loop][` while( true ) { v+=1; } ` ][Not a good example.]] +] + +[heading Code Folding ] + +boost::hs goes far beyond simple coloring. One useful thing +you can get the editor to do is to mark regions. They appear in a small grey line +and each region can be folded or unfolded independently. + +[heading Auto Comment / Uncomment ] + +Another important feature is the possibility to auto-comment or uncomment some +piece of code (/Tools - Comment/). +Commented regions can be uncommented simple calling the /uncomment/ command +while being in it. + +[heading Styles reference ] + +[table +[[ Name ][ Style ][ Description ]] + +[[*plain text* ][normal black ] +[Plain text at each level. ]] + +[[*formatted text* ][formatted black ] +[ Bold, italic, underline and mixes. Teletype, replaceable, strikeout. ]] + +[[*structure* ][light blue ] +[All quickbook structures characters (\[, \], \[block-type, simple +formating boundaries, lists keywords (\*, \#) ]] + +[[*macros* ][red ] +[Names in macro definitions, macros insertion if it is used the \_\_xxx\_\_ +proposed sintaxis. ]] + +[[*templates* ][red ] +[Names in template definitions ]] + +[[*anchors* ][red ] +[All the keywords that are used to link quickbooks together. ]] + +[[*comments* ][italic light gray ] +[Inside the commentaries. ]] + +[[*tables* ][HTML like ] +[Reveal the structure, bold title, higlighted HTML like columns titles. ]] + +[[*variable lists* ][HTML like ] +[Reveal the structure, bold title, bold HTML like items names. ]] + +[[*c++ code* ][cpp Kate syntax ] +[Code blocks and inline code. ]] + +[[*paths* ][green ] +[Image, files and web paths ]] + +[[*IDE specific* ][dark blue ] +[IDE commands ]] +] + +[heading About boost::hs] + +[$../../tools/quickbook/doc/html/images/extra/katepart/boost.hs.logo.png] + +boost::hs::quickbook is a component of boost::hs, a syntax highlighting +for C++, doxygen, Boost.Build jamfiles and QuickBook. +boost::hs has his own page [@http://tinyurl.com/2l7u33 here]. + +[note +boost::hs::cpp support QuickBook code import comments style! +] + +[heading Installing boost::hs] + +There exist an ongoing effort to push boost::hs upstream to the KatePart +project. In a few months KDE may have native Quickbook support! +For the moment you must download and install it. + +You can download boost::hs from +[@http://matias.capeletto.googlepages.com/boost_hs.zip here]. + +[note +A copy of boost::hs::quickbook and boost::hs::cpp is available in `boost/tools/quickbook/extra/katepart`. +] + +In order to install it you must copy the content in the folder +[*katepart\/syntax\/] to the appropriate katepart syntax folder in your +machine. In general this folder will be in +[*\/usr\/share\/apps\/katepart\/syntax]. A bash script named ['install.sh] +is included that copy the files to this folder. + +[endsect] diff --git a/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_boost.xml b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_boost.xml new file mode 100644 index 000000000..7c2b5fcc7 --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_boost.xml @@ -0,0 +1,3020 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE language SYSTEM "language.dtd"> +<language + +name="boost" +version="0.1.0" +kateversion="2.4" +section="boost::hs" +extensions="*.boost" +mimetype="allFiles" +author="Copyright 2006 -2007 Matias Capeletto, matias.capeletto@gmail.com" +license="Distributed under the Boost Software License, Version 1.0. +http://www.boost.org/LICENSE_1_0.txt" + +> + +<highlighting> + + +<list name="boost.free.function"> + + <!-- boost.any --> + + <item> any_cast </item> + + <!-- boost.asign --> + + <item> ptr_list_of </item> + <item> list_of </item> + <item> map_list_of </item> + <item> tuple_list_of </item> + <item> ref_list_of </item> + <item> cref_list_of </item> + <item> make_list_inserter </item> + + <!-- boost.bind --> + + <item> bind </item> + <item> mem_fn </item> + + <!-- boost.conversion --> + + <item> polymorphic_cast </item> + <item> polymorphic_downcast </item> + <item> lexical_cast </item> + + <!-- boost.fusion --> + + <item> at </item> + <item> value_at </item> + <item> has_key </item> + <item> at_key </item> + <item> value_at_key </item> + <item> at_c </item> + <item> value_at_c </item> + + <item> advance_c </item> + <item> next </item> + <item> equal_to </item> + <item> advance </item> + <item> distance </item> + <item> deref </item> + <item> value_of </item> + <item> prior </item> + <item> begin </item> + <item> end </item> + <item> size </item> + <item> empty </item> + <item> front </item> + <item> back </item> + + <item> is_sequence </item> + <item> is_view </item> + <item> value_of </item> + <item> tag_of </item> + <item> category_of </item> + + <item> as_list </item> + <item> as_vector </item> + <item> as_set </item> + <item> as_map </item> + + <item> make_list </item> + <item> make_cons </item> + <item> make_vector </item> + <item> make_set </item> + <item> make_map </item> + + <item> tuple_open </item> + <item> tuple_close </item> + <item> tuple_delimiter </item> + + <item> fold </item> + <item> accumulate </item> + <item> for_each </item> + + <item> any </item> + <item> all </item> + <item> none </item> + <item> find </item> + <item> find_if </item> + <item> count </item> + <item> count_if </item> + + <item> filter </item> + <item> filter_if </item> + <item> transform </item> + <item> replace </item> + <item> replace_if </item> + <item> remove </item> + <item> remove_if </item> + <item> reverse </item> + <item> clear </item> + <item> erase </item> + <item> erase_key </item> + <item> insert </item> + <item> insert_range </item> + <item> join </item> + <item> zip </item> + <item> pop_back </item> + <item> pop_front </item> + <item> push_back </item> + <item> push_front </item> + + <item> tuple_size </item> + <item> tuple_element </item> + <item> get </item> + <item> tag_of </item> + + <!-- boost.hash --> + + <item> hash_combine </item> + <item> hash_range </item> + <item> hash_value </item> + + <!-- boost.multi_index --> + + <item> get </item> + <item> project </item> + + <!-- boost.optional --> + + <item> get_pointer </item> + + <!-- boost.property_map --> + + <item> put </item> + + <!-- boost.ref --> + + <item> unwrap_reference </item> + + <!-- boost.test --> + + <item> init_unit_test_suite </item> + + <!-- boost.concepts --> + + <item> distance </item> + <item> advance </item> + <item> swap </item> + +</list> + + + + +<list name="boost.template.classes"> + + <!-- boost.any --> + + <item> any </item> + + <!-- boost.commpressed_pair --> + + <item> compressed_pair </item> + + <!-- boost.fusion --> + + <item> cons </item> + <item> single_view </item> + <item> filter_view </item> + <item> iterator_range </item> + <item> joint_view </item> + <item> zip_view </item> + <item> transform_view </item> + <item> reverse_view </item> + <item> list_tie </item> + <item> vector_tie </item> + + <!-- boost.hash --> + + <item> hash </item> + + <!-- boost.iterators --> + + <item> counting_iterator </item> + <item> filter_iterator </item> + <item> function_output_iterator </item> + <item> dereferenced iterator </item> + <item> indirect_iterator </item> + <item> permutation_iterator </item> + <item> reverse_iterator </item> + <item> shared_container_iterator </item> + <item> transform_iterator </item> + <item> zip_iterator </item> + + <!-- boost.iterator --> + + <item> iterator_facade </item> + <item> iterator_adaptor </item> + <item> iterator_adaptor_ </item> + + <!-- boost.multi_index --> + + <item> nth_index </item> + <item> index </item> + <item> nth_index_iterator </item> + <item> nth_index_const_iterator </item> + <item> index_iterator </item> + <item> index_const_iterator </item> + + <item> sequenced </item> + <item> ordered_unique </item> + <item> ordered_non_unique </item> + <item> hashed_unique </item> + <item> hashed_non_unique </item> + <item> identity </item> + <item> member </item> + <item> member_offset </item> + + <item> const_mem_fun </item> + <item> mem_fun </item> + <item> const_mem_fun_explicit </item> + <item> mem_fun_explicit </item> + + <item> composite_key </item> + <item> composite_key_result </item> + <item> composite_key_equal_to </item> + <item> composite_key_result_equal_to </item> + <item> composite_key_compare </item> + <item> composite_key_result_less </item> + <item> composite_key_result_greater </item> + <item> composite_key_hash </item> + <item> composite_key_result_hash </item> + + <item> indexed_by </item> + <item> tag </item> + + <!-- boost.optional --> + + <item> optional </item> + + <!-- boost.ref --> + + <item> ref </item> + <item> cref </item> + <item> reference_wrapper </item> + + <!-- boost.bimap --> + + <item> set_of </item> + <item> multiset_of </item> + <item> unordered_set_of </item> + <item> unordered_multiset_of </item> + <item> list_of </item> + <item> vector_of </item> + <item> set_of_relation </item> + <item> multiset_of_relation </item> + <item> unordered_set_of_relation </item> + <item> unordered_multiset_of_relation </item> + <item> list_of_relation </item> + <item> vector_of_relation </item> + + <!-- boost.function --> + + <item> function </item> + +</list> + + + +<list name="boost.classes"> + + <!-- boost.fusion --> + + <item> ignore </item> + + <!-- boost.iterator --> + + <item> iterator_core_access </item> + + <!-- boost.test --> + + <item> execution_monitor </item> + <item> execution_exception </item> + <item> execution_aborted </item> + + +</list> + + +<list name="boost.metaprogramming"> + + <!-- boost.call_traits --> + + <item> call_traits </item> + + <!-- boost.ConceptCheck --> + + <item> function_requires </item> + <item> IntegerConcept </item> + <item> SignedIntegerConcept </item> + <item> UnsignedIntegerConcept </item> + <item> ConvertibleConcept </item> + <item> AssignableConcept </item> + <item> SGIAssignableConcept </item> + <item> DefaultConstructibleConcept </item> + <item> CopyConstructibleConcept </item> + <item> EqualityComparableConcept </item> + <item> LessThanComparableConcept </item> + <item> ComparableConcept </item> + <item> InputIteratorConcept </item> + <item> OutputIteratorConcept </item> + <item> ForwardIteratorConcept </item> + <item> Mutable_ForwardIteratorConcept </item> + <item> BidirectionalIteratorConcept </item> + <item> Mutable_BidirectionalIteratorConcept </item> + <item> RandomAccessIteratorConcept </item> + <item> Mutable_RandomAccessIteratorConcept </item> + <item> GeneratorConcept </item> + <item> UnaryFunctionConcept </item> + <item> BinaryFunctionConcept </item> + <item> UnaryPredicateConcept </item> + <item> BinaryPredicateConcept </item> + <item> Const_BinaryPredicateConcept </item> + <item> AdaptableGeneratorConcept </item> + <item> AdaptableUnaryFunctionConcept </item> + <item> AdaptableBinaryFunctionConcept </item> + <item> AdaptablePredicateConcept </item> + <item> AdaptableBinaryPredicateConcept </item> + <item> ContainerConcept </item> + <item> Mutable_ContainerConcept </item> + <item> ForwardContainerConcept </item> + <item> Mutable_ForwardContainerConcept </item> + <item> ReversibleContainerConcept </item> + <item> Mutable_ReversibleContainerConcept </item> + <item> RandomAccessContainerConcept </item> + <item> Mutable_RandomAccessContainerConcept </item> + <item> SequenceConcept </item> + <item> FrontInsertionSequenceConcept </item> + <item> BackInsertionSequenceConcept </item> + <item> AssociativeContainerConcept </item> + <item> UniqueAssociativeContainerConcept </item> + <item> MultipleAssociativeContainerConcept </item> + <item> SimpleAssociativeContainerConcept </item> + <item> PairAssociativeContainerConcept </item> + <item> SortedAssociativeContainerConcept </item> + <item> null_archetype </item> + <item> default_constructible_archetype </item> + <item> assignable_archetype </item> + <item> copy_constructible_archetype </item> + <item> equality_comparable_archetype </item> + <item> convertible_to_archetype </item> + <item> trivial_iterator_archetype </item> + <item> mutable_trivial_iterator_archetype </item> + <item> input_iterator_archetype </item> + <item> forward_iterator_archetype </item> + <item> bidirectional_iterator_archetype </item> + <item> random_access_iterator_archetype </item> + <item> unary_function_archetype </item> + <item> binary_function_archetype </item> + <item> predicate_archetype </item> + <item> binary_predicate_archetype </item> + + <!-- boost.iterator --> + + <item> ReadableIteratorConcept </item> + <item> WritableIteratorConcept </item> + <item> SwappableIteratorConcept </item> + <item> LvalueIteratorConcept </item> + <item> IncrementableIteratorConcept </item> + <item> SinglePassIteratorConcept </item> + <item> ForwardTraversalConcept </item> + <item> BidirectionalTraversalConcept </item> + <item> RandomAccessTraversalConcept </item> + <item> InteroperableIteratorConcept </item> + + <!-- boost.enable_if --> + + <item> enable_if </item> + <item> disable_if </item> + <item> lazy_enable_if </item> + <item> lazy_disable_if </item> + <item> enable_if_c </item> + <item> disable_if_c </item> + <item> lazy_enable_if_c </item> + <item> lazy_disable_if_c </item> + + <!-- boost.iterator --> + + <item> indirect_reference </item> + <item> pointee </item> + + <!-- boost.mpl --> + + <item> empty_sequence </item> + <item> filter_view </item> + <item> iterator_range </item> + <item> joint_view </item> + <item> single_view </item> + <item> transform_view </item> + <item> zip_view </item> + + <item> at </item> + <item> at_c </item> + <item> back </item> + <item> begin </item> + <item> clear </item> + <item> empty </item> + <item> end </item> + <item> erase </item> + <item> erase_key </item> + <item> front </item> + <item> has_key </item> + <item> insert </item> + <item> insert_range </item> + <item> is_sequence </item> + <item> order </item> + <item> pop_back </item> + <item> pop_front </item> + <item> push_back </item> + <item> push_front </item> + <item> sequence_tag </item> + <item> size </item> + + <item> advance </item> + <item> distance </item> + <item> next </item> + <item> prior </item> + <item> deref </item> + <item> iterator_category </item> + + <item> back_inserter </item> + <item> front_inserter </item> + <item> inserter </item> + + <item> fold </item> + <item> iter_fold </item> + <item> reverse_fold </item> + <item> reverse_iter_fold </item> + <item> accumulate </item> + + <item> find </item> + <item> find_if </item> + <item> contains </item> + <item> count </item> + <item> count_if </item> + <item> lower_bound </item> + <item> upper_bound </item> + <item> min_element </item> + <item> max_element </item> + <item> equal </item> + + <item> copy </item> + <item> copy_if </item> + <item> transform </item> + <item> replace </item> + <item> replace_if </item> + <item> remove </item> + <item> remove_if </item> + <item> unique </item> + <item> partition </item> + <item> stable_partition </item> + <item> sort </item> + <item> reverse </item> + <item> reverse_copy </item> + <item> reverse_copy_if </item> + <item> reverse_transform </item> + <item> reverse_replace </item> + <item> reverse_replace_if </item> + <item> reverse_remove </item> + <item> reverse_remove_if </item> + <item> reverse_unique </item> + <item> reverse_partition </item> + <item> reverse_stable_partition </item> + + <item> if_ </item> + <item> if_c </item> + <item> eval_if </item> + <item> eval_if_c </item> + + <item> apply </item> + <item> apply_wrap </item> + <item> unpack_args </item> + + <item> _ </item> + <item> _1 </item> + <item> _2 </item> + <item> _3 </item> + <item> _4 </item> + <item> _5 </item> + + <item> bind </item> + <item> quote </item> + <item> arg </item> + <item> protect </item> + + <item> plus </item> + <item> minus </item> + <item> times </item> + <item> divides </item> + <item> modulus </item> + <item> negate </item> + + <item> less </item> + <item> less_equal </item> + <item> greater </item> + <item> greater_equal </item> + <item> equal_to </item> + <item> not_equal_to </item> + + <item> and_ </item> + <item> or_ </item> + <item> not_ </item> + + <item> bitand_ </item> + <item> bitor_ </item> + <item> bitxor_ </item> + <item> shift_left </item> + <item> shift_right </item> + + <item> identity </item> + <item> always </item> + <item> inherit </item> + <item> inherit_linearly </item> + <item> numeric_cast </item> + <item> min </item> + <item> max </item> + <item> sizeof_ </item> + + <item> bool_ </item> + <item> int_ </item> + <item> long_ </item> + <item> size_t </item> + <item> integral_c </item> + + <item> pair </item> + <item> empty_base </item> + <item> void_ </item> + + <!-- boost.operators --> + + <item> less_than_comparable </item> + <item> less_than_comparable1 </item> + <item> less_than_comparable2 </item> + + <item> equality_comparable </item> + <item> equality_comparable1 </item> + + <item> equality_comparable2 </item> + + <item> addable </item> + <item> addable1 </item> + + <item> addable2 </item> + + <item> subtractable </item> + <item> subtractable1 </item> + + <item> subtractable2 </item> + + <item> subtractable2_left </item> + + <item> multipliable </item> + <item> multipliable1 </item> + <item> multipliable2 </item> + + <item> dividable </item> + <item> dividable1 </item> + <item> dividable2 </item> + + <item> dividable2_left </item> + + <item> modable </item> + <item> modable1 </item> + <item> modable2 </item> + + <item> modable2_left </item> + + <item> orable </item> + <item> orable1 </item> + <item> orable2 </item> + + <item> andable </item> + <item> andable1 </item> + <item> andable2 </item> + + <item> xorable </item> + <item> xorable1 </item> + <item> xorable2 </item> + + <item> incrementable </item> + <item> decrementable </item> + + <item> left_shiftable </item> + <item> left_shiftable1 </item> + <item> left_shiftable2 </item> + + <item> right_shiftable </item> + <item> right_shiftable1 </item> + <item> right_shiftable2 </item> + + <item> equivalent </item> + <item> equivalent1 </item> + <item> equivalent2 </item> + + <item> partially_ordered </item> + <item> partially_ordered1 </item> + <item> partially_ordered2 </item> + + <item> totally_ordered </item> + <item> totally_ordered1 </item> + <item> totally_ordered2 </item> + + <item> additive </item> + <item> additive1 </item> + <item> additive2 </item> + + <item> multiplicative </item> + <item> multiplicative1 </item> + <item> multiplicative2 </item> + + <item> integer_multiplicative </item> + <item> integer_multiplicative1 </item> + <item> integer_multiplicative2 </item> + + <item> arithmetic </item> + <item> arithmetic1 </item> + <item> arithmetic2 </item> + + <item> integer_arithmetic </item> + <item> integer_arithmetic1 </item> + <item> integer_arithmetic2 </item> + + <item> bitwise </item> + <item> bitwise1 </item> + <item> bitwise2 </item> + + <item> unit_steppable </item> + + <item> shiftable </item> + <item> shiftable1 </item> + <item> shiftable2 </item> + + <item> ring_operators </item> + <item> ring_operators1 </item> + <item> ring_operators2 </item> + + <item> ordered_ring_operators </item> + <item> ordered_ring_operators1 </item> + <item> ordered_ring_operators2 </item> + + <item> field_operators </item> + <item> field_operators1 </item> + <item> field_operators2 </item> + + <item> ordered_field_operators </item> + <item> ordered_field_operators1 </item> + + <item> ordered_field_operators2 </item> + + <item> euclidian_ring_operators </item> + <item> euclidian_ring_operators1 </item> + <item> euclidian_ring_operators2 </item> + + <item> ordered_euclidian_ring_operators </item> + <item> ordered_euclidian_ring_operators1 </item> + <item> ordered_euclidian_ring_operators2 </item> + + <item> operators </item> + <item> operators2 </item> + + <item> dereferenceable </item> + <item> indexable </item> + + <item> input_iteratable </item> + <item> output_iteratable </item> + <item> forward_iteratable </item> + <item> bidirectional_iteratable </item> + <item> random_access_iteratable </item> + + <item> input_iterator_helper </item> + <item> output_iterator_helper </item> + <item> forward_iterator_helper </item> + <item> bidirectional_iterator_helper </item> + <item> random_access_iterator_helper </item> + + <!-- boost.property_map --> + + <item> property_traits </item> + + + <!-- boost.ref --> + + <item> is_reference_wrapper </item> + + <!-- boost.type_traits --> + + <item> add_const </item> + <item> add_cv </item> + <item> add_pointer </item> + <item> add_reference </item> + <item> add_volatile </item> + <item> aligned_storage </item> + <item> alignment_of </item> + <item> extent </item> + <item> function_traits </item> + <item> has_nothrow_assign </item> + <item> has_nothrow_constructor </item> + <item> has_nothrow_copy </item> + <item> has_trivial_assign </item> + <item> has_trivial_constructor </item> + <item> has_trivial_copy </item> + <item> has_trivial_destructor </item> + <item> has_virtual_destructor </item> + <item> integral_constant </item> + <item> is_abstract </item> + <item> is_arithmetic </item> + <item> is_array </item> + <item> is_base_of </item> + <item> is_class </item> + <item> is_compound </item> + <item> is_const </item> + <item> is_convertible </item> + <item> is_empty </item> + <item> is_enum </item> + <item> is_floating_point </item> + <item> is_function </item> + <item> is_fundamental </item> + <item> is_integral </item> + <item> is_member_function_pointer </item> + <item> is_member_object_pointer </item> + <item> is_member_pointer </item> + <item> is_object </item> + <item> is_pod </item> + <item> is_pointer </item> + <item> is_polymorphic </item> + <item> is_same </item> + <item> is_scalar </item> + <item> is_stateless </item> + <item> is_reference </item> + <item> is_union </item> + <item> is_void </item> + <item> is_volatile </item> + <item> rank </item> + <item> remove_all_extents </item> + <item> remove_const </item> + <item> remove_cv </item> + <item> remove_extent </item> + <item> remove_pointer </item> + <item> remove_reference </item> + <item> remove_volatile </item> + <item> type_with_alignment </item> + + + + <!-- boost.utility (TODO) --> + + <item> base_from_member </item> + <item> checked_delete </item> + <item> checked_array_delete </item> + <item> next </item> + <item> prior </item> + <item> noncopyable </item> + <item> addressof </item> + <item> result_of </item> + +</list> + + + + +<list name="boost.exception"> + + <!-- boost.any --> + + <item> bad_any_cast </item> + + <!-- boost.assign --> + + <item> assignment_exception </item> + +</list> + + + +<list name="boost.container"> + + <!-- boost.array --> + + <item> array </item> + + <!-- boost.dynamic_bitset --> + + <item> dynamic_bitset </item> + + <!-- boost.fusion --> + + <item> tuple </item> + + <!-- boost.mpl --> + + <item> range_c </item> + <item> vector_c </item> + <item> list_c </item> + <item> set_c </item> + + <!-- boost.multi_index --> + + <item> multi_index_container </item> + + <!-- boost.bimap --> + + <item> bimap </item> + + <!-- boost.property_map --> + + <item> identity_property_map </item> + <item> iterator_property_map </item> + <item> associative_property_map </item> + <item> const_associative_property_map </item> + <item> vector_property_map </item> + +</list> + + + + +<list name="boost.macro"> + + <!-- boost.ConceptCheck --> + + <item> BOOST_CLASS_REQUIRE </item> + + <!-- boost.fusion --> + + <item> FUSION_MAX_VECTOR_SIZE </item> + <item> FUSION_MAX_LIST_SIZE </item> + <item> FUSION_MAX_SET_SIZE </item> + <item> FUSION_MAX_MAP_SIZE </item> + + <!-- boost.mpl --> + + <item> BOOST_MPL_ASSERT </item> + <item> BOOST_MPL_ASSERT_MSG </item> + <item> BOOST_MPL_ASSERT_NOT </item> + <item> BOOST_MPL_ASSERT_RELATION </item> + + <item> BOOST_MPL_HAS_XXX_TRAIT_DEF </item> + <item> BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF </item> + + <item> BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS </item> + <item> BOOST_MPL_CFG_NO_HAS_XXX </item> + <item> BOOST_MPL_LIMIT_METAFUNCTION_ARITY </item> + <item> BOOST_MPL_LIMIT_VECTOR_SIZE </item> + <item> BOOST_MPL_LIMIT_LIST_SIZE </item> + <item> BOOST_MPL_LIMIT_SET_SIZE </item> + <item> BOOST_MPL_LIMIT_MAP_SIZE </item> + <item> BOOST_MPL_LIMIT_UNROLLING </item> + + <item> BOOST_MPL_AUX_LAMBDA_SUPPORT </item> + + <!-- boost.multi_index --> + + <item> BOOST_MULTI_INDEX_MEMBER </item> + <item> BOOST_MULTI_INDEX_CONST_MEM_FUN </item> + <item> BOOST_MULTI_INDEX_MEM_FUN </item> + + <!-- boost.static_assert --> + + <item> BOOST_STATIC_ASSERT </item> + + <!-- boost.test --> + + <item> BOOST_TEST_CATCH_SYSTEM_ERRORS </item> + <item> BOOST_PRG_MON_CONFIRM </item> + <item> BOOST_TEST_DONT_PRINT_LOG_VALUE </item> + + <item> BOOST_CHECK </item> + <item> BOOST_CHECK_PRED </item> + <item> BOOST_CHECK_MSG </item> + <item> BOOST_CHECK_EQUAL </item> + <item> BOOST_CHECK_CLOSE </item> + <item> BOOST_CHECK_SMALL </item> + <item> BOOST_CHECK_BITWISE_EQUAL </item> + + <item> BOOST_WARN </item> + <item> BOOST_WARN_PRED </item> + <item> BOOST_WARN_MSG </item> + <item> BOOST_WARN_EQUAL </item> + <item> BOOST_WARN_CLOSE </item> + <item> BOOST_WARN_SMALL </item> + <item> BOOST_WARN_BITWISE_EQUAL </item> + + <item> BOOST_REQUIRE </item> + <item> BOOST_REQUIRE_PRED </item> + <item> BOOST_REQUIRE_MSG </item> + <item> BOOST_REQUIRE_EQUAL </item> + <item> BOOST_REQUIRE_CLOSE </item> + <item> BOOST_REQUIRE_SMALL </item> + <item> BOOST_REQUIRE_BITWISE_EQUAL </item> + + <item> BOOST_PASS </item> + <item> BOOST_PASS_PRED </item> + <item> BOOST_PASS_MSG </item> + <item> BOOST_PASS_EQUAL </item> + <item> BOOST_PASS_CLOSE </item> + <item> BOOST_PASS_SMALL </item> + <item> BOOST_PASS_BITWISE_EQUAL </item> + + <item> BOOST_MSG_ONLY </item> + <item> BOOST_SET_CHECKPOINT </item> + <item> BOOST_CHECK_PRED_WITH_ARGS </item> + <item> BOOST_CHECK_EQUAL_COLL </item> + + <item> BOOST_ERROR </item> + <item> BOOST_FAIL </item> + +</list> + + +<list name="boost.fusion.result_of"> + + <item> advance_c </item> + <item> next </item> + <item> equal_to </item> + <item> advance </item> + <item> distance </item> + <item> deref </item> + <item> value_of </item> + <item> prior </item> + <item> begin </item> + <item> end </item> + <item> size </item> + <item> empty </item> + <item> front </item> + <item> back </item> + +</list> + + + + +<list name="boost.concepts.member.functions"> + + <!-- boost.iterator --> + + <item> dereference </item> + <item> equal </item> + <item> increment </item> + <item> decrement </item> + <item> advance </item> + <item> distance_to </item> + <item> begin </item> + <item> end </item> + <item> size </item> + <item> max_size </item> + <item> empty </item> + <item> swap </item> + <item> rbegin </item> + <item> rend </item> + <item> front </item> + <item> insert </item> + <item> erase </item> + <item> clear </item> + <item> resize </item> + <item> push_front </item> + <item> pop_front </item> + <item> push_back </item> + <item> pop_back </item> + <item> erase </item> + <item> clear </item> + <item> find </item> + <item> count </item> + <item> equal_range </item> + <item> key_comp </item> + <item> lower_bound </item> + <item> upper_bound </item> + <item> equal_range </item> + <item> get_allocator </item> + <item> hash_function </item> + <item> key_eq </item> + <item> bucket_count </item> + <item> max_bucket_count </item> + <item> bucket_size </item> + <item> bucket </item> + <item> load_factor </item> + <item> max_load_factor </item> + <item> at </item> + +</list> + + + + +<list name="boost.concepts.free.functions"> + + <!-- boost.test --> + + <item> cpp_main </item> + <item> test_main </item> + +</list> + + + + +<list name="boost.tags"> + + <!-- boost.iterator --> + + <item> readable_iterator_t </item> + <item> writable_iterator_t </item> + <item> readable_writable_iterator_t </item> + <item> readable_lvalue_iterator_t </item> + <item> writable_lvalue_iterator_t </item> + + <!-- boost.property_map --> + + <item> readable_property_map_tag </item> + <item> writable_property_map_tag </item> + <item> read_write_property_map_tag </item> + <item> lvalue_property_map_tag </item> + +</list> + + + + +<list name="boost.member.functions"> + + <item> base </item> + <item> base_reference </item> + +</list> + +<list name="boost.constants"> + + <!-- boost.test --> + <item> exit_success </item> + <item> exit_failure </item> + <item> exit_exception_failure </item> + +</list> + +<list name="boost.concepts.member.typedef"> + + <item> value_type </item> + <item> iterator </item> + <item> const_iterator </item> + <item> reference </item> + <item> const_reference </item> + <item> pointer </item> + <item> difference_type </item> + <item> size_type </item> + <item> reverse_iterator </item> + <item> const_reverse_iterator </item> + <item> key_type </item> + <item> data_type </item> + <item> hasher </item> + <item> key_equal </item> + <item> local_iterator </item> + <item> const_local_iterator </item> + <item> key_compare </item> + <item> value_compare </item> + <item> iterator_category </item> + <item> value_type </item> + <item> difference_type </item> + <item> pointer </item> + <item> reference </item> + +</list> + +<list name="boost.namespaces" > + + <item> std </item> + <item> boost </item> + <item> assign </item> + <item> bimaps </item> + <item> call_traits </item> + <item> concept_check </item> + <item> conversion </item> + <item> date_time </item> + <item> dynamic_bitset </item> + <item> enable_if </item> + <item> filesystem </item> + <item> format </item> + <item> hash </item> + <item> graph </item> + <item> integer </item> + <item> in_place_factory </item> + <item> io_state_saver </item> + <item> iostream </item> + <item> lambda </item> + <item> math </item> + <item> minmax </item> + <item> mpl </item> + <item> multi_array </item> + <item> multi_index </item> + <item> numeric </item> + <item> operators </item> + <item> parameter </item> + <item> pointer_container </item> + <item> pool </item> + <item> preprocesor </item> + <item> program_options </item> + <item> property_map </item> + <item> python </item> + <item> random </item> + <item> regex </item> + <item> serialization </item> + <item> signals </item> + <item> smart_ptr </item> + <item> static_assert </item> + <item> spirit </item> + <item> string_algo </item> + <item> test </item> + <item> thread </item> + <item> timer </item> + <item> tokenizer </item> + <item> tribool </item> + <item> tuples </item> + <item> type_traits </item> + <item> uBLAS </item> + <item> utility </item> + <item> value_initialized </item> + <item> wave </item> + <item> fusion </item> + +</list> + + +<!-- TODO LIST BEGIN + +<list name="boost.date_time"> + + <item> day_functor </item> + <item> month_functor </item> + <item> week_functor </item> + <item> year_functor </item> + <item> c_local_adjustor </item> + <item> c_time </item> + <item> constrained_value </item> + <item> date </item> + <item> day_clock </item> + <item> weekdays::Sunday </item> + <item> weekdays::Monday </item> + <item> weekdays::Tuesday </item> + <item> weekdays::Wednesday </item> + <item> weekdays::Thursday </item> + <item> weekdays::Friday </item> + <item> weekdays::Saturday </item> + <item> weekdays </item> + <item> months_of_year::Jan </item> + <item> months_of_year::Feb </item> + <item> months_of_year::Mar </item> + <item> months_of_year::Apr </item> + <item> months_of_year::May </item> + <item> months_of_year::Jun </item> + <item> months_of_year::Jul </item> + <item> months_of_year::Aug </item> + <item> months_of_year::Sep </item> + <item> months_of_year::Oct </item> + <item> months_of_year::Nov </item> + <item> months_of_year::Dec </item> + <item> months_of_year </item> + <item> NotAMonth </item> + <item> NumMonths </item> + <item> date_duration </item> + <item> duration_traits_long </item> + <item> duration_traits_adapted </item> + <item> weeks_duration </item> + <item> months_duration </item> + <item> years_duration </item> + <item> date_facet </item> + <item> date_input_facet </item> + <item> simple_format </item> + <item> month_formatter </item> + <item> ymd_formatter </item> + <item> date_formatter </item> + <item> ostream_month_formatter </item> + <item> ostream_weekday_formatter </item> + <item> ostream_ymd_formatter </item> + <item> ostream_date_formatter </item> + <item> date_generator_formatter </item> + <item> date_generator_parser </item> + <item> year_based_generator </item> + <item> partial_date </item> + <item> nth_kday_of_month </item> + <item> first_kday_of_month </item> + <item> last_kday_of_month </item> + <item> first_kday_after </item> + <item> first_kday_before </item> + <item> days_until_weekday </item> + <item> days_before_weekday </item> + <item> next_weekday </item> + <item> previous_weekday </item> + <item> date_itr_base </item> + <item> date_itr </item> + <item> date_resolutions </item> + <item> date_resolutions::day </item> + <item> date_resolutions::week </item> + <item> date_resolutions::months </item> + <item> date_resolutions::year </item> + <item> date_resolutions::decade </item> + <item> date_resolutions::century </item> + <item> date_names_put </item> + <item> all_date_names_put </item> + <item> dst_calculator </item> + <item> dst_calc_engine </item> + <item> us_dst_rules </item> + <item> null_dst_rules </item> + <item> dst_day_calc_rule </item> + <item> day_calc_dst_rule </item> + <item> time_from_ftime </item> + <item> format_date_parser </item> + <item> gregorian_calendar_base </item> + <item> iso_format_base </item> + <item> iso_format </item> + <item> iso_extended_format </item> + <item> utc_adjustment </item> + <item> dynamic_local_time_adjustor </item> + <item> class static_local_time_adjustor </item> + <item> local_adjustor </item> + <item> us_dst_trait </item> + <item> eu_dst_trait </item> + <item> uk_dst_trait </item> + <item> acst_dst_trait </item> + <item> microsec_clock </item> + <item> month_format_spec </item> + <item> month_format_spec::month_as_integer </item> + <item> month_format_spec::month_as_short_string </item> + <item> month_format_spec::month_as_long_string </item> + <item> ymd_order_spec </item> + <item> period </item> + <item> period_formatter </item> + <item> period_parser </item> + <item> special_values </item> + <item> special_values::not_a_date_time </item> + <item> special_values::neg_infin </item> + <item> special_values::pos_infin </item> + <item> special_values::min_date_time </item> + <item> special_values::max_date_time </item> + <item> special_values::not_special </item> + <item> special_values_formatter </item> + <item> special_values_parser </item> + <item> convert_string_type </item> + <item> gather_month_strings </item> + <item> gather_weekday_strings </item> + <item> base_time </item> + <item> second_clock </item> + <item> time_resolutions </item> + <item> time_resolutions::sec </item> + <item> time_resolutions::tenth </item> + <item> time_resolutions::hundreth </item> + <item> time_resolutions::milli </item> + <item> time_resolutions::ten_thousandth </item> + <item> time_resolutions::micro </item> + <item> time_resolutions::nano </item> + <item> dst_flags </item> + <item> dst_flags::not_dst </item> + <item> dst_flags::is_dst </item> + <item> dst_flags::calculate </item> + <item> time_duration </item> + <item> subsecond_duration </item> + <item> time_formats </item> + <item> time_facet </item> + <item> time_input_facet </item> + <item> ostream_time_duration_formatter </item> + <item> ostream_time_formatter </item> + <item> ostream_time_period_formatter </item> + <item> time_itr </item> + <item> parse_delimited_time_duration </item> + <item> parse_delimited_time </item> + <item> parse_undelimited_time_duration </item> + <item> parse_iso_time </item> + <item> time_resolution_traits </item> + <item> counted_time_rep </item> + <item> counted_time_system </item> + <item> split_timedate_system </item> + <item> time_zone_base </item> + <item> dst_adjustment_offsets </item> + <item> time_zone_names_base </item> + <item> time_zone_names </item> + <item> year_month_day_base </item> + + <item> gregorian_calendar </item> + <item> fancy_date_rep </item> + <item> bad_day_of_month </item> + <item> greg_day </item> + <item> greg_day_policies </item> + <item> greg_day_rep </item> + <item> bad_day_of_year </item> + <item> greg_day_of_year_policies </item> + <item> greg_day_of_year_rep </item> + <item> date_duration_rep </item> + <item> date_duration </item> + <item> greg_durations_config </item> + <item> months </item> + <item> years </item> + <item> weeks </item> + <item> bad_month </item> + <item> greg_month </item> + <item> greg_month_policies </item> + <item> greg_month_rep </item> + <item> bad_weekday </item> + <item> greg_weekday </item> + <item> greg_weekday_policies </item> + <item> greg_weekday_rep </item> + <item> bad_year </item> + <item> greg_year </item> + <item> greg_year_policies </item> + <item> greg_year_rep </item> + <item> greg_year_month_day </item> + <item> date_period </item> + <item> day_clock </item> + <item> date_iterator </item> + <item> day_iterator </item> + <item> week_iterator </item> + <item> month_iterator </item> + <item> year_iterator </item> + <item> date_from_iso_string </item> + <item> from_streamdate_period_from_string </item> + <item> date_period_from_wstring </item> + + <item> ptime </item> + <item> time_duration </item> + <item> simple_time_rep </item> + <item> posix_time_system_config </item> + <item> millisec_posix_time_system_config </item> + <item> hours </item> + <item> minutes </item> + <item> seconds </item> + <item> millisec </item> + <item> milliseconds </item> + <item> microsec </item> + <item> microseconds </item> + <item> nanosec </item> + <item> nanoseconds </item> + <item> posix_time_system </item> + <item> time_iterator </item> + <item> second_clock </item> + <item> microsec_clock </item> + <item> no_dst </item> + <item> us_dst </item> + <item> duration_from_string </item> + <item> time_from_string </item> + <item> time_period </item> + + <item> to_tm </item> + <item> custom_time_zone </item> + <item> dst_calc_rule_ptr </item> + <item> dst_calc_rule </item> + <item> partial_date_dst_rule </item> + <item> first_last_dst_rule </item> + <item> last_last_dst_rule </item> + <item> nth_last_dst_rule </item> + <item> nth_kday_dst_rule </item> + <item> nth_day_of_the_week_in_month_dst_rule </item> + <item> ambiguous_result </item> + <item> time_label_invalid </item> + <item> dst_not_valid </item> + <item> local_date_time_base </item> + <item> local_date_time </item> + <item> BOOST_SERIALIZATION_SPLIT_FREE </item> + <item> local_time_period </item> + <item> local_time_iterator </item> + <item> local_sec_clock </item> + <item> local_microsec_clock </item> + <item> time_zone_ptr </item> + +</list> + +<list name="boost.filesystem"> + + <item> path </item> + <item> portable_posix_name </item> + <item> windows_name </item> + <item> portable_name </item> + <item> portable_directory_name </item> + <item> portable_file_name </item> + <item> no_check </item> + <item> native </item> + + <item> directory_iterator </item> + <item> exists </item> + <item> symbolic_link_exists </item> + <item> is_directory </item> + <item> is_empty </item> + <item> equivalent </item> + <item> file_size </item> + <item> last_write_time </item> + <item> create_directory </item> + <item> remove </item> + <item> remove_all </item> + <item> rename </item> + <item> copy_file </item> + <item> initial_path </item> + <item> current_path </item> + <item> complete </item> + <item> system_complete </item> + + <item> error_code </item> + <item> error_code::no_error </item> + <item> error_code::system_error </item> + <item> error_code::other_error </item> + <item> error_code::security_error </item> + <item> error_code::read_only_error </item> + <item> error_code::io_error </item> + <item> error_code::path_error </item> + <item> error_code::not_found_error </item> + <item> error_code::not_directory_error </item> + <item> error_code::busy_error </item> + <item> error_code::already_exists_error </item> + <item> error_code::not_empty_error </item> + <item> error_code::error_code::is_directory_error </item> + <item> error_code::out_of_space_error </item> + <item> error_code::out_of_memory_error </item> + <item> error_code::out_of_resource_error </item> + <item> filesystem_error </item> + + <item> create_directories </item> + <item> extension </item> + <item> basename </item> + <item> change_extension </item> + +</list> + +<list name="boost.format"> + + <item> basic_format </item> + <item> format </item> + <item> wformat </item> + +</list> + +<list name="boost.function"> + + <item> bad_function_call </item> + <item> function_base </item> + <item> functionN </item> + <item> function </item> + <item> function_equal </item> + +</list> + +<list name="boost.graph"> + +</list> + +<list name="boost.integer"> + + <item> integer_traits </item> + + <item> int_fast_t </item> + <item> int_t </item> + <item> uint_t </item> + <item> int_max_value_t </item> + <item> int_min_value_t </item> + <item> uint_value_t </item> + + <item> high_bit_mask_t </item> + <item> low_bits_mask_t </item> + + <item> static_log2 </item> + + <item> static_signed_min </item> + <item> static_signed_max </item> + <item> static_unsigned_min </item> + <item> static_unsigned_max </item> + +</list> + +<list name="boost.interval"> + + <item> interval_policies </item> + <item> interval </item> + <item> lower </item> + <item> upper </item> + <item> width </item> + <item> median </item> + <item> norm </item> + <item> singleton </item> + <item> in_zero </item> + <item> subset </item> + <item> proper_subset </item> + <item> overlap </item> + <item> intersection </item> + <item> hull </item> + <item> bisect </item> + <item> division_part1 </item> + <item> division_part2 </item> + <item> multiplicative_inverse </item> + +</list> + +<list name="boost.in_place_factory"> + + <item> in_place_factory_base </item> + <item> in_place_factory </item> + <item> in_place </item> + <item> typed_in_place_factory_base </item> + <item> typed_in_place_factory </item> + +</list> + +<list name="boost.io_state_saver"> + + <item> ios_flags_saver </item> + <item> ios_precision_saver </item> + <item> ios_width_saver </item> + <item> ios_base_all_saver </item> + <item> basic_ios_iostate_saver </item> + <item> basic_ios_exception_saver </item> + <item> basic_ios_tie_saver </item> + <item> basic_ios_rdbuf_saver </item> + <item> basic_ios_fill_saver </item> + <item> basic_ios_locale_saver </item> + <item> basic_ios_all_saver </item> + <item> ios_iostate_saver </item> + <item> wios_iostate_saver </item> + <item> ios_exception_saver </item> + <item> wios_exception_saver </item> + <item> ios_tie_saver </item> + <item> wios_tie_saver </item> + <item> ios_rdbuf_saver </item> + <item> wios_rdbuf_saver </item> + <item> ios_fill_saver </item> + <item> wios_fill_saver </item> + <item> ios_locale_saver </item> + <item> wios_locale_saver </item> + <item> ios_all_saver </item> + <item> wios_all_saver </item> + <item> ios_iword_saver </item> + <item> ios_pword_saver </item> + <item> ios_all_word_saver </item> + +</list> + +<list name="boost.iostream"> + + <item> aggregate_filter </item> + <item> array </item> + <item> array_sink </item> + <item> array_source </item> + <item> back_insert_device </item> + <item> basic_array </item> + <item> basic_array_sink </item> + <item> basic_array_source </item> + <item> basic_bzip2_compressor </item> + <item> basic_bzip2_decompressor </item> + <item> basic_counter </item> + <item> basic_file </item> + <item> basic_file_sink </item> + <item> basic_file_source </item> + <item> basic_gzip_compressor </item> + <item> basic_gzip_decompressor </item> + <item> basic_line_filter </item> + <item> basic_null_device </item> + <item> basic_null_sink </item> + <item> basic_null_source </item> + <item> basic_regex_filter </item> + <item> basic_stdio_filter </item> + <item> basic_zlib_compressor </item> + <item> basic_zlib_decompressor </item> + <item> bzip2_compressor </item> + <item> bzip2_decompressor </item> + <item> bzip2_error </item> + <item> bzip2_params </item> + <item> category_of </item> + <item> chain </item> + <item> char_traits </item> + <item> char_type_of </item> + <item> code_converter </item> + <item> combination </item> + <item> composite </item> + <item> counter </item> + <item> device </item> + <item> dual_use_filter </item> + <item> dual_use_wfilter </item> + <item> file </item> + <item> file_descriptor </item> + <item> file_descriptor_sink </item> + <item> file_descriptor_source </item> + <item> file_sink </item> + <item> file_source </item> + <item> filtering_stream </item> + <item> filtering_streambuf </item> + <item> filter </item> + <item> gzip_compressor </item> + <item> gzip_decompressor </item> + <item> gzip_error </item> + <item> gzip_params </item> + <item> input_filter </item> + <item> input_wfilter </item> + <item> inverse </item> + <item> line_filter </item> + <item> mapped_file </item> + <item> mapped_file_sink </item> + <item> mapped_file_source </item> + <item> mode_of </item> + <item> multichar_dual_use_filter </item> + <item> multichar_dual_use_wfilter </item> + <item> multichar_filter </item> + <item> multichar_input_filter </item> + <item> multichar_input_wfilter </item> + <item> multichar_output_filter </item> + <item> multichar_output_wfilter </item> + <item> multichar_wfilter </item> + <item> newline_filter </item> + <item> null_sink </item> + <item> null_source </item> + <item> output_filter </item> + <item> output_wfilter </item> + <item> regex_filter </item> + <item> restriction </item> + <item> seekable_filter </item> + <item> seekable_wfilter </item> + <item> sink </item> + <item> source </item> + <item> stdio_filter </item> + <item> stream </item> + <item> stream_buffer </item> + <item> symmetric_filter </item> + <item> tee_device </item> + <item> tee_filter </item> + <item> warray </item> + <item> warray_sink </item> + <item> warray_source </item> + <item> wchain </item> + <item> wcounter </item> + <item> wdevice </item> + <item> wfile </item> + <item> wfile_sink </item> + <item> wfile_source </item> + <item> wfilter </item> + <item> wline_filter </item> + <item> wnull_sink </item> + <item> wnull_source </item> + <item> wregex_filter </item> + <item> wsink </item> + <item> wsource </item> + <item> wstdio_filter </item> + <item> zlib_compressor </item> + <item> zlib_decompressor </item> + <item> zlib_error </item> + <item> zlib_params </item> + + <item> back_inserter </item> + <item> close </item> + <item> combine </item> + <item> compose </item> + <item> copy </item> + <item> flush </item> + <item> get </item> + <item> imbue </item> + <item> invert </item> + <item> offset_to_position </item> + <item> optimal_buffer_size </item> + <item> position_to_offset </item> + <item> put </item> + <item> putback </item> + <item> read </item> + <item> restrict </item> + <item> seek </item> + <item> tee </item> + <item> test_filter_pair </item> + <item> test_input_filter </item> + <item> test_output_filter </item> + <item> write </item> + + <item> BOOST_IOS </item> + <item> BOOST_IOSTREAMS_BASIC_ISTREAM </item> + <item> BOOST_IOSTREAMS_BASIC_IOS </item> + <item> BOOST_IOSTREAMS_BASIC_IOSTREAM </item> + <item> BOOST_IOSTREAMS_BASIC_OSTREAM </item> + <item> BOOST_IOSTREAMS_BASIC_STREAMBUF </item> + <item> BOOST_IOSTREAMS_CHAR_TRAITS </item> + <item> BOOST_IOSTREAMS_COMPONENT </item> + <item> BOOST_IOSTREAMS_COMPONENT_TYPE </item> + <item> BOOST_IOSTREAMS_DEFAULT_DEVICE_BUFFER_SIZE </item> + <item> BOOST_IOSTREAMS_DEFAULT_FILTER_BUFFER_SIZE </item> + <item> BOOST_IOSTREAMS_DEFAULT_PBACK_BUFFER_SIZE </item> + <item> BOOST_IOSTREAMS_FAILURE </item> + <item> BOOST_IOSTREAMS_PIPABLE </item> + <item> BOOST_IOSTREAMS_PUBSEEKOFF </item> + <item> BOOST_IOSTREAMS_PUBSEEKPOS </item> + <item> BOOST_IOSTREAMS_PUBSYNC </item> + +</list> + +<list name="boost.lambda"> + + <item> _1 </item> + <item> _2 </item> + <item> _3 </item> + + <item> placeholder1_type </item> + <item> placeholder2_type </item> + <item> placeholder3_type </item> + + <item> bind </item> + + <item> ret </item> + <item> var </item> + <item> constant </item> + <item> var_type </item> + <item> constant_type </item> + + <item> if_then </item> + <item> if_then_else </item> + <item> if_then_else_return </item> + <item> while_loop </item> + <item> do_while_loop </item> + <item> for_loop </item> + <item> switch_statement </item> + <item> case_statement </item> + <item> default_statement </item> + + <item> if_ </item> + <item> else_ </item> + <item> while_ </item> + <item> do_ </item> + <item> for_ </item> + + <item> try_catch </item> + <item> catch_exception </item> + <item> catch_all </item> + + <item> constructor </item> + <item> destructor </item> + <item> destructor </item> + <item> new_ptr </item> + <item> new_array </item> + <item> delete_ptr </item> + <item> delete_array </item> + + <item> unlambda </item> + <item> protect </item> + + <item> make_const </item> + <item> const_parameters </item> + <item> break_const </item> + + <item> ll_static_cast </item> + <item> ll_dynamic_cast </item> + <item> ll_const_cast </item> + <item> ll_reinterpret_cast </item> + + <item> ll_sizeof </item> + <item> ll_typeid </item> + + <item> call_begin </item> + <item> call_end </item> + +</list> + +<list name="boost.math"> + + <item> quaternion </item> + <item> octonion </item> + + <item> gcd </item> + <item> lcm </item> + <item> static_gcd </item> + <item> static_lcm </item> + <item> gcd_evaluator </item> + <item> lcm_evaluator </item> + + <item> acosh </item> + <item> asinh </item> + <item> atanh </item> + <item> sinc </item> + <item> sinhc </item> + +</list> + +<list name="boost.minmax"> + + <item> minmax </item> + <item> minmax_element </item> + <item> first_min_element </item> + <item> last_min_element </item> + <item> first_max_element </item> + <item> last_max_element </item> + <item> first_min_first_max_element </item> + <item> first_min_last_max_element </item> + <item> last_min_first_max_element </item> + <item> last_min_last_max_element </item> + +</list> + +<list name="boost.multi_array"> + + <item> multi_array_types </item> + <item> multi_array_types::index </item> + <item> multi_array_types::size_type </item> + <item> multi_array_types::difference_type </item> + <item> multi_array_types::index_range </item> + <item> multi_array_types::extent_range </item> + <item> multi_array_types::index_gen </item> + <item> multi_array_types::extent_gen </item> + + <item> multi_array </item> + <item> multi_array_ref </item> + <item> const_multi_array_ref </item> + + <item> extents </item> + <item> indices </item> + + <item> subarray_gen </item> + <item> const_subarray_gen </item> + <item> array_view_gen </item> + <item> const_array_view_gen </item> + + <item> c_storage_order </item> + <item> fortran_storage_order </item> + <item> general_storage_order </item> + +</list> + +<list name="boost.numeric"> + + <item> converter </item> + <item> bounds </item> + + <item> int_float_mixture_enum </item> + + <item> int_float_mixture_enum::integral_to_integral </item> + <item> int_float_mixture_enum::integral_to_float </item> + <item> int_float_mixture_enum::float_to_integral </item> + <item> int_float_mixture_enum::float_to_float </item> + + <item> sign_mixture_enum </item> + <item> sign_mixture_enum::unsigned_to_unsigned </item> + <item> sign_mixture_enum::signed_to_signed </item> + <item> sign_mixture_enum::signed_to_unsigned </item> + <item> sign_mixture_enum::unsigned_to_signed </item> + + <item> udt_builtin_mixture_enum </item> + <item> udt_builtin_mixture_enum::builtin_to_builtin </item> + <item> udt_builtin_mixture_enum::builtin_to_udt </item> + <item> udt_builtin_mixture_enum::udt_to_builtin </item> + <item> udt_builtin_mixture_enum::udt_to_udt </item> + + <item> int_float_mixture </item> + <item> sign_mixture </item> + <item> udt_builtin_mixture </item> + <item> is_subranged </item> + + <item> conversion_traits </item> + + <item> range_check_result </item> + <item> range_check_result::cInRange </item> + <item> range_check_result::cNegOverflow </item> + <item> range_check_result::cPosOverflow </item> + + <item> def_overflow_handler </item> + <item> silent_overflow_handler </item> + + <item> bad_numeric_cast </item> + <item> negative_overflow </item> + <item> positive_overflow </item> + + <item> Trunc </item> + <item> RoundEven </item> + <item> Ceil </item> + <item> Floor </item> + + <item> raw_numeric_converter </item> + + <item> UseInternalRangeChecker </item> + + <item> numeric_cast </item> + +</list> + +<list name="boost.parameter"> + + <item> BOOST_PARAMETER_KEYWORD </item> + <item> BOOST_PARAMETER_FUN </item> + <item> BOOST_PARAMETER_MATCH </item> + +</list> + +<list name="boost.pointer_container"> + + <item> new_clone </item> + <item> delete_clone </item> + <item> allocate_clone </item> + <item> deallocate_clone </item> + <item> heap_clone_allocator </item> + <item> view_clone_allocator </item> + + <item> ptr_sequence_adapter </item> + <item> ptr_set_adapter </item> + <item> ptr_multiset_adapter </item> + <item> ptr_map_adapter </item> + <item> ptr_multimap_adapter </item> + + <item> ptr_vector </item> + <item> ptr_deque </item> + <item> ptr_list </item> + <item> ptr_array </item> + + <item> ptr_set </item> + <item> ptr_multiset </item> + <item> ptr_map </item> + <item> ptr_multimap </item> + + <item> nullable </item> + <item> bad_ptr_container_operation </item> + <item> bad_index </item> + <item> bad_pointer </item> + +</list> + +<list name="boost.pool"> + + <item> pool </item> + <item> object_pool </item> + <item> singleton_pool </item> + <item> pool_allocator </item> + +</list> + +<list name="boost.preprocesor"> + + <item> BOOST_PP_ADD </item> + <item> BOOST_PP_ADD_D </item> + <item> BOOST_PP_AND </item> + <item> BOOST_PP_APPLY </item> + <item> BOOST_PP_ARRAY_DATA </item> + <item> BOOST_PP_ARRAY_ELEM </item> + <item> BOOST_PP_ARRAY_INSERT </item> + <item> BOOST_PP_ARRAY_INSERT_D </item> + <item> BOOST_PP_ARRAY_POP_BACK </item> + <item> BOOST_PP_ARRAY_POP_BACK_Z </item> + <item> BOOST_PP_ARRAY_POP_FRONT </item> + <item> BOOST_PP_ARRAY_POP_FRONT_Z </item> + <item> BOOST_PP_ARRAY_PUSH_BACK </item> + <item> BOOST_PP_ARRAY_PUSH_FRONT </item> + <item> BOOST_PP_ARRAY_REMOVE </item> + <item> BOOST_PP_ARRAY_REMOVE_D </item> + <item> BOOST_PP_ARRAY_REPLACE </item> + <item> BOOST_PP_ARRAY_REPLACE_D </item> + <item> BOOST_PP_ARRAY_REVERSE </item> + <item> BOOST_PP_ARRAY_SIZE </item> + <item> BOOST_PP_ASSERT </item> + <item> BOOST_PP_ASSERT_MSG </item> + <item> BOOST_PP_ASSIGN_SLOT </item> + <item> BOOST_PP_BITAND </item> + <item> BOOST_PP_BITNOR </item> + <item> BOOST_PP_BITOR </item> + <item> BOOST_PP_BITXOR </item> + <item> BOOST_PP_BOOL </item> + <item> BOOST_PP_CAT </item> + <item> BOOST_PP_COMMA </item> + <item> BOOST_PP_COMMA_IF </item> + <item> BOOST_PP_COMPL </item> + <item> BOOST_PP_CONFIG_EXTENDED_LINE_INFO </item> + <item> BOOST_PP_DEC </item> + <item> BOOST_PP_DEDUCE_D </item> + <item> BOOST_PP_DEDUCE_R </item> + <item> BOOST_PP_DEDUCE_Z </item> + <item> BOOST_PP_DIV </item> + <item> BOOST_PP_DIV_D </item> + <item> BOOST_PP_EMPTY </item> + <item> BOOST_PP_ENUM </item> + <item> BOOST_PP_ENUM_BINARY_PARAMS </item> + <item> BOOST_PP_ENUM_BINARY_PARAMS_Z </item> + <item> BOOST_PP_ENUM_PARAMS </item> + <item> BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT </item> + <item> BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS </item> + <item> BOOST_PP_ENUM_PARAMS_Z </item> + <item> BOOST_PP_ENUM_SHIFTED </item> + <item> BOOST_PP_ENUM_SHIFTED_PARAMS </item> + <item> BOOST_PP_ENUM_SHIFTED_PARAMS_Z </item> + <item> BOOST_PP_ENUM_TRAILING </item> + <item> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS </item> + <item> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z </item> + <item> BOOST_PP_ENUM_TRAILING_PARAMS </item> + <item> BOOST_PP_ENUM_TRAILING_PARAMS_Z </item> + <item> BOOST_PP_EQUAL </item> + <item> BOOST_PP_EQUAL_D </item> + <item> BOOST_PP_EXPAND </item> + <item> BOOST_PP_EXPR_IF </item> + <item> BOOST_PP_EXPR_IIF </item> + <item> BOOST_PP_FILENAME_x </item> + <item> BOOST_PP_FOR </item> + <item> BOOST_PP_FRAME_FINISH </item> + <item> BOOST_PP_FRAME_FLAGS </item> + <item> BOOST_PP_FRAME_ITERATION </item> + <item> BOOST_PP_FRAME_START </item> + <item> BOOST_PP_GREATER </item> + <item> BOOST_PP_GREATER_D </item> + <item> BOOST_PP_GREATER_EQUAL </item> + <item> BOOST_PP_GREATER_EQUAL_D </item> + <item> BOOST_PP_IDENTITY </item> + <item> BOOST_PP_IF </item> + <item> BOOST_PP_IIF </item> + <item> BOOST_PP_INC </item> + <item> BOOST_PP_INCLUDE_SELF </item> + <item> BOOST_PP_INDIRECT_SELF </item> + <item> BOOST_PP_INTERCEPT </item> + <item> BOOST_PP_IS_ITERATING </item> + <item> BOOST_PP_IS_SELFISH </item> + <item> BOOST_PP_ITERATE </item> + <item> BOOST_PP_ITERATION </item> + <item> BOOST_PP_ITERATION_DEPTH </item> + <item> BOOST_PP_ITERATION_FINISH </item> + <item> BOOST_PP_ITERATION_FLAGS </item> + <item> BOOST_PP_ITERATION_LIMITS </item> + <item> BOOST_PP_ITERATION_START </item> + <item> BOOST_PP_LESS </item> + <item> BOOST_PP_LESS_D </item> + <item> BOOST_PP_LESS_EQUAL </item> + <item> BOOST_PP_LESS_EQUAL_D </item> + <item> BOOST_PP_LIMIT_DIM </item> + <item> BOOST_PP_LIMIT_FOR </item> + <item> BOOST_PP_LIMIT_ITERATION </item> + <item> BOOST_PP_LIMIT_ITERATION_DIM </item> + <item> BOOST_PP_LIMIT_MAG </item> + <item> BOOST_PP_LIMIT_REPEAT </item> + <item> BOOST_PP_LIMIT_SEQ </item> + <item> BOOST_PP_LIMIT_SLOT_COUNT </item> + <item> BOOST_PP_LIMIT_SLOT_SIG </item> + <item> BOOST_PP_LIMIT_TUPLE </item> + <item> BOOST_PP_LIMIT_WHILE </item> + <item> BOOST_PP_LINE </item> + <item> BOOST_PP_LIST_APPEND </item> + <item> BOOST_PP_LIST_APPEND_D </item> + <item> BOOST_PP_LIST_AT </item> + <item> BOOST_PP_LIST_AT_D </item> + <item> BOOST_PP_LIST_CAT </item> + <item> BOOST_PP_LIST_CAT_D </item> + <item> BOOST_PP_LIST_CONS </item> + <item> BOOST_PP_LIST_ENUM </item> + <item> BOOST_PP_LIST_ENUM_R </item> + <item> BOOST_PP_LIST_FILTER </item> + <item> BOOST_PP_LIST_FILTER_D </item> + <item> BOOST_PP_LIST_FIRST </item> + <item> BOOST_PP_LIST_FIRST_N </item> + <item> BOOST_PP_LIST_FIRST_N_D </item> + <item> BOOST_PP_LIST_FOLD_LEFT </item> + <item> BOOST_PP_LIST_FOLD_LEFT_2ND </item> + <item> BOOST_PP_LIST_FOLD_LEFT_2ND_D </item> + <item> BOOST_PP_LIST_FOLD_LEFT_D </item> + <item> BOOST_PP_LIST_FOLD_RIGHT </item> + <item> BOOST_PP_LIST_FOLD_RIGHT_2ND </item> + <item> BOOST_PP_LIST_FOLD_RIGHT_2ND_D </item> + <item> BOOST_PP_LIST_FOLD_RIGHT_D </item> + <item> BOOST_PP_LIST_FOR_EACH </item> + <item> BOOST_PP_LIST_FOR_EACH_I </item> + <item> BOOST_PP_LIST_FOR_EACH_I_R </item> + <item> BOOST_PP_LIST_FOR_EACH_PRODUCT </item> + <item> BOOST_PP_LIST_FOR_EACH_PRODUCT_R </item> + <item> BOOST_PP_LIST_FOR_EACH_R </item> + <item> BOOST_PP_LIST_IS_CONS </item> + <item> BOOST_PP_LIST_IS_NIL </item> + <item> BOOST_PP_LIST_NIL </item> + <item> BOOST_PP_LIST_REST </item> + <item> BOOST_PP_LIST_REST_N </item> + <item> BOOST_PP_LIST_REST_N_D </item> + <item> BOOST_PP_LIST_REVERSE </item> + <item> BOOST_PP_LIST_REVERSE_D </item> + <item> BOOST_PP_LIST_SIZE </item> + <item> BOOST_PP_LIST_SIZE_D </item> + <item> BOOST_PP_LIST_TO_TUPLE </item> + <item> BOOST_PP_LIST_TO_TUPLE_R </item> + <item> BOOST_PP_LIST_TRANSFORM </item> + <item> BOOST_PP_LIST_TRANSFORM_D </item> + <item> BOOST_PP_LOCAL_ITERATE </item> + <item> BOOST_PP_LOCAL_LIMITS </item> + <item> BOOST_PP_LOCAL_MACRO </item> + <item> BOOST_PP_LPAREN </item> + <item> BOOST_PP_LPAREN_IF </item> + <item> BOOST_PP_MAX </item> + <item> BOOST_PP_MAX_D </item> + <item> BOOST_PP_MIN </item> + <item> BOOST_PP_MIN_D </item> + <item> BOOST_PP_MOD </item> + <item> BOOST_PP_MOD_D </item> + <item> BOOST_PP_MUL </item> + <item> BOOST_PP_MUL_D </item> + <item> BOOST_PP_NIL </item> + <item> BOOST_PP_NOR </item> + <item> BOOST_PP_NOT </item> + <item> BOOST_PP_NOT_EQUAL </item> + <item> BOOST_PP_NOT_EQUAL_D </item> + <item> BOOST_PP_OR </item> + <item> BOOST_PP_RELATIVE_FINISH </item> + <item> BOOST_PP_RELATIVE_FLAGS </item> + <item> BOOST_PP_RELATIVE_ITERATION </item> + <item> BOOST_PP_RELATIVE_START </item> + <item> BOOST_PP_REPEAT </item> + <item> BOOST_PP_REPEAT_1ST </item> + <item> BOOST_PP_REPEAT_2ND </item> + <item> BOOST_PP_REPEAT_3RD </item> + <item> BOOST_PP_REPEAT_FROM_TO </item> + <item> BOOST_PP_REPEAT_FROM_TO_1ST </item> + <item> BOOST_PP_REPEAT_FROM_TO_2ND </item> + <item> BOOST_PP_REPEAT_FROM_TO_3RD </item> + <item> BOOST_PP_REPEAT_FROM_TO_D </item> + <item> BOOST_PP_RPAREN </item> + <item> BOOST_PP_RPAREN_IF </item> + <item> BOOST_PP_SEQ_CAT </item> + <item> BOOST_PP_SEQ_CAT_S </item> + <item> BOOST_PP_SEQ_ELEM </item> + <item> BOOST_PP_SEQ_ENUM </item> + <item> BOOST_PP_SEQ_FILTER </item> + <item> BOOST_PP_SEQ_FILTER_S </item> + <item> BOOST_PP_SEQ_FIRST_N </item> + <item> BOOST_PP_SEQ_FOLD_LEFT </item> + <item> BOOST_PP_SEQ_FOLD_RIGHT </item> + <item> BOOST_PP_SEQ_FOR_EACH </item> + <item> BOOST_PP_SEQ_FOR_EACH_I </item> + <item> BOOST_PP_SEQ_FOR_EACH_I_R </item> + <item> BOOST_PP_SEQ_FOR_EACH_PRODUCT </item> + <item> BOOST_PP_SEQ_FOR_EACH_PRODUCT_R </item> + <item> BOOST_PP_SEQ_FOR_EACH_R </item> + <item> BOOST_PP_SEQ_HEAD </item> + <item> BOOST_PP_SEQ_INSERT </item> + <item> BOOST_PP_SEQ_NIL </item> + <item> BOOST_PP_SEQ_POP_BACK </item> + <item> BOOST_PP_SEQ_POP_FRONT </item> + <item> BOOST_PP_SEQ_PUSH_BACK </item> + <item> BOOST_PP_SEQ_PUSH_FRONT </item> + <item> BOOST_PP_SEQ_REMOVE </item> + <item> BOOST_PP_SEQ_REPLACE </item> + <item> BOOST_PP_SEQ_REST_N </item> + <item> BOOST_PP_SEQ_REVERSE </item> + <item> BOOST_PP_SEQ_REVERSE_S </item> + <item> BOOST_PP_SEQ_SIZE </item> + <item> BOOST_PP_SEQ_SUBSEQ </item> + <item> BOOST_PP_SEQ_TAIL </item> + <item> BOOST_PP_SEQ_TO_ARRAY </item> + <item> BOOST_PP_SEQ_TO_TUPLE </item> + <item> BOOST_PP_SEQ_TRANSFORM </item> + <item> BOOST_PP_SEQ_TRANSFORM_S </item> + <item> BOOST_PP_SLOT </item> + <item> BOOST_PP_STRINGIZE </item> + <item> BOOST_PP_SUB </item> + <item> BOOST_PP_SUB_D </item> + <item> BOOST_PP_TUPLE_EAT </item> + <item> BOOST_PP_TUPLE_ELEM </item> + <item> BOOST_PP_TUPLE_REM </item> + <item> BOOST_PP_TUPLE_REM_CTOR </item> + <item> BOOST_PP_TUPLE_REVERSE </item> + <item> BOOST_PP_TUPLE_TO_LIST </item> + <item> BOOST_PP_TUPLE_TO_SEQ </item> + <item> BOOST_PP_VALUE </item> + <item> BOOST_PP_WHILE </item> + <item> BOOST_PP_WSTRINGIZE </item> + <item> BOOST_PP_XOR </item> + +</list> + + +<list name="boost.program_options"> + + <item> environment_iterator </item> + <item> eof_iterator </item> + + <item> error </item> + <item> invalid_syntax </item> + <item> unknown_option </item> + <item> ambiguous_option </item> + <item> multiple_values </item> + <item> multiple_occurrences </item> + <item> validation_error </item> + <item> invalid_option_value </item> + <item> too_many_positional_options_error </item> + <item> too_few_positional_options_error </item> + <item> invalid_command_line_syntax </item> + <item> invalid_command_line_style </item> + + <item> basic_option </item> + <item> option </item> + <item> woption </item> + + <item> option_description </item> + <item> options_description_easy_init </item> + <item> options_description </item> + <item> duplicate_option_error </item> + + <item> basic_parsed_options </item> + <item> basic_command_line_parser </item> + <item> parsed_options </item> + <item> wparsed_options </item> + <item> ext_parser </item> + <item> command_line_parser </item> + <item> wcommand_line_parser </item> + <item> parse_command_line </item> + <item> parse_config_file </item> + <item> collect_unrecognized </item> + <item> parse_environment </item> + + <item> positional_options_description </item> + + <item> value_semantic </item> + <item> value_semantic_codecvt_helper </item> + <item> untyped_value </item> + <item> typed_value </item> + <item> value </item> + <item> wvalue </item> + <item> bool_switch </item> + + <item> variable_value </item> + <item> abstract_variables_map </item> + <item> variables_map </item> + <item> store </item> + <item> notify </item> + + <item> BOOST_PROGRAM_OPTIONS_VERSION </item> + +</list> + +<list name="boost.python"> + +</list> + +<list name="boost.random"> + +</list> + +<list name="boost.range"> + + <item> range_value </item> + <item> range_iterator </item> + <item> range_const_iterator </item> + <item> range_difference </item> + <item> range_size </item> + <item> range_reverse_iterator </item> + <item> range_const_reverse_iterator </item> + <item> range_result_iterator </item> + <item> range_reverse_result_iterator </item> + <item> begin </item> + <item> end </item> + <item> empty </item> + <item> size </item> + <item> rbegin </item> + <item> rend </item> + <item> const_begin </item> + <item> const_end </item> + <item> const_rbegin </item> + <item> const_rend </item> + <item> iterator_range </item> + <item> sub_range </item> + +</list> + +<list name="boost.rational"> + + <item> rational </item> + <item> rational_cast </item> + <item> numerator </item> + <item> denominator </item> + +</list> + +<list name="boost.regex"> + +</list> + +<list name="boost.serialization"> + + <item> text_oarchive </item> + <item> text_iarchive </item> + <item> text_woarchive </item> + <item> text_wiarchive </item> + <item> binary_oarchive </item> + <item> binary_iarchive </item> + <item> xml_oarchive </item> + <item> xml_iarchive </item> + <item> xml_woarchive </item> + <item> xml_wiarchive </item> + <item> common_iarchive </item> + + <item> archive_flags </item> + <item> archive_flags::no_header </item> + <item> archive_flags::no_codecvt </item> + <item> archive_flags::no_xml_tag_checking </item> + + <item> access </item> + + <item> serialize </item> + <item> load </item> + <item> save </item> + + <item> base_object </item> + <item> split_member </item> + <item> split_free </item> + <item> load_construct_data </item> + <item> save_construct_data </item> + <item> register_type </item> + <item> void_cast_register </item> + + <item> version_type </item> + <item> object_id_type </item> + <item> object_id_reference_type </item> + <item> class_id_type </item> + <item> class_id_optional_type </item> + <item> class_id_reference_type </item> + <item> tracking_type </item> + <item> classname_type </item> + + <item> BOOST_SERIALIZATION_SPLIT_MEMBER </item> + <item> BOOST_SERIALIZATION_SPLIT_FREE </item> + <item> BOOST_CLASS_EXPORT_GUID </item> + <item> BOOST_CLASS_EXPORT </item> + <item> BOOST_CLASS_TRACKING </item> + <item> BOOST_CLASS_IMPLEMENTATION </item> + +</list> + +<list name="boost.signals"> + + <item> signal </item> + <item> connect_position </item> + <item> connect_position::at_front </item> + <item> connect_position::at_back </item> + <item> slot </item> + <item> trackable </item> + <item> connection </item> + <item> scoped_connection </item> + <item> visit_each </item> + <item> last_value </item> + <item> swap </item> + +</list> + + +<list name="boost.smart_ptr"> + + <item> scoped_ptr </item> + <item> scoped_array </item> + <item> swap </item> + + <item> weak_ptr </item> + <item> make_shared </item> + + <item> shared_ptr_traits </item> + <item> static_cast_tag </item> + <item> struct const_cast_tag </item> + <item> struct dynamic_cast_tag </item> + <item> struct polymorphic_cast_tag </item> + <item> sp_enable_shared_from_this </item> + <item> shared_ptr </item> + <item> static_pointer_cast </item> + <item> const_pointer_cast </item> + <item> dynamic_pointer_cast </item> + <item> shared_static_cast </item> + <item> shared_dynamic_cast </item> + <item> shared_polymorphic_cast </item> + <item> shared_polymorphic_downcast </item> + <item> get_pointer </item> + <item> get_deleter </item> + + <item> shared_array </item> + + <item> intrusive_ptr </item> + <item> intrusive_ptr_add_ref </item> + <item> intrusive_ptr_release </item> + +</list> + +<list name="boost.spirit"> + +</list> + +<list name="boost.string_algo"> + + <item> to_lower_copy </item> + <item> to_lower </item> + <item> to_upper_copy </item> + <item> to_upper </item> + <item> is_classified </item> + <item> is_space </item> + <item> is_alnum </item> + <item> is_alpha </item> + <item> is_cntrl </item> + <item> is_digit </item> + <item> is_graph </item> + <item> is_lower </item> + <item> is_print </item> + <item> is_punct </item> + <item> is_upper </item> + <item> is_xdigit </item> + <item> is_any_of </item> + <item> is_from_range</item> + <item> is_equal </item> + + <item> FormatterConcept </item> + <item> token_compress_mode_type </item> + + <item> erase_range_copy </item> + <item> erase_range </item> + <item> erase_first_copy </item> + <item> erase_first </item> + <item> ierase_first_copy </item> + <item> ierase_first </item> + <item> erase_last_copy </item> + <item> erase_last </item> + <item> ierase_last_copy </item> + <item> ierase_last </item> + <item> erase_nth_copy </item> + <item> erase_nth </item> + <item> ierase_nth_copy </item> + <item> ierase_nth </item> + <item> erase_all_copy </item> + <item> erase_all </item> + <item> ierase_all_copy </item> + <item> ierase_all </item> + <item> erase_head_copy </item> + <item> erase_head </item> + <item> erase_tail_copy </item> + <item> erase_tail </item> + <item> find </item> + <item> find_first </item> + <item> ifind_first </item> + <item> find_last </item> + <item> ifind_last </item> + <item> find_nth </item> + <item> ifind_nth </item> + <item> find_head </item> + <item> find_tail </item> + <item> find_token </item> + <item> find_format_copy </item> + <item> find_format </item> + <item> find_format_all_copy </item> + <item> find_format_all </item> + <item> regex_finder </item> + <item> regex_formatter </item> + <item> find_iterator </item> + <item> split_iterator </item> + <item> make_find_iterator </item> + <item> make_split_iterator </item> + <item> first_finder </item> + <item> last_finder </item> + <item> nth_finder </item> + <item> head_finder </item> + <item> tail_finder </item> + <item> token_finder </item> + <item> range_finder </item> + <item> const_formatter </item> + <item> identity_formatter </item> + <item> empty_formatter </item> + <item> starts_with </item> + <item> istarts_with </item> + <item> ends_with </item> + <item> iends_with </item> + <item> contains </item> + <item> icontains </item> + <item> equals </item> + <item> iequals </item> + <item> all </item> + <item> find_regex </item> + <item> replace_regex_copy </item> + <item> replace_regex </item> + <item> replace_all_regex_copy </item> + <item> replace_all_regex </item> + <item> erase_regex_copy </item> + <item> erase_regex </item> + <item> erase_all_regex_copy </item> + <item> erase_all_regex </item> + <item> find_all_regex </item> + <item> split_regex </item> + <item> regex_finder </item> + <item> regex_formatter </item> + <item> replace_range_copy </item> + <item> replace_range </item> + <item> replace_first_copy </item> + <item> replace_first </item> + <item> ireplace_first_copy </item> + <item> ireplace_first </item> + <item> replace_last_copy </item> + <item> replace_last </item> + <item> ireplace_last_copy </item> + <item> ireplace_last </item> + <item> replace_nth_copy </item> + <item> replace_nth </item> + <item> ireplace_nth_copy </item> + <item> ireplace_nth </item> + <item> replace_all_copy </item> + <item> replace_all </item> + <item> ireplace_all_copy </item> + <item> ireplace_all </item> + <item> replace_head_copy </item> + <item> replace_head </item> + <item> replace_tail_copy </item> + <item> replace_tail </item> + + <item> has_native_replace </item> + <item> has_stable_iterators </item> + <item> has_const_time_insert </item> + <item> has_const_time_erase </item> + + <item> find_all </item> + <item> ifind_all </item> + <item> split </item> + <item> trim_left_copy_if </item> + <item> trim_left_copy </item> + <item> trim_left_if </item> + <item> trim_left </item> + <item> trim_right_copy_if </item> + <item> trim_right_copy </item> + <item> trim_right_if </item> + <item> trim_right </item> + <item> trim_copy_if </item> + <item> trim_copy </item> + <item> trim_if </item> + <item> trim </item> + +</list> + +<list name="boost.thread"> + + <item> barrier </item> + <item> condition </item> + <item> lock_error </item> + <item> thread_resource_error </item> + <item> mutex </item> + <item> try_mutex </item> + <item> timed_mutex </item> + <item> BOOST_ONCE_INIT </item> + <item> call_once </item> + <item> recursive_mutex </item> + <item> recursive_try_mutex </item> + <item> recursive_timed_mutex </item> + <item> thread </item> + <item> thread_group </item> + <item> thread_specific_ptr </item> + <item> xtime_clock_types </item> + <item> xtime </item> + <item> xtime_get </item> + +</list> + +<list name="boost.timer"> + + <item> timer </item> + <item> progress_timer </item> + <item> progress_display </item> + +</list> + +<list name="boost.tokenizer"> + + <item> tokenizer </item> + <item> make_token_iterator </item> + <item> token_iterator_generator </item> + <item> char_separator </item> + <item> escaped_list_separator </item> + <item> offset_separator </item> + +</list> + +<list name="boost.tribool"> + + <item> BOOST_TRIBOOL_THIRD_STATE </item> + <item> tribool </item> + <item> indeterminate </item> + <item> indeterminate_name </item> + <item> get_default_indeterminate_name </item> + +</list> + +<list name="boost.tuple"> + + <item> tuple </item> + <item> make_tuple </item> + <item> tie </item> + <item> set_open </item> + <item> set_close </item> + <item> set_delimiter </item> + <item> get </item> + +</list> + +TODO LIST END --> + +<!-- Contexts --> + + + + + +<list name="boost.uBLAS"> + + <!-- coming soon! --> + +</list> + +<!-- +<list name="boost.value_initialized"> + + <item> value_initialized </item> + <item> get </item> + +</list> + + +<list name="boost.variant"> + + <item> BOOST_VARIANT_LIMIT_TYPES </item> + <item> BOOST_VARIANT_ENUM_PARAMS </item> + <item> BOOST_VARIANT_ENUM_SHIFTED_PARAMS </item> + <item> BOOST_VARIANT_NO_REFERENCE_SUPPORT </item> + <item> BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT </item> + <item> BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT </item> + + <item> variant </item> + <item> make_variant_over </item> + <item> swap </item> + <item> make_recursive_variant </item> + <item> make_recursive_variant_over </item> + <item> recursive_wrapper </item> + <item> is_recursive_wrapper </item> + <item> unwrap_recursive_wrapper </item> + <item> apply_visitor_delayed_t </item> + <item> apply_visitor </item> + <item> bad_get </item> + <item> get </item> + <item> bad_visit </item> + <item> static_visitor </item> + <item> visitor_ptr_t </item> + <item> visitor_ptr </item> + +</list> +--> +<list name="boost.wave"> + + <!-- maybe later... --> + +</list> + + + +<contexts> + + +<context name="main" attribute="boost.free.function" > + + <keyword attribute="boost.free.function" context="#stay" String="boost.free.function" /> + <keyword attribute="boost.template.classes" context="#stay" String="boost.template.classes" /> + <keyword attribute="boost.classes" context="#stay" String="boost.classes" /> + <keyword attribute="boost.metaprogramming" context="#stay" String="boost.metaprogramming" /> + <keyword attribute="boost.exception" context="#stay" String="boost.exception" /> + <keyword attribute="boost.container" context="#stay" String="boost.container" /> + <keyword attribute="boost.macro" context="#stay" String="boost.macro" /> + <keyword attribute="boost.object" context="#stay" String="boost.object" /> + <keyword attribute="boost.fusion.result_of" context="#stay" String="boost.fusion.result_of" /> + <keyword attribute="boost.concepts.member.functions" context="#stay" String="boost.concepts.member.functions" /> + <keyword attribute="boost.concepts.free.functions" context="#stay" String="boost.concepts.free.functions" /> + <keyword attribute="boost.tags" context="#stay" String="boost.tags" /> + <keyword attribute="boost.member.functions" context="#stay" String="boost.member.functions" /> + <keyword attribute="boost.constants" context="#stay" String="boost.constants" /> + <keyword attribute="boost.concepts.member.typedef" context="#stay" String="boost.concepts.member.typedef" /> + <keyword attribute="boost.namespaces" context="#stay" String="boost.namespaces" /> + + +</context> + +</contexts> + + +<!-- + This section defines the colors and format of each type of string parsed + Try to use defaults so the user can change it as he wished +--> + +<itemDatas> + + <itemData name="boost.free.function" defStyleNum="dsFunction"/> + <itemData name="boost.template.classes" defStyleNum="dsDataType"/> + <itemData name="boost.classes" defStyleNum="dsDataType"/> + <itemData name="boost.metaprogramming" defStyleNum="dsFunction"/> + <itemData name="boost.exception" defStyleNum="dsDataType" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="boost.container" defStyleNum="dsDataType"/> + <itemData name="boost.macro" defStyleNum="dsOthers"/> + <itemData name="boost.object" defStyleNum="dsDataType" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="boost.fusion.result_of" defStyleNum="dsFunction"/> + <itemData name="boost.concepts.member.functions" defStyleNum="dsFunction"/> + <itemData name="boost.concepts.free.functions" defStyleNum="dsFunction"/> + <itemData name="boost.tags" defStyleNum="dsOthers"/> + <itemData name="boost.member.functions" defStyleNum="dsFunction"/> + <itemData name="boost.constants" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="boost.concepts.member.typedef" defStyleNum="dsDataType"/> + <itemData name="boost.namespaces" defStyleNum="dsDataType"/> + + <!-- + This is an extract from the official Kate page + It is leave here as a reference. + + dsNormal used for normal text. + dsKeyword used for keywords. + dsDataType used for data types. + dsDecVal used for decimal values. + dsBaseN used for values with a base other than 10. + dsFloat used for float values. + dsChar used for a character. + dsString used for strings. + dsComment used for comments. + dsOthers used for 'other' things. + dsAlert used for warning messages. + dsFunction used for function calls. + dsRegionMarker used for region markers. + dsError used for error highlighting and wrong syntax. + + --> +</itemDatas> + +</highlighting> + +<general> + + <keywords casesensitive="1" /> + +</general> + +</language> + + +<!-- [ About the code ] + + +Introduction +================================================ +This kate syntax files aims to improve boost C++ productivity by providing a +consitent highligthing framework. +This files work with kate-part so it can be used in every text procesing application +of KDE. (KWrite,Kate,Konqueror,KDevelop,etc) + + +Aknowelegments +================================================= + + + +Version history +================================================= + +[ 0.1.0 ] Initial beta. + +Known bugs +================================================= + + +Included boost libraries +================================================= + +[ boost.any ] +Safe, generic container for single values of different value types. +- Kevlin Henney + +[ boost.array ] +STL compliant container wrapper for arrays of constant size. +- Nicolai Josuttis. + +[ boost.assign ] +Filling containers with constant or generated data has never been easier. +- Thorsten Ottosen. + +[ boost.bind ] +Generalized binders for function/object/pointers and member functions. +- Peter Dimov. + +[ boost.call_traits ] +Defines types for passing parameters. +- John Maddock, Howard Hinnant, et al. + +[ boost.compressed_pair ] +Empty member optimization. +- John Maddock, Howard Hinnant, et al. + +[ boost.concept_check ] +Tools for generic programming +- Jeremy Siek. + +[ boost.conversion ] +Polymorphic and lexical casts +- Dave Abrahams, Kevlin Henney. + +[ boost.crc ] +Cyclic Redundancy Code +- Daryle Walker. + +[ boost.date_time ] +Date-Time library. +- Jeff Garland. + +[ boost.dynamic_bitset ] +A runtime sized version of std::bitset +- Jeremy Siek, Chuck Allison. + +[ boost.enable_if ] +Selective inclusion of function template overloads +- Jaakko Järvi, Jeremiah Willcock, Andrew Lumsdaine. + +[ boost.filesystem ] +Portable paths, iteration over directories, and other useful filesystem operations. +- Beman Dawes. + +[ boost.format ] +Type-safe 'printf-like' format operations. +- Samuel Krempp. + +[ boost.function ] +Function object wrappers for deferred calls or callbacks. +- Doug Gregor. + +[ boost.functional ] +Enhanced function object adaptors. +- Mark Rodgers. + +[ boost.fusion ] +Fusion between compile and run time +Joel de Guzman + +[ boost.hash ] +A TR1 hash function object that can be extended to hash user defined types +- Daniel James. + +[ boost.graph ] +Generic graph components and algorithms +- Jeremy Siek, University of Notre Dame team. + +[ boost.integer ] +Headers to ease dealing with integral types. + +[ boost.interval ] +Extends the usual arithmetic functions to mathematical intervals +- Guillaume Melquiond, Herv´ Brönnimann, Sylvain Pion. + +[ boost.in_place_factory ] +Generic in-place construction of contained objects with a variadic argument-list. +- Fernando Cacciola. + +[ boost.io_state_savers ] - Save I/O state to prevent jumbled data +- Daryle Walker. + +[ boost.iostreams ] +Framework for defining streams, stream buffers and i/o filters. +- Jonathan Turkanis. + +[ boost.iterators ] +Iterator construction framework, adaptors, concepts, and more. +- Dave Abrahams, Jeremy Siek, Thomas Witt. + +[ boost.lambda ] +Define small unnamed function objects at the actual call site, and more. +- Jaakko Järvi, Gary Powell. + +[ boost.math ] +Several contributions in the domain of mathematics. + +[ boost.minmax ] +standard library extensions for simultaneous min/max and min/max element computations, +- Hervé Brönnimann. + +[ boost.mpl ] +Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes +- Aleksey Gurtovoy. + +[ boost.multi_array ] +Multidimensional containers and adaptors for arrays of contiguous data +- Ron Garcia. + +[ boost.multi_index ] +Containers with multiple STL-compatible access interfaces +- Joaquín M López Muñoz. + +[ boost.numeric ] +Optimized Policy-based Numeric Conversions +- Fernando Cacciola. + +[ boost.operators ] +Templates ease arithmetic classes and iterators +- Dave Abrahams, Jeremy Siek. + +[ boost.optional ] +Discriminated-union wrapper for optional values. +- Fernando Cacciola. + +[ boost.parameter ] +Write functions that accept arguments by name. +- David Abrahams, Daniel Wallin. + +[ boost.pointer_container ] +Containers for storing heap-allocated polymorphic objects to ease OO-programming. +- Thorsten Ottosen. + +[ boost.pool ] +Memory pool management +- Steve Cleary. + +[ boost.preprocessor ] +Preprocessor metaprogramming tools including repetition and recursion. +- Vesa Karvonen, Paul Mensonides. + +[ boost.program_options ] +Access to configuration data given on command line, in config files and other sources. +- Vladimir Prus. + +[ boost.property_map ] +Concepts defining interfaces which map key objects to value objects. +- Jeremy Siek. + +[ boost.python ] +Reflects C++ classes and functions into Python +- Dave Abrahams. + +[ boost.random ] +A complete system for random number generation +- Jens Maurer. + +[ boost.range ] +A new infrastructure for generic algorithms that builds on top of the new iterator concepts. +- Thorsten Ottosen. + +[ boost.rational ] +A rational number class, +- Paul Moore. + +[ boost.ref ] +A utility library for passing references to generic functions. +- Jaako Järvi, Peter Dimov, Doug Gregor, Dave Abrahams. + +[ boost.regex ] +Regular expression library. +- John Maddock. + +[ boost.serialization ] +Serialization for persistence and marshalling. +- Robert Ramey + +[ boost.signals ] +managed signals & slots callback implementation. +- Doug Gregor. + +[ boost.smart_ptr ] +Five smart pointer class templates. +- Greg Colvin, Beman Dawes, Peter Dimov, and Darin Adler. + +[ boost.static_assert ] +Static assertions (compile time assertions). +- John Maddock. + +[ boost.spirit ] +LL parser framework represents parsers directly as EBNF grammars in inlined C++. +- Joel de Guzman and team. + +[ boost.string_algo ] +String algorithms library +- Pavol Droba + +[ boost.test ] +Support for simple program testing, full unit testing, and for program execution monitoring. +- Gennadiy Rozental. + +[ boost.thread ] +Portable C++ multi-threading. +- William Kempf. + +[ boost.timer ] +Event timer, progress timer, and progress display classes. +- Beman Dawes. + +[ boost.tokenizer ] +Break of a string or other character sequence into a series of tokens. +- John Bandela. + +[ boost.tribool ] +3-state boolean type library. +- Doug Gregor. + +[ boost.tuple ] +Ease definition of functions returning multiple values, and more. +- Jaakko Järvi. + +[ boost.type_traits ] +Templates for fundamental properties of types. +- John Maddock, Steve Cleary, et al. + +[ boost.uBLAS ] +Basic linear algebra for dense, packed and sparse matrices. +- Joerg Walter, Mathias Koch. + +[ boost.utility ] +Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, +plus base-from-member idiom. +- Dave Abrahams and others. + +[ boost.value_initialized ] +Wrapper for uniform-syntax value initialization. +- Fernando Cacciola, based on the original idea of David Abrahams. + +[ boost.variant ] +Safe, generic, stack-based discriminated union container. +- Eric Friedman, Itay Maman. + +[ boost.wave ] +Preprocessor functionality packed behind an easy to use iterator interface. +- Hartmut Kaiser + + +--> + diff --git a/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_cpp.xml b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_cpp.xml new file mode 100644 index 000000000..3ec0b91b0 --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_cpp.xml @@ -0,0 +1,471 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE language SYSTEM "language.dtd"> + +<language + +name="c++" +version="0.1.0" +kateversion="2.4" +section="boost::hs" +extensions="*.cpp;*.hpp;*.h" +mimetype="allFiles" +author="Based on the original cpp.xml from katepart, Copyright 2006 -2007 Matias Capeletto, matias.capeletto@gmail.com" +priority="9" +license="Distributed under the Boost Software License, Version 1.0. +http://www.boost.org/LICENSE_1_0.txt" + +> + +<highlighting> + +<!-- Keywords lists --> + +<list name="keywords"> + + <item> asm </item> + <item> break </item> + <item> case </item> + <item> catch </item> + <item> class </item> + <item> const_cast </item> + <item> continue </item> + <item> default </item> + <item> delete </item> + <item> do </item> + <item> dynamic_cast</item> + <item> else </item> + <item> enum </item> + <item> explicit </item> + <item> export </item> + <item> extern </item> + <item> false </item> + <item> friend </item> + <item> for </item> + <item> goto </item> + <item> if </item> + <item> inline </item> + <item> namespace </item> + <item> new </item> + <item> operator </item> + <item> private </item> + <item> protected </item> + <item> public </item> + <item> reinterpret_cast </item> + <item> return </item> + <item> sizeof </item> + <item> static_cast </item> + <item> struct </item> + <item> switch </item> + <item> template </item> + <item> this </item> + <item> throw </item> + <item> true </item> + <item> try </item> + <item> typedef </item> + <item> typeid </item> + <item> type_info </item> + <item> typename </item> + <item> union </item> + <item> using </item> + <item> virtual </item> + <item> while </item> + <item> and </item> + <item> and_eq </item> + <item> bad_cast </item> + <item> bad_typeid </item> + <item> bitand </item> + <item> bitor </item> + <item> compl </item> + <item> not </item> + <item> not_eq </item> + <item> or </item> + <item> or_eq </item> + <item> xor </item> + <item> xor_eq </item> + <item> except </item> + <item> finally </item> + <item> xalloc </item> + +</list> + +<list name="qt_extensions"> + + <item> K_DCOP </item> + <item> SLOT </item> + <item> SIGNAL </item> + <item> Q_CLASSINFO </item> + <item> Q_ENUMS </item> + <item> Q_EXPORT </item> + <item> Q_OBJECT </item> + <item> Q_OVERRIDE </item> + <item> Q_PROPERTY </item> + <item> Q_SETS </item> + <item> TRUE </item> + <item> FALSE </item> + <item> connect </item> + <item> disconnect </item> + <item> emit </item> + <item> signals </item> + <item> slots </item> + <item> foreach </item> + +</list> + +<list name="types"> + + <item> auto </item> + <item> bool </item> + <item> char </item> + <item> const </item> + <item> double </item> + <item> float </item> + <item> int </item> + <item> long </item> + <item> mutable </item> + <item> register </item> + <item> short </item> + <item> signed </item> + <item> static </item> + <item> unsigned </item> + <item> void </item> + <item> volatile </item> + <item> uchar </item> + <item> uint </item> + <item> int8_t </item> + <item> int16_t </item> + <item> int32_t </item> + <item> int64_t </item> + <item> uint8_t </item> + <item> uint16_t </item> + <item> uint32_t </item> + <item> uint64_t </item> + <item> wchar_t </item> + +</list> + +<!-- Contexts --> + +<contexts> + +<context attribute="Normal Text" lineEndContext="#stay" name="Normal"> + + <DetectSpaces /> + + <IncludeRules context="boost::hs call finder" /> + <IncludeRules context="preprocessor finder" /> + <IncludeRules context="keyword finder" /> + <IncludeRules context="extensions finder" /> + <IncludeRules context="built in types finder" /> + <IncludeRules context="##std-c++" /> + <IncludeRules context="##boost" /> + <IncludeRules context="character finder" /> + <IncludeRules context="string finder" /> + + <DetectIndentifier /> + + <IncludeRules context="number finder" /> + <IncludeRules context="##Doxygen" /> + <IncludeRules context="quickbook_import_markup" /> + <IncludeRules context="comment finder" /> + <IncludeRules context="region finder" /> + <IncludeRules context="symbol finder" /> + +</context> + +<!-- String listerals --> + +<context attribute="String" name="string finder"> + <DetectChar attribute="String" context="String" char="""/> +</context> + +<context attribute="String" lineEndContext="#pop" name="String"> + + <LineContinue attribute="String" context="#stay"/> + <HlCStringChar attribute="String Char" context="#stay"/> + <DetectChar attribute="String" context="#pop" char="""/> + +</context> + +<!-- Character literals --> + +<context attribute="Character" name="character finder"> + <HlCChar attribute="Char" context="#stay"/> +</context> + + +<!-- built in types --> + +<context attribute="built in types" name="built in types finder"> + <keyword attribute="Data Type" context="#stay" String="types" /> +</context> + +<!-- extensions --> + +<context attribute="Extensions" name="extensions finder"> + <keyword attribute="Extensions" context="#stay" String="qt_extensions" /> +</context> + +<!-- Keywords --> + +<context attribute="Keyword" name="keyword finder"> + <keyword attribute="Keyword" context="#stay" String="keywords" /> +</context> + +<!-- Detect number literals --> + +<context attribute="Float" name="number finder"> + + + <Float attribute="Float" context="#stay"> + <AnyChar String="fF" attribute="Float" context="#stay"/> + </Float> + + <HlCOct attribute="Octal" context="#stay"/> + + <HlCHex attribute="Hex" context="#stay"/> + + <Int attribute="Decimal" context="#stay"> + + <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/> + <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/> + + </Int> + +</context> + + +<!-- Comments --> + +<context attribute="Commnet" name="comment finder"> + <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> +</context> + +<context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> + <DetectSpaces /> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> + <DetectSpaces /> + <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> +</context> + +<!-- QuickBook import markups --> + +<context attribute="Comment" lineEndContext="#stay" name="Quickbook Commentar 1"> + <DetectSpaces /> + <StringDetect attribute="Extensions" context="#pop" String="*/" endRegion="Comment"/> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Quickbook Commentar 2"> + <DetectSpaces /> + <StringDetect attribute="Extensions" context="#pop" String=">>*/" endRegion="Comment"/> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Quickbook Commentar 3"> + <DetectSpaces /> + <StringDetect attribute="Extensions" context="#pop" String=">*/" endRegion="Comment"/> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> +</context> + +<context name="quickbook_import_markup" attribute="Commnet"> + <RegExpr attribute="Extensions" context="Commentar 1" String="//\[\s*\w+"/> + <StringDetect attribute="Extensions" context="Commentar 1" String="//]"/> + <StringDetect attribute="Extensions" context="Commentar 1" String="//`"/> + <StringDetect attribute="Extensions" context="Commentar 1" String="//<--"/> + <StringDetect attribute="Extensions" context="Commentar 1" String="//-->"/> + <StringDetect attribute="Extensions" context="Quickbook Commentar 1" String="/*`" beginRegion="Comment"/> + <StringDetect attribute="Extensions" context="Quickbook Commentar 2" String="/*<<" beginRegion="Comment"/> + <StringDetect attribute="Extensions" context="Quickbook Commentar 3" String="/*<" beginRegion="Comment"/> +</context> + + +<!-- Regions --> + +<context attribute="Symbol" name="region finder"> + + <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> + <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> + +</context> + +<!-- Other reserved symbols --> + +<context attribute="Symbol" name="symbol finder"> + + <AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]{|}~^;"/> + +</context> + +<!-- Preprocessor --> + +<context attribute="Preprocessor" name="preprocessor finder"> + + <!-- ifdef/ifndef region markers --> + + <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" /> + + <!-- Enter the preprocessor --> + + <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" /> + +</context> + +<context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor"> + + <LineContinue attribute="Preprocessor" context="#stay"/> + <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/> + <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/> + <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/> + <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/> + <IncludeRules context="##Doxygen" /> + <IncludeRules context="quickbook_import_markup" /> + <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> + <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/> + +</context> + +<context attribute="Preprocessor" lineEndContext="#pop" name="Define"> + <LineContinue attribute="Preprocessor" context="#stay"/> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor"> + <DetectSpaces /> + <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" /> + <DetectIdentifier /> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Outscoped" > + <DetectSpaces /> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> + <DetectChar attribute="String" context="String" char="""/> + <IncludeRules context="##Doxygen" /> + <IncludeRules context="quickbook_import_markup" /> + <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> + <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" /> + <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" /> +</context> + +<context attribute="Comment" lineEndContext="#stay" name="Outscoped intern"> + + <DetectSpaces /> + <IncludeRules context="##Alerts" /> + <DetectIdentifier /> + <DetectChar attribute="String" context="String" char="""/> + <IncludeRules context="##Doxygen" /> + <IncludeRules context="quickbook_import_markup" /> + <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> + <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/> + <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true"/> + +</context> + + +<!-- boost::hs --> + +<context attribute="Comment" lineEndContext="#pop" name="boost::hs skip line" > + +</context> + + +<context attribute="Comment" lineEndContext="#pop#pop" name="boost::hs skip line and pop pop" > + +</context> + + +<context attribute="Comment" lineEndContext="boost::hs is off" name="boost::hs has gone off" > + +</context> + + +<context attribute="Comment" name="boost::hs call finder"> + + <StringDetect attribute="boost::hs" context="boost::hs skip line" String="//boost::hs::begin_region()" beginRegion="boost::hs::Region" firstNonSpace="true" /> + <StringDetect attribute="boost::hs" context="boost::hs skip line" String="//boost::hs::end_region()" endRegion="boost::hs::Region" firstNonSpace="true" /> + + <StringDetect attribute="boost::hs" context="boost::hs has gone off" String="//boost::hs::turn_off()" beginRegion="boost::hs::ScapedRegion" firstNonSpace="true" /> + <StringDetect attribute="boost::hs" context="boost::hs skip line" String="//boost::hs::turn_on()" firstNonSpace="true" /> + +</context> + +<context attribute="Normal Text" name="boost::hs is off"> + + <StringDetect attribute="boost::hs" context="boost::hs skip line and pop pop" String="//boost::hs::turn_off()" endRegion="boost::hs::ScapedRegion" firstNonSpace="true" /> + <StringDetect attribute="boost::hs" context="#stay" String="//boost::hs::turn_on()" firstNonSpace="true" /> + +</context> + + +</contexts> + +<itemDatas> + + <itemData name="Normal Text" defStyleNum="dsNormal"/> + <itemData name="Keyword" defStyleNum="dsKeyword"/> + <itemData name="Extensions" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="Data Type" defStyleNum="dsDataType"/> + <itemData name="Decimal" defStyleNum="dsDecVal"/> + <itemData name="Octal" defStyleNum="dsBaseN"/> + <itemData name="Hex" defStyleNum="dsBaseN"/> + <itemData name="Float" defStyleNum="dsFloat"/> + <itemData name="Char" defStyleNum="dsChar"/> + <itemData name="String" defStyleNum="dsString"/> + <itemData name="String Char" defStyleNum="dsChar"/> + <itemData name="Comment" defStyleNum="dsComment"/> + <itemData name="Symbol" defStyleNum="dsNormal"/> + <itemData name="Preprocessor" defStyleNum="dsOthers"/> + <itemData name="Prep. Lib" defStyleNum="dsOthers"/> + <itemData name="boost::hs" defStyleNum="dsOthers"/> + +</itemDatas> + +</highlighting> + +<general> + + <comments> + + <comment name="singleLine" start="//" /> + <comment name="multiLine" start="/*" end="*/" region="Comment"/> + + </comments> + + <keywords casesensitive="1" /> + +</general> + +</language> + + +<!-- + +Aknowelegments +================================================= + +Version history +================================================= + +[ 0.1.0 ] Initial beta. + +Known bugs +================================================= + +-->
\ No newline at end of file diff --git a/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_quickbook.xml b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_quickbook.xml new file mode 100644 index 000000000..b043cfbe8 --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_quickbook.xml @@ -0,0 +1,736 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE language SYSTEM "language.dtd"> +<language + +name="quickbook" +version="0.9.4" +kateversion="2.4" +section="boost::hs" +extensions="*.qbk" +mimetype="allFiles" +author="Copyright 2006 -2007 Matias Capeletto, matias.capeletto@gmail.com" +license="Distributed under the Boost Software License, Version 1.0. +http://www.boost.org/LICENSE_1_0.txt" + +> + +<highlighting> + +<!-- Contexts --> + +<contexts> + +<!-- + Main context + This is bottom the context, every thing the user type will stack another + context. This context is special because some things can only be called + from here. (e.g. The quickbook description) +--> + +<context name="c_main" attribute="d_normal" lineEndContext="#stay"> + + <IncludeRules context="c_main_before_code" /> + <IncludeRules context="c_cpp_code_block_finder" /> + <IncludeRules context="c_main_after_code" /> + <IncludeRules context="c_normal" /> + +</context> + +<context name="c_main_before_code" attribute="d_normal" lineEndContext="#stay"> + + <IncludeRules context="c_sections_finder" /> + <IncludeRules context="c_predefined_macros" /> + <IncludeRules context="c_boost::hs call finder" /> + <IncludeRules context="c_item_list_finder" /> + +</context> + +<context name="c_main_after_code" attribute="d_normal" lineEndContext="#stay"> + + <IncludeRules context="c_scape_sequence_finder" /> + <IncludeRules context="c_headings_finder" /> + <IncludeRules context="c_includes_finder" /> + <IncludeRules context="c_macro_definition_finder" /> + <IncludeRules context="c_template_definition_finder" /> + <IncludeRules context="c_quickbook_type_finder" /> + <IncludeRules context="c_text_block_finder" /> + <IncludeRules context="c_table_finder" /> + <IncludeRules context="c_variable_list_finder" /> + <IncludeRules context="c_import_finder" /> + +</context> + +<!-- Common Structures, this constructions can be called in almost every context --> + +<context name="c_common_structures" attribute="d_normal" lineEndContext="#stay"> + + <DetectSpaces/> + <IncludeRules context="c_common_structures_before_code" /> + <IncludeRules context="c_cpp_inline_code_block_finder" /> + <IncludeRules context="c_common_structures_after_code" /> + +</context> + +<context name="c_common_structures_before_code" attribute="d_normal" lineEndContext="#stay"> + + <DetectSpaces/> + <IncludeRules context="c_scape_sequence_finder" /> + <IncludeRules context="c_predefined_macros" /> + <IncludeRules context="c_language_finder" /> + <IncludeRules context="c_comment_finder" /> + <IncludeRules context="c_boost::hs call finder" /> + <IncludeRules context="c_no_processing_finder" /> + +</context> + +<context name="c_common_structures_after_code" attribute="d_normal" lineEndContext="#stay"> + + <IncludeRules context="c_anchor_finder" /> + <IncludeRules context="c_image_finder" /> + <IncludeRules context="c_link_finder" /> + <IncludeRules context="c_cpp_link_finder" /> + <IncludeRules context="c_text_format_finder" /> + +</context> + +<!-- Normal contex, defines plain text and look for a structure to appear --> + +<context name="c_normal" attribute="d_normal" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <IncludeRules context="c_common_structures" /> + <IncludeRules context="c_simple_text_block_finder" /> + +</context> + +<!-- Inside tables and list, you can not use every construction --> + +<context name="c_strict_normal" attribute="d_normal" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <IncludeRules context="c_common_structures" /> + +</context> + +<!-- Normal block contexs, this contexts will be stacked so we can know the state --> + +<context name="c_normal_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_bold_block" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_indirect_normal_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + + <DetectChar char="]" attribute="d_structure" context="#pop#pop" /> +</context> + +<context name="c_deep_normal_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + <DetectChar char="]" attribute="d_structure" context="#pop#pop#pop" /> +</context> + +<context name="c_indirect_normal_bold_block" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + + <DetectChar char="]" attribute="d_structure" context="#pop#pop" /> +</context> + +<!-- Blocks used in macros and templates bodies --> + +<context name="c_indirect_main_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_main" /> + + <DetectChar char="]" attribute="d_structure" context="#pop#pop" /> +</context> + +<context name="c_deep_main_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_main" /> + <DetectChar char="]" attribute="d_structure" context="#pop#pop#pop" /> +</context> + +<!-- No processing block --> + +<context name="c_no_processing_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_predefined_macros" /> + <StringDetect String="'''" attribute="d_structure" context="#pop" endRegion="r_no_processing"/> +</context> + +<context name="c_no_processing_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="'''" attribute="d_structure" context="c_no_processing_block" beginRegion="r_no_processing"/> +</context> + +<!-- Items list finder --> + +<context name="c_item_list" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="^\s*[\*\#]\s" minimal="true" attribute="d_structure" context="c_item_list"/> + <RegExpr String="^." minimal="true" attribute="d_structure" lookAhead="true" context="#pop"/> + <IncludeRules context="c_strict_normal" /> +</context> + +<context name="c_item_list_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="^\s*[\*\#]\s" minimal="true" attribute="d_structure" context="c_item_list"/> +</context> + +<!-- Code blocks --> + +<context name="c_back_to_quickbook_block" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="`" char1="`" attribute="d_structure" context="#pop" /> + <IncludeRules context="c_strict_normal" /> +</context> + +<context name="c_code_block" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="^[\S]" minimal="true" attribute="d_structure" lookAhead="true" context="#pop" /> + <Detect2Chars char="`" char1="`" attribute="d_structure" context="c_back_to_quickbook_block" /> + <IncludeRules context="c_predefined_macros" /> + <IncludeRules context="##C++" /> +</context> + +<context name="c_preformated_code_block" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="`" char1="`" attribute="d_structure" context="#pop" endRegion="r_code_block" /> + <IncludeRules context="c_predefined_macros" /> + <IncludeRules context="##C++" /> +</context> + +<context name="c_inline_code_block" attribute="d_normal" lineEndContext="#stay"> + <DetectChar char="`" attribute="d_structure" context="#pop" /> + <IncludeRules context="c_predefined_macros" /> + <IncludeRules context="##C++"/> +</context> + +<context name="c_cpp_code_block_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="^[\s]" minimal="true" attribute="d_structure" context="c_code_block" /> +</context> + +<context name="c_cpp_inline_code_block_finder" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="`" char1="`" attribute="d_structure" context="c_preformated_code_block" beginRegion="r_code_block" /> + <DetectChar char="`" attribute="d_structure" context="c_inline_code_block" /> +</context> + +<context name="c_language_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[c++]" attribute="d_structure" context="#stay" /> + <StringDetect String="[python]" attribute="d_structure" context="#stay" /> +</context> + +<!-- Sections and Headings --> + +<context name="c_section_definition" attribute="d_anchor" lineEndContext="#stay"> + <DetectChar char=" " attribute="d_structure" context="c_indirect_normal_bold_block" /> +</context> + +<context name="c_sections_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[section" attribute="d_structure" context="c_section_definition" beginRegion="r_section" /> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop" endRegion="r_section"/> +</context> + +<context name="c_headings_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[heading" minimal="true" attribute="d_structure" context="c_normal_bold_block" /> + <RegExpr String="\[h[1-6]\b" minimal="true" attribute="d_structure" context="c_normal_bold_block" /> +</context> + + +<!-- Macros --> + +<context name="c_macro_definition" attribute="d_macro" lineEndContext="c_indirect_main_block"> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_indirect_main_block" /> +</context> + +<context name="c_predefined_macros" attribute="d_macro"> + <RegExpr String="[_]{2}[\w_]+[_]{2}" minimal="true" attribute="d_macro" context="#stay" /> +</context> + +<context name="c_macro_definition_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[def\b[\s]*" attribute="d_structure" context="c_macro_definition" /> +</context> + + +<!-- Templates --> + +<context name="c_template_parameters" attribute="d_path" lineEndContext="#stay"> + <DetectChar char="]" attribute="d_structure" context="c_deep_main_block" /> +</context> + +<context name="c_template_definition" attribute="d_macro" lineEndContext="c_indirect_main_block"> + <DetectChar char="[" attribute="d_structure" context="c_template_parameters" /> + <RegExpr String="\\\s" minimal="true" attribute="d_structure" context="c_indirect_main_block"/> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_indirect_main_block" /> +</context> + +<context name="c_template_definition_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[template\b[\s]*" attribute="d_structure" context="c_template_definition" /> +</context> + +<!-- Text format logic --> + +<context name="c_text_format_finder" attribute="d_normal"> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_italic" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_underline" /> + <Detect2Chars char="[" char1="-" attribute="d_structure" context="c_normal_strikeout" /> + <Detect2Chars char="[" char1="^" attribute="d_structure" context="c_normal_teletype" /> + <Detect2Chars char="[" char1="~" attribute="d_structure" context="c_normal_replaceable" /> + <RegExpr String="(?=(^|\W))[\*][\S][^\[\]]*[\S]?[\*](?=($|\W))" minimal="true" attribute="d_normal_bold" context="#stay" /> + <RegExpr String="(?=(^|\W))[/][\S][^\[\]]*[\S]?[/](?=($|\W))" minimal="true" attribute="d_normal_italic" context="#stay" /> + <RegExpr String="(?=(^|\W))[_][\S][^\[\]]*[\S]?[_](?=($|\W))" minimal="true" attribute="d_normal_underline" context="#stay" /> + <RegExpr String="(?=(^|\W))[=][\S][^\[\]]*[\S]?[=](?=($|\W))" minimal="true" attribute="d_normal_teletype" context="#stay" /> +</context> + +<context name="c_normal_bold" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_bold_italic" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_bold_underline" /> + <RegExpr String="(?=(^|\W))[/][\S][^\[\]]*[\S]?[/](?=($|\W))" minimal="true" attribute="d_normal_bold_italic" context="#stay" /> + <RegExpr String="(?=(^|\W))[_][\S][^\[\]]*[\S]?[_](?=($|\W))" minimal="true" attribute="d_normal_bold_underline" context="#stay" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_italic" attribute="d_normal_italic" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_italic" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_italic_underline" /> + <RegExpr String="(?=(^|\W))[\*][\S][^\[\]]*[\S]?[\*](?=($|\W))" minimal="true" attribute="d_normal_bold_italic" context="#stay" /> + <RegExpr String="(?=(^|\W))[_][\S][^\[\]]*[\S]?[_](?=($|\W))" minimal="true" attribute="d_normal_italic_underline" context="#stay" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_underline" attribute="d_normal_underline" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_underline" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_italic_underline" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_underline" /> + <RegExpr String="(?=(^|\W))[\*][\S][^\[\]]*[\S]?[\*](?=($|\W))" minimal="true" attribute="d_normal_bold_underline" context="#stay" /> + <RegExpr String="(?=(^|\W))[/][\S][^\[\]]*[\S]?[/](?=($|\W))" minimal="true" attribute="d_normal_italic_underline" context="#stay" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_bold_italic" attribute="d_normal_bold_italic" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_italic" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_bold_italic" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_bold_underline" attribute="d_normal_bold_underline" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_underline" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_bold_underline" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_italic_underline" attribute="d_normal_italic_underline" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_italic_underline" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_italic_underline" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_bold_italic_underline" attribute="d_normal_bold_italic_underline" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <Detect2Chars char="[" char1="*" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <Detect2Chars char="[" char1="'" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <Detect2Chars char="[" char1="_" attribute="d_structure" context="c_normal_bold_italic_underline" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_strikeout" attribute="d_normal_strikeout" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_teletype" attribute="d_normal_teletype" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_normal_replaceable" attribute="d_normal_ replaceable" lineEndContext="#stay"> + <IncludeRules context="c_common_structures" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<!-- Links --> + +<context name="c_link" attribute="d_anchor" lineEndContext="c_indirect_normal_block"> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_indirect_normal_block" /> +</context> + +<context name="c_web_link" attribute="d_path" lineEndContext="c_indirect_normal_block"> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_indirect_normal_block" /> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_link_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[link\b[\s]*" attribute="d_structure" context="c_link" /> + <Detect2Chars char="[" char1="@" attribute="d_structure" context="c_web_link" /> +</context> + +<context name="c_cpp_link_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[(funcref|classref|memberref|enumref|headerref)\b[\s]*" attribute="d_structure" context="c_link" /> +</context> + +<!-- Anchors --> + +<context name="c_anchor" attribute="d_anchor" lineEndContext="#stay"> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_anchor_finder" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="[" char1="#" attribute="d_structure" context="c_anchor" /> +</context> + +<!-- Images --> + +<context name="c_image" attribute="d_path" lineEndContext="#stay"> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_image_finder" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="[" char1="$" attribute="d_structure" context="c_image" /> +</context> + +<!-- Comments --> + +<context name="c_comment" attribute="d_comment" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <!-- Is this the best approach here? --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_comment" /> + <DetectChar char="]" attribute="d_structure" context="#pop" endRegion="r_comment" /> +</context> + +<context name="c_comment_finder" > + <Detect2Chars char="[" char1="/" attribute="d_structure" context="c_comment" beginRegion="r_comment" /> +</context> + +<!-- Scape sequences --> + +<context name="c_scape_sequence_finder" attribute="d_normal" lineEndContext="#stay"> + <DetectChar char="\" attribute="d_structure" context="c_scape_character" /> +</context> + +<context name="c_scape_character" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="." minimal="true" attribute="d_normal" context="#pop" /> +</context> + +<!-- Text blocks --> + +<context name="c_normal_text_block" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_strict_normal" /> + <DetectChar char="]" attribute="d_structure" context="#pop" endRegion="r_text_block"/> +</context> + +<context name="c_text_block_finder" attribute="d_normal" lineEndContext="#stay"> + <Detect2Chars char="[" char1=":" attribute="d_structure" context="c_normal_text_block" beginRegion="r_text_block" /> + <RegExpr String="[\[][\x0022]" minimal="true" attribute="d_structure" context="c_normal_text_block" beginRegion="r_text_block"/> + <RegExpr String="\[(pre|footnote|blurb|warning|note|tip|important|pre|caution)(\b|\W|$)" minimal="true" attribute="d_structure" context="c_normal_text_block" beginRegion="r_text_block"/> +</context> + + +<context name="c_simple_text_block" attribute="d_anchor" lineEndContext="#stay"> + <DetectChar char="]" attribute="d_structure" context="#pop" /> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_indirect_normal_block" /> +</context> + +<context name="c_simple_text_block_finder" attribute="d_normal" lineEndContext="#stay"> + <DetectChar char="[" attribute="d_structure" context="c_simple_text_block" /> +</context> + +<!-- Includes --> + +<context name="c_included_path" attribute="d_path" lineEndContext="#stay"> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop#pop" /> +</context> + +<context name="c_include" attribute="d_anchor" lineEndContext="#stay"> + <RegExpr String="\s" minimal="true" attribute="d_structure" context="c_included_path" /> +</context> + +<context name="c_includes_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[include" attribute="d_structure" context="c_include" /> + <StringDetect String="[xinclude" attribute="d_structure" context="c_include" /> +</context> + +<!-- Import --> + +<context name="c_import_path" attribute="d_path" lineEndContext="#stay"> + <IncludeRules context="c_simple_text_block_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_import_finder" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[import" attribute="d_structure" context="c_import_path" /> +</context> + +<!-- Document Type logic --> + +<context name="c_quickbook_type_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[(book|article|library|chapter|part|appendix|preface|qandadiv|qandaset|reference|set)\b" minimal="true" attribute="d_structure" context="c_documment_definition" beginRegion="r_documment_definition" /> +</context> + +<context name="c_documment_definition" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_quickbook_attribute_finder" /> + <DetectChar char="]" attribute="d_structure" context="#pop" endRegion="r_documment_definition"/> +</context> + +<context name="c_quickbook_attribute_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[(quickbook|version|id|dirname|copyright|purpose|category|authors|license|source\-mode)\b" minimal="true" attribute="d_structure" context="c_normal_block" /> + +</context> + +<!-- Tables + + [table A Simple Table + [[Heading 1] [Heading 2] [Heading 3]] + [[R0-C0] [R0-C1] [R0-C2]] + [[R1-C0] [R1-C1] [R1-C2]] + [[R2-C0] [R2-C1] [R2-C2]]] --> + +<context name="c_table" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_strict_normal" /> + <DetectChar char="[" attribute="d_structure" context="c_table_title_row" /> +</context> + +<context name="c_table_title_row" attribute="d_nop" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_table_title_cell" /> + <DetectChar char="]" attribute="d_structure" context="c_table_body" /> +</context> + +<context name="c_table_title_cell" attribute="d_table_title_cell" lineEndContext="#stay"> + <IncludeRules context="c_strict_normal" /> + + <DetectChar char="[" attribute="d_structure" context="c_table_cell" /> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_table_body" attribute="d_nop" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_table_row" /> + <DetectChar char="]" attribute="d_structure" context="#pop#pop#pop" endRegion="r_table"/> +</context> + +<context name="c_table_row" attribute="d_nop" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_table_cell" /> + + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_table_cell" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + <RegExpr String="Row[\s]+[\d]+[\s]*,[\s]*Col[\s]+[\d]+[\s]*:" minimal="true" attribute="d_structure" context="#stay" /> + <!--DetectChar char="[" attribute="d_structure" context="c_table_cell" /--> + <DetectChar char="]" attribute="d_structure" context="#pop" /> +</context> + +<context name="c_table_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[table\b" minimal="true" attribute="d_structure" context="c_table" beginRegion="r_table" /> +</context> + +<!-- Variable List + + [variablelist A Variable List + [[term 1] [The definition of term 1]] + [[term 2] [The definition of term 2]] + [[term 3] [The definition of term 3]] + ] + --> + +<context name="c_variable_list" attribute="d_normal_bold" lineEndContext="#stay"> + <IncludeRules context="c_strict_normal" /> + <DetectChar char="[" attribute="d_structure" context="c_var_list_body_1" /> + <DetectChar char="]" attribute="d_structure" context="#pop" endRegion="r_variable_list"/> +</context> + +<context name="c_var_list_body_1" attribute="d_nop" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_var_list_element_name" /> +</context> + +<context name="c_var_list_body_2" attribute="d_nop" lineEndContext="#stay"> + + <!-- For performance the [endsect] resets the engine --> + <StringDetect String="[endsect]" attribute="d_structure" context="#pop#pop#pop#pop#pop" endRegion="r_section"/> + + <DetectChar char="[" attribute="d_structure" context="c_var_list_element_info" /> +</context> + +<context name="c_var_list_body_3" attribute="d_nop" lineEndContext="#stay"> + <DetectChar char="]" attribute="d_structure" context="#pop#pop#pop#pop#pop" /> +</context> + +<context name="c_var_list_element_name" attribute="d_list_element_name" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + <DetectChar char="]" attribute="d_structure" context="c_var_list_body_2" /> +</context> + +<context name="c_var_list_element_info" attribute="d_normal" lineEndContext="#stay"> + <IncludeRules context="c_normal" /> + <DetectChar char="]" attribute="d_structure" context="c_var_list_body_3" /> +</context> + +<context name="c_variable_list_finder" attribute="d_normal" lineEndContext="#stay"> + <RegExpr String="\[variablelist\b" minimal="true" attribute="d_structure" context="c_variable_list" beginRegion="r_variable_list" /> +</context> + + +<!-- + boost::hs +--> + +<context name="c_boost::hs call finder" attribute="d_boost::hs"> + <StringDetect String="[/boost::hs::turn_off()]" attribute="d_boost::hs" context="c_scape_highlighting" /> + <StringDetect String="[/boost::hs::turn_on()]" attribute="d_boost::hs" context="#stay" /> + <StringDetect String="[/boost::hs::begin_region()]" attribute="d_boost::hs" context="#stay" beginRegion="r_boost::hs::region" /> + <StringDetect String="[/boost::hs::end_region()]" attribute="d_boost::hs" context="#stay" endRegion="r_boost::hs::region" /> +</context> + +<context name="c_scape_highlighting" attribute="d_normal" lineEndContext="#stay"> + <StringDetect String="[/boost::hs::turn_on()]" attribute="d_boost::hs" context="#pop" /> + <StringDetect String="[/boost::hs::turn_off()]" attribute="d_boost::hs" context="#stay" /> +</context> + +</contexts> + +<!-- + This section defines the colors and format of each type of string parsed + Try to use defaults so the user can change it as he wished +--> + +<itemDatas> + + <itemData name="d_normal" defStyleNum="dsNormal" /> + + <itemData name="d_normal_bold" bold="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_italic" italic="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_underline" underline="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_bold_italic" bold="true" italic="true" defStyleNum="dsNormal" /> + <itemData name="d_normal_bold_underline" bold="true" underline="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_italic_underline" italic="true" underline="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_bold_italic_underline" bold="true" italic="true" underline="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_strikeout" strikeout="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_teletype" italic="true" defStyleNum="dsNormal" /> + + <itemData name="d_normal_replaceable" italic="true" defStyleNum="dsNormal" /> + + <itemData name="d_anchor" defStyleNum="dsDataType" /> + + <itemData name="d_macro" defStyleNum="dsDataType" /> + + <itemData name="d_path" defStyleNum="dsOthers" /> + + <itemData name="d_structure" color="#5555FF" defStyleNum="dsNormal" /> + + <itemData name="d_comment" defStyleNum="dsComment" /> + + <itemData name="d_table_title_cell" color="#000000" bold="true" backgroundColor="#E6E6E6" defStyleNum="dsNormal" /> + + <itemData name="d_list_element_name" bold="true" defStyleNum="dsNormal" /> + + <itemData name="d_nop" defStyleNum="dsComment" /> + + <itemData name="d_boost::hs" defStyleNum="dsFunction" /> + +</itemDatas> + +<!-- Last Part, Give acces to some tools, for example comment/uncomment in edit menu --> + +</highlighting> + +<general> + + <comments> + + <comment name="multiLine" start="[/" end="]" region="r_comment" /> + + </comments> + +</general> + +</language> + +<!-- + +Aknowelegments +================================================= + +Boost.Quickbook is a poweful C++ documentation tool. +It is developped by Joel de Guzman and Eric Niebler, I am very thankful they give +this tool a Boost License and allowed C++ developpers to document their work +in a easy and fun way. +Check www.boost.org to get the tool and meet one of the most impressive c++ +library communities in the world. + +Version history +================================================= + +[ 0.9.4 ] Add [heading ] +Add templates +Add import +[ 0.9.3 ] "[endsect]" reset the engine to avoid lags in long files +[ 0.9.2 ] Change file name ( quickbook_sintaxis.xml -> boost::hs::quickbook.xml ) +Change section ( Docs -> boost::hs ), +Change name ( Boost.Quickbook -> quickbook ) +This changes aims to incorporate a boost kate sintaxis framework in KDE. +[ 0.9.1 ] Fixed simple formating ( for example: "*this] [that*" is not longer bolded ). +[ 0.9.0 ] Initial beta, sended to Joel de Guzman and Eric Niebler. + +Known bugs +================================================= + +Feedback will be appreciated. +They are very small and it is very unlikely to encounter one. + +* List items * and # are not fully implemented. +* The line ` \\ C++ comment ` is not working because of Kate C++ +highlight definitions. +* Python code is not yet supported. + +--> diff --git a/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_std.xml b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_std.xml new file mode 100644 index 000000000..202d3e560 --- /dev/null +++ b/src/boost/tools/quickbook/extra/katepart/syntax/boost_hs_std.xml @@ -0,0 +1,620 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE language SYSTEM "language.dtd"> + +<language + +name="std-c++" +version="0.1.0" +kateversion="2.4" +section="boost::hs" +extensions="*.std" +mimetype="allFiles" +author="Copyright 2006 -2007 Matias Capeletto, matias.capeletto@gmail.com" +priority="9" +license="Distributed under the Boost Software License, Version 1.0. +http://www.boost.org/LICENSE_1_0.txt" + +> + + + +<highlighting> + +<list name="std.free.function" > + + <!-- std.algorithm --> + + <item> adjacent_find </item> + <item> binary_search </item> + <item> copy </item> + <item> copy_backward </item> + <item> count </item> + <item> count_if </item> + <item> equal </item> + <item> equal_range </item> + <item> fill </item> + <item> fill_n </item> + <item> find </item> + <item> find_end </item> + <item> find_first_of </item> + <item> find_if </item> + <item> for_each </item> + <item> generate </item> + <item> generate_n </item> + <item> includes </item> + <item> inplace_merge </item> + <item> iter_swap </item> + <item> lexicographical_compare </item> + <item> lower_bound </item> + <item> make_heap </item> + <item> max </item> + <item> max_element </item> + <item> merge </item> + <item> min </item> + <item> min_element </item> + <item> mismatch </item> + <item> next_permutation </item> + <item> nth_element </item> + <item> partial_sort </item> + <item> partial_sort_copy </item> + <item> partition </item> + <item> pop_heap </item> + <item> prev_permutation </item> + <item> push_heap </item> + <item> random_shuffle </item> + <item> remove </item> + <item> remove_copy </item> + <item> remove_copy_if </item> + <item> remove_if </item> + <item> replace </item> + <item> replace_copy </item> + <item> replace_copy_if </item> + <item> replace_if </item> + <item> reverse </item> + <item> reverse_copy </item> + <item> rotate </item> + <item> rotate_copy </item> + <item> search </item> + <item> search_n </item> + <item> set_difference </item> + <item> set_intersection </item> + <item> set_symmetric_difference </item> + <item> set_union </item> + <item> sort </item> + <item> sort_heap </item> + <item> stable_partition </item> + <item> stable_sort </item> + <item> swap </item> + <item> swap_ranges </item> + <item> transform </item> + <item> unique </item> + <item> unique_copy </item> + <item> upper_bound </item> + + <!-- std.assert --> + + <item> assert </item> + + <!-- std.math --> + + <item> abs </item> + <item> arg </item> + <item> conj </item> + <item> cos </item> + <item> cosh </item> + <item> exp </item> + <item> imag </item> + <item> log </item> + <item> log10 </item> + <item> norm </item> + <item> polar </item> + <item> pow </item> + <item> real </item> + <item> sin </item> + <item> sinh </item> + <item> sqrt </item> + <item> tan </item> + <item> tanh </item> + <item> acos </item> + <item> asin </item> + <item> atan </item> + <item> atan2 </item> + + <!-- std.exception --> + + <item> terminate_handler </item> + <item> unexpected_handler </item> + + <item> set_terminate </item> + + <item> set_unexpected </item> + <item> terminate </item> + <item> unexpected </item> + <item> uncaught_exception </item> + + <!-- std.iterator --> + + <item> advance </item> + <item> distance </item> + + <!-- std.memory --> + + <item> get_temporary_buffer </item> + <item> return_temporary_buffer </item> + <item> uninitialized_copy </item> + <item> uninitialized_fill </item> + <item> uninitialized_fill_n </item> + + <!-- std.new --> + + <item> set_new_handler </item> + + <!-- std.numeric --> + + <item> accumulate </item> + <item> inner_product </item> + <item> partial_sum </item> + <item> adjacent_difference </item> + + <!-- std.string --> + + <item> getline </item> + <item> swap </item> + + <!-- std.pair --> + + <item> make_pair </item> + + <!-- std.locale --> + + <item> has_facet </item> + <item> use_facet </item> + <item> isalnum </item> + <item> isalpha </item> + <item> iscntrl </item> + <item> isdigit </item> + <item> isgraph </item> + <item> islower </item> + <item> isprint </item> + <item> ispunct </item> + <item> isspace </item> + <item> isupper </item> + <item> isxdigit </item> + <item> tolower </item> + <item> toupper </item> + +</list> + +<list name="std.template.classes" > + + <!-- std.complex --> + + <item> complex </item> + + <!-- std_iterator --> + + <item> back_insert_iterator </item> + <item> back_inserter </item> + <item> front_insert_iterator </item> + <item> front_inserter </item> + <item> insert_iterator </item> + <item> inserter </item> + <item> istream_iterator </item> + <item> istreambuf_iterator </item> + <item> iterator </item> + <item> ostream_iterator </item> + <item> ostreambuf_iterator </item> + <item> reverse_iterator </item> + + <!-- std.memory --> + + <item> allocator </item> + <item> raw_storage_iterator </item> + <item> auto_ptr </item> + <item> auto_ptr_ref </item> + + <!-- std.string --> + + <item> basic_string </item> + + <!-- std.utility --> + + <item> pair </item> + + <!-- std.valarray --> + + <item> gslice_array </item> + <item> indirect_array </item> + <item> mask_array </item> + <item> slice_array </item> + <item> valarray </item> + + <!-- std.locale --> + + <item> messages </item> + <item> codecvt_byname </item> + <item> collate </item> + <item> collate_byname </item> + <item> ctype </item> + <item> ctype_byname </item> + <item> messages_byname </item> + <item> money_base </item> + <item> money_get </item> + <item> money_put </item> + <item> moneypunct </item> + <item> moneypunct_byname </item> + <item> num_get </item> + <item> num_put </item> + <item> numpunct </item> + <item> numpunct_byname </item> + <item> time_base </item> + <item> time_get </item> + <item> time_get_byname </item> + <item> time_put </item> + <item> time_put_byname </item> + + <!-- std.ios --> + + <item> basic_ios </item> + <item> fpos </item> + + <!-- std.ios_fwd --> + + <item> istreambuf_iterator </item> + <item> ostreambuf_iterator </item> + <item> basic_streambuf </item> + <item> basic_istream </item> + <item> basic_ostream </item> + <item> basic_iostream </item> + <item> basic_stringbuf </item> + <item> basic_istringstream </item> + <item> basic_ostringstream </item> + <item> basic_stringstream </item> + <item> basic_filebuf </item> + <item> basic_ifstream </item> + <item> basic_ofstream </item> + <item> basic_fstream </item> + +</list> + + + + +<list name="std.classes" > + + <!-- std.iomanip --> + + <item> resetiosflags </item> + <item> setiosflags </item> + <item> setbase </item> + + <item> setfill </item> + <item> setprecision </item> + <item> setw </item> + + <!-- std.new --> + + <item> new_handler </item> + <item> nothrow_t </item> + + <!-- std.string --> + + <item> string </item> + <item> wstring </item> + + <!-- std.valarray --> + + <item> slice </item> + <item> gslice </item> + + <!-- std.locale --> + + <item> locale </item> + <item> codecvt </item> + <item> codecvt_base </item> + <item> ctype_base </item> + <item> messages_base </item> + + <!-- std.ios --> + + <item> ios_base </item> + <item> streamoff </item> + <item> streampos </item> + <item> streamsize </item> + <item> wios </item> + <item> wstreampos </item> + <item> ios </item> + + <!-- std.ios_fwd --> + + <item> streambuf </item> + <item> istream </item> + <item> ostream </item> + <item> iostream </item> + <item> stringbuf </item> + <item> istringstream </item> + <item> ostringstream </item> + <item> stringstream </item> + <item> filebuf </item> + <item> ifstream </item> + <item> ofstream </item> + <item> fstream </item> + <item> wstreambuf </item> + <item> wistream </item> + <item> wostream </item> + <item> wiostream </item> + <item> wstringbuf </item> + <item> wistringstream </item> + <item> wostringstream </item> + <item> wstringstream </item> + <item> wfilebuf </item> + <item> wifstream </item> + <item> wofstream </item> + <item> wfstream </item> + +</list> + + +<list name="std.exceptions"> + + <!-- std.exception --> + + <item> exception </item> + <item> bad_exception </item> + + <!-- std.new --> + + <item> bad_alloc </item> + + <!-- std.stdexcept --> + + <item> logic_error </item> + <item> domain_error </item> + <item> invalid_argument </item> + <item> length_error </item> + <item> out_of_range </item> + + <item> runtime_error </item> + <item> range_error </item> + <item> overflow_error </item> + <item> underflow_error </item> + + <!-- std.typeinfo --> + + <item> bad_cast </item> + <item> bad_typeid </item> + +</list> + + +<list name="std.macro" > + + <!-- std.complex --> + + <item> __STD_COMPLEX </item> + +</list> + + + +<list name="std.metaprograming"> + + <!-- std.functional --> + + <item> binary_function </item> + <item> binary_negate </item> + <item> binder1st </item> + <item> binder2nd </item> + <item> const_mem_fun_t </item> + <item> const_mem_fun_ref_t </item> + <item> const_mem_fun1_t </item> + <item> const_mem_fun1_ref_t </item> + <item> divides </item> + <item> equal_to </item> + <item> greater </item> + <item> greater_equal </item> + <item> less </item> + <item> less_equal </item> + <item> logical_and </item> + <item> logical_not </item> + <item> logical_or </item> + <item> mem_fun_t </item> + <item> mem_fun_ref_t </item> + <item> mem_fun1_t </item> + <item> mem_fun1_ref_t </item> + <item> minus </item> + <item> modulus </item> + <item> multiplies </item> + <item> negate </item> + <item> not_equal_to </item> + <item> plus </item> + <item> pointer_to_binary_function </item> + <item> pointer_to_unary_function </item> + <item> unary_function </item> + <item> unary_negate </item> + <item> bind1st </item> + <item> bind2nd </item> + <item> mem_fun </item> + <item> mem_fun_ref </item> + <item> not1 </item> + <item> not2 </item> + <item> ptr_fun </item> + + <!-- std.limits --> + + <item> numeric_limits </item> + + <!-- std.iterator --> + + <item> iterator_traits </item> + + <!-- std.string --> + + <item> char_traits </item> + + <!-- std.typeinfo --> + + <item> type_info </item> + +</list> + +<list name="std.object"> + + <!-- std.iostream --> + + <item> cin </item> + <item> cout </item> + <item> cerr </item> + <item> clog </item> + + <item> wcin </item> + <item> wcout </item> + <item> wcerr </item> + <item> wclog </item> + + <!-- std.new --> + + <item> nothrow </item> + +</list> + + +<list name="std.tags"> + + <item> bidirectional_iterator_tag </item> + <item> forward_iterator_tag </item> + <item> input_iterator_tag </item> + <item> output_iterator_tag </item> + <item> random_access_iterator_tag </item> + +</list> + +<list name="std.containers"> + + <item> bit_set </item> + <item> deque </item> + <item> list </item> + <item> queue </item> + <item> set </item> + <item> multiset </item> + <item> slist </item> + <item> map </item> + <item> multimap </item> + <item> unordered_map </item> + <item> stack </item> + <item> vector </item> + +</list> + + + +<list name="std.ios_manipulators"> + + <item> boolalpha </item> + <item> dec </item> + <item> fixed </item> + <item> hex </item> + <item> internal </item> + <item> left </item> + <item> noboolalpha </item> + <item> noshowbase </item> + <item> noshowpoint </item> + <item> noshowpos </item> + <item> noskipws </item> + <item> nounitbuf </item> + <item> nouppercase </item> + <item> oct </item> + <item> right </item> + <item> scientific </item> + <item> showbase </item> + <item> showpoint </item> + <item> showpos </item> + <item> skipws </item> + <item> unitbuf </item> + <item> uppercase </item> + +</list> + + +<contexts> + + <context name="main" attribute="std.free.function"> + + <keyword attribute="std.free.function" context="#stay" String="std.free.function" /> + <keyword attribute="std.template.classes" context="#stay" String="std.template.classes" /> + <keyword attribute="std.classes" context="#stay" String="std.classes" /> + <keyword attribute="std.exceptions" context="#stay" String="std.exceptions" /> + <keyword attribute="std.macro" context="#stay" String="std.macro" /> + <keyword attribute="std.metaprogramming" context="#stay" String="std.metaprogramming" /> + <keyword attribute="std.object" context="#stay" String="std.object" /> + <keyword attribute="std.tags" context="#stay" String="std.tags" /> + <keyword attribute="std.containers" context="#stay" String="std.containers" /> + <keyword attribute="std.ios_manipulators" context="#stay" String="std.ios_manipulators" /> + + </context> + +</contexts> + +<itemDatas> + + <itemData name="std.free.function" defStyleNum="dsFunction"/> + <itemData name="std.template.classes" defStyleNum="dsDataType"/> + <itemData name="std.classes" defStyleNum="dsDataType"/> + <itemData name="std.exceptions" defStyleNum="dsDataType"/> + <itemData name="std.macro" defStyleNum="dsOthers"/> + <itemData name="std.metaprogramming" defStyleNum="dsFunction"/> + <itemData name="std.object" defStyleNum="dsDataType"/> + <itemData name="std.tags" defStyleNum="dsOthers"/> + <itemData name="std.containers" defStyleNum="dsDataType"/> + <itemData name="std.ios_manipulators" defStyleNum="dsFunction"/> + + <!-- + This is an extract from the official Kate page + It is leave here as a reference. + + dsNormal used for normal text. + dsKeyword used for keywords. + dsDataType used for data types. + dsDecVal used for decimal values. + dsBaseN used for values with a base other than 10. + dsFloat used for float values. + dsChar used for a character. + dsString used for strings. + dsComment used for comments. + dsOthers used for 'other' things. + dsAlert used for warning messages. + dsFunction used for function calls. + dsRegionMarker used for region markers. + dsError used for error highlighting and wrong syntax. + + --> + +</itemDatas> + +</highlighting> + +<general> + +<keywords casesensitive="1" /> + +</general> + +</language> + + +<!-- + +Aknowelegments +================================================= + + + +Version history +================================================= + +[ 0.1.0 ] Initial beta. + +Known bugs +================================================= + +--> diff --git a/src/boost/tools/quickbook/index.html b/src/boost/tools/quickbook/index.html new file mode 100644 index 000000000..35faddf3b --- /dev/null +++ b/src/boost/tools/quickbook/index.html @@ -0,0 +1,15 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <meta http-equiv="refresh" content="0; URL=../../doc/html/quickbook.html"> + </head> + <body> + Automatic redirection failed, click this + <a href="../../doc/html/quickbook.html">link</a> + <p>Copyright Eric Niebler 2005</p> + <p>Distributed under the Boost Software License, Version 1.0. (See accompanying file + <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at + <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>). + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/meta/explicit-failures-markup.xml b/src/boost/tools/quickbook/meta/explicit-failures-markup.xml new file mode 100644 index 000000000..a9097c2c7 --- /dev/null +++ b/src/boost/tools/quickbook/meta/explicit-failures-markup.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2017 Daniel James + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +--> +<explicit-failures-markup> + <library name="quickbook"> + <mark-unusable> + <toolset name="gcc*-3.*"/> + <toolset name="gcc*-4.0*"/> + <toolset name="gcc*-4.1*"/> + <toolset name="gcc*-4.2*"/> + <toolset name="gcc*-4.3*"/> + <toolset name="qcc-3.*"/> + <toolset name="qcc-4.0.*"/> + <toolset name="qcc-4.1.*"/> + <toolset name="qcc-4.2.*"/> + <toolset name="qcc-4.3.*"/> + <toolset name="msvc-7.1"/> + <toolset name="msvc-8.0"/> + <toolset name="msvc-9.0"/> + <note author="Daniel James" date="30 Dec 2017"> + Unsupported compiler + </note> + </mark-unusable> + <mark-unusable> + <toolset name="*~c++98"/> + <toolset name="*~gnu98"/> + <toolset name="*~gnu++98"/> + <note author="Daniel James" date="29 Jan 2018"> + C++11 mode (or later) required + </note> + </mark-unusable> + </library> +</explicit-failures-markup> diff --git a/src/boost/tools/quickbook/src/Jamfile.v2 b/src/boost/tools/quickbook/src/Jamfile.v2 new file mode 100644 index 000000000..fe62c33f5 --- /dev/null +++ b/src/boost/tools/quickbook/src/Jamfile.v2 @@ -0,0 +1,62 @@ +#============================================================================== +# Copyright (c) 2002 2004 2006 Joel de Guzman +# Copyright (c) 2004 Eric Niebler +# http://spirit.sourceforge.net/ +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +lib shell32 ; + +exe quickbook + : + quickbook.cpp + actions.cpp + doc_info_actions.cpp + state.cpp + dependency_tracker.cpp + utils.cpp + files.cpp + native_text.cpp + stream.cpp + glob.cpp + path.cpp + include_paths.cpp + values.cpp + document_state.cpp + id_generation.cpp + id_xml.cpp + post_process.cpp + bb2html.cpp + boostbook_chunker.cpp + xml_parse.cpp + html_printer.cpp + tree.cpp + collector.cpp + template_stack.cpp + code_snippet.cpp + markups.cpp + syntax_highlight.cpp + grammar.cpp + main_grammar.cpp + block_element_grammar.cpp + phrase_element_grammar.cpp + doc_info_grammar.cpp + /boost//program_options + /boost//filesystem + : #<define>QUICKBOOK_NO_DATES + <define>BOOST_FILESYSTEM_NO_DEPRECATED + <toolset>msvc:<cxxflags>/wd4355 + <toolset>msvc:<cxxflags>/wd4511 + <toolset>msvc:<cxxflags>/wd4512 + <toolset>msvc:<cxxflags>/wd4701 + <toolset>msvc:<cxxflags>/wd4702 + <toolset>msvc:<cxxflags>/wd4244 + <toolset>msvc:<cxxflags>/wd4267 + <toolset>msvc:<cxxflags>/wd4800 + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <target-os>windows:<library>shell32 + ; diff --git a/src/boost/tools/quickbook/src/actions.cpp b/src/boost/tools/quickbook/src/actions.cpp new file mode 100644 index 000000000..a40741686 --- /dev/null +++ b/src/boost/tools/quickbook/src/actions.cpp @@ -0,0 +1,1973 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "actions.hpp" +#include <functional> +#include <map> +#include <numeric> +#include <set> +#include <vector> +#include <boost/algorithm/string/replace.hpp> +#include <boost/filesystem/convenience.hpp> +#include <boost/filesystem/fstream.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/next_prior.hpp> +#include <boost/range/algorithm/replace.hpp> +#include <boost/range/distance.hpp> +#include "block_tags.hpp" +#include "document_state.hpp" +#include "files.hpp" +#include "for.hpp" +#include "grammar.hpp" +#include "markups.hpp" +#include "path.hpp" +#include "phrase_tags.hpp" +#include "quickbook.hpp" +#include "state.hpp" +#include "state_save.hpp" +#include "stream.hpp" +#include "syntax_highlight.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace + { + void write_anchors(quickbook::state& state, collector& tgt) + { + if (state.source_mode_next) { + detail::outwarn( + state.source_mode_next_pos.get_file(), + state.source_mode_next_pos.get_position()) + << "Temporary source mode unsupported here." << std::endl; + state.source_mode_next = 0; + } + + QUICKBOOK_FOR (auto const& anchor_id, state.anchors) { + tgt << "<anchor id=\""; + detail::print_string(anchor_id, tgt.get()); + tgt << "\"/>"; + } + + state.anchors.clear(); + } + + std::string add_anchor( + quickbook::state& state, + quickbook::string_view id, + id_category::categories category = id_category::explicit_anchor_id) + { + std::string placeholder = state.document.add_anchor(id, category); + state.anchors.push_back(placeholder); + return placeholder; + } + + std::string get_attribute_value( + quickbook::state& state, quickbook::value const& value) + { + std::string x = value.is_encoded() ? value.get_encoded() + : value.get_quickbook().to_s(); + + if (x.empty()) { + detail::outerr(value.get_file(), value.get_position()) + << "Empty attribute value." << std::endl; + ++state.error_count; + x = "xxx"; + } + + return x; + } + + std::string validate_id( + quickbook::state& state, quickbook::value const& id_value) + { + bool valid = true; + std::string id = get_attribute_value(state, id_value); + + // Special case since I use dollar ids for id placeholders. + if (id[0] == '$') { + valid = false; + id[0] = '_'; + } + + if (qbk_version_n >= 107u) { + char const* allowed_punctuation = "_.-"; + + QUICKBOOK_FOR (char c, id) { + if (!std::isalnum(c) && + !std::strchr(allowed_punctuation, c)) + valid = false; + } + } + + if (!valid) { + detail::outerr(id_value.get_file(), id_value.get_position()) + << "Invalid id: " << (id_value.is_encoded() + ? id_value.get_encoded() + : id_value.get_quickbook().to_s()) + << std::endl; + ++state.error_count; + } + + return id; + } + } + + bool quickbook_range::in_range() const + { + return qbk_version_n >= lower && qbk_version_n < upper; + } + + bool quickbook_strict::is_strict_checking() const + { + return state.strict_mode; + } + + void list_action(quickbook::state&, value); + void header_action(quickbook::state&, value); + void begin_section_action(quickbook::state&, value); + void end_section_action(quickbook::state&, value, string_iterator); + void block_action(quickbook::state&, value); + void block_empty_action(quickbook::state&, value); + void macro_definition_action(quickbook::state&, value); + void template_body_action(quickbook::state&, value); + void variable_list_action(quickbook::state&, value); + void table_action(quickbook::state&, value); + void xinclude_action(quickbook::state&, value); + void include_action(quickbook::state&, value, string_iterator); + void image_action(quickbook::state&, value); + void anchor_action(quickbook::state&, value); + void link_action(quickbook::state&, value); + void phrase_action(quickbook::state&, value); + void role_action(quickbook::state&, value); + void footnote_action(quickbook::state&, value); + void raw_phrase_action(quickbook::state&, value); + void source_mode_action(quickbook::state&, value); + void next_source_mode_action(quickbook::state&, value); + void code_action(quickbook::state&, value); + void do_template_action(quickbook::state&, value, string_iterator); + + void element_action::operator()(parse_iterator first, parse_iterator) const + { + value_consumer values = state.values.release(); + if (!values.check() || !state.conditional) return; + value v = values.consume(); + values.finish(); + + switch (v.get_tag()) { + case block_tags::ordered_list: + case block_tags::itemized_list: + return list_action(state, v); + case block_tags::generic_heading: + case block_tags::heading1: + case block_tags::heading2: + case block_tags::heading3: + case block_tags::heading4: + case block_tags::heading5: + case block_tags::heading6: + return header_action(state, v); + case block_tags::begin_section: + return begin_section_action(state, v); + case block_tags::end_section: + return end_section_action(state, v, first.base()); + case block_tags::blurb: + case block_tags::preformatted: + case block_tags::blockquote: + case block_tags::warning: + case block_tags::caution: + case block_tags::important: + case block_tags::note: + case block_tags::tip: + case block_tags::block: + return block_action(state, v); + case block_tags::hr: + return block_empty_action(state, v); + case block_tags::macro_definition: + return macro_definition_action(state, v); + case block_tags::template_definition: + return template_body_action(state, v); + case block_tags::variable_list: + return variable_list_action(state, v); + case block_tags::table: + return table_action(state, v); + case block_tags::xinclude: + return xinclude_action(state, v); + case block_tags::import: + case block_tags::include: + return include_action(state, v, first.base()); + case phrase_tags::image: + return image_action(state, v); + case phrase_tags::anchor: + return anchor_action(state, v); + case phrase_tags::url: + case phrase_tags::link: + case phrase_tags::funcref: + case phrase_tags::classref: + case phrase_tags::memberref: + case phrase_tags::enumref: + case phrase_tags::macroref: + case phrase_tags::headerref: + case phrase_tags::conceptref: + case phrase_tags::globalref: + return link_action(state, v); + case phrase_tags::bold: + case phrase_tags::italic: + case phrase_tags::underline: + case phrase_tags::teletype: + case phrase_tags::strikethrough: + case phrase_tags::quote: + case phrase_tags::replaceable: + return phrase_action(state, v); + case phrase_tags::footnote: + return footnote_action(state, v); + case phrase_tags::escape: + return raw_phrase_action(state, v); + case phrase_tags::role: + return role_action(state, v); + case source_mode_tags::cpp: + case source_mode_tags::python: + case source_mode_tags::teletype: + return source_mode_action(state, v); + case code_tags::next_source_mode: + return next_source_mode_action(state, v); + case code_tags::code_block: + case code_tags::inline_code_block: + case code_tags::inline_code: + return code_action(state, v); + case template_tags::attribute_template: + case template_tags::template_: + return do_template_action(state, v, first.base()); + default: + break; + } + } + + void break_action::operator()(parse_iterator first, parse_iterator) const + { + write_anchors(state, state.phrase); + + if (*first == '\\') { + detail::outwarn(state.current_file, first.base()) + //<< "in column:" << pos.column << ", " + << "'\\n' is deprecated, pleases use '[br]' instead" + << ".\n"; + } + + if (!state.warned_about_breaks) { + detail::outwarn(state.current_file, first.base()) + << "line breaks generate invalid boostbook " + "(will only note first occurrence).\n"; + + state.warned_about_breaks = true; + } + + state.phrase << detail::get_markup(phrase_tags::break_mark).pre; + } + + void error_message_action::operator()( + parse_iterator first, parse_iterator last) const + { + file_position const pos = state.current_file->position_of(first.base()); + + std::string value(first, last); + std::string formatted_message = message; + boost::replace_all(formatted_message, "%s", value); + boost::replace_all( + formatted_message, "%c", + boost::lexical_cast<std::string>(pos.column)); + + detail::outerr(state.current_file->path, pos.line) + << formatted_message << std::endl; + ++state.error_count; + } + + void error_action::operator()( + parse_iterator first, parse_iterator /*last*/) const + { + file_position const pos = state.current_file->position_of(first.base()); + + detail::outerr(state.current_file->path, pos.line) + << "Syntax Error near column " << pos.column << ".\n"; + ++state.error_count; + } + + void block_action(quickbook::state& state, value block) + { + write_anchors(state, state.out); + + detail::markup markup = detail::get_markup(block.get_tag()); + + value_consumer values = block; + state.out << markup.pre << values.consume().get_encoded() + << markup.post; + values.finish(); + } + + void block_empty_action(quickbook::state& state, value block) + { + write_anchors(state, state.out); + + detail::markup markup = detail::get_markup(block.get_tag()); + state.out << markup.pre; + } + + void phrase_action(quickbook::state& state, value phrase) + { + write_anchors(state, state.phrase); + + detail::markup markup = detail::get_markup(phrase.get_tag()); + + value_consumer values = phrase; + state.phrase << markup.pre << values.consume().get_encoded() + << markup.post; + values.finish(); + } + + void role_action(quickbook::state& state, value role_list) + { + write_anchors(state, state.phrase); + + value_consumer values = role_list; + value role = values.consume(); + value phrase = values.consume(); + values.finish(); + + state.phrase << "<phrase role=\""; + detail::print_string( + get_attribute_value(state, role), state.phrase.get()); + state.phrase << "\">" << phrase.get_encoded() << "</phrase>"; + } + + void footnote_action(quickbook::state& state, value phrase) + { + write_anchors(state, state.phrase); + + value_consumer values = phrase; + state.phrase << "<footnote id=\"" + << state.document.add_id("f", id_category::numbered) + << "\"><para>" << values.consume().get_encoded() + << "</para></footnote>"; + values.finish(); + } + + void raw_phrase_action(quickbook::state& state, value phrase) + { + write_anchors(state, state.phrase); + + detail::markup markup = detail::get_markup(phrase.get_tag()); + state.phrase << markup.pre << phrase.get_quickbook() << markup.post; + } + + void paragraph_action::operator()() const + { + std::string str; + state.phrase.swap(str); + + std::string::const_iterator pos = str.begin(), end = str.end(); + + while (pos != end && cl::space_p.test(*pos)) + ++pos; + + if (pos != end) { + detail::markup markup = + state.in_list + ? detail::get_markup(block_tags::paragraph_in_list) + : detail::get_markup(block_tags::paragraph); + state.out << markup.pre << str; + write_anchors(state, state.out); + state.out << markup.post; + } + } + + void explicit_list_action::operator()() const + { + state.explicit_list = true; + } + + void phrase_end_action::operator()() const + { + write_anchors(state, state.phrase); + } + + namespace + { + void write_bridgehead( + quickbook::state& state, + int level, + std::string const& str, + std::string const& id, + bool self_link) + { + if (self_link && !id.empty()) { + state.out << "<bridgehead renderas=\"sect" << level << "\""; + state.out << " id=\""; + state.out << state.document.add_id("h", id_category::numbered); + state.out << "\">"; + state.out << "<phrase id=\"" << id << "\"/>"; + state.out << "<link linkend=\"" << id << "\">"; + state.out << str; + state.out << "</link>"; + state.out << "</bridgehead>"; + } + else { + state.out << "<bridgehead renderas=\"sect" << level << "\""; + if (!id.empty()) state.out << " id=\"" << id << "\""; + state.out << ">"; + state.out << str; + state.out << "</bridgehead>"; + } + } + } + + void header_action(quickbook::state& state, value heading_list) + { + value_consumer values = heading_list; + + bool generic = heading_list.get_tag() == block_tags::generic_heading; + value element_id = values.optional_consume(general_tags::element_id); + value content = values.consume(); + values.finish(); + + int level; + + if (generic) { + level = state.document.section_level() + 1; + // We need to use a heading which is one greater + // than the current. + if (level > 6) // The max is h6, clip it if it goes + level = 6; // further than that + } + else { + level = heading_list.get_tag() - block_tags::heading1 + 1; + } + + write_anchors(state, state.out); + + if (!element_id.empty()) { + // Use an explicit id. + + std::string anchor = state.document.add_id( + validate_id(state, element_id), id_category::explicit_id); + + write_bridgehead( + state, level, content.get_encoded(), anchor, + self_linked_headers); + } + else if (state.document.compatibility_version() >= 106u) { + // Generate ids for 1.6+ + + std::string anchor = state.document.add_id( + detail::make_identifier(content.get_quickbook()), + id_category::generated_heading); + + write_bridgehead( + state, level, content.get_encoded(), anchor, + self_linked_headers); + } + else { + // Generate ids that are compatible with older versions of + // quickbook. + + // Older versions of quickbook used the generated boostbook, but + // we only have an intermediate version which can contain id + // placeholders. So to generate the ids they must be replaced + // by the ids that the older versions would have used - i.e. the + // unresolved ids. + // + // Note that this doesn't affect the actual boostbook generated for + // the content, it's just used to generate this id. + + std::string id = detail::make_identifier( + state.document.replace_placeholders_with_unresolved_ids( + content.get_encoded())); + + if (generic || state.document.compatibility_version() >= 103) { + std::string anchor = + state.document.add_id(id, id_category::generated_heading); + + write_bridgehead( + state, level, content.get_encoded(), anchor, + self_linked_headers); + } + else { + std::string anchor = state.document.old_style_id( + id, id_category::generated_heading); + + write_bridgehead( + state, level, content.get_encoded(), anchor, false); + } + } + } + + void simple_phrase_action::operator()(char mark) const + { + write_anchors(state, state.phrase); + + int tag = mark == '*' + ? phrase_tags::bold + : mark == '/' + ? phrase_tags::italic + : mark == '_' + ? phrase_tags::underline + : mark == '=' ? phrase_tags::teletype : 0; + + assert(tag != 0); + detail::markup markup = detail::get_markup(tag); + + value_consumer values = state.values.release(); + value content = values.consume(); + values.finish(); + + state.phrase << markup.pre; + state.phrase << content.get_encoded(); + state.phrase << markup.post; + } + + bool cond_phrase_push::start() + { + value_consumer values = state.values.release(); + + saved_conditional = state.conditional; + + if (saved_conditional) { + bool positive = values.consume().get_quickbook().empty(); + quickbook::string_view macro1 = values.consume().get_quickbook(); + std::string macro(macro1.begin(), macro1.end()); + + state.conditional = + (bool)find(state.macro, macro.c_str()) == positive; + + if (!state.conditional) { + state.push_output(); + state.anchors.swap(anchors); + } + } + + return true; + } + + void cond_phrase_push::cleanup() + { + if (saved_conditional && !state.conditional) { + state.pop_output(); + state.anchors.swap(anchors); + } + + state.conditional = saved_conditional; + } + + void state::start_list(char mark) + { + push_tagged_source_mode(source_mode_next); + source_mode_next = 0; + + write_anchors(*this, (in_list ? phrase : out)); + assert(mark == '*' || mark == '#'); + push_output(); + out << ((mark == '#') ? "<orderedlist>\n" : "<itemizedlist>\n"); + in_list = true; + } + + void state::end_list(char mark) + { + write_anchors(*this, out); + assert(mark == '*' || mark == '#'); + out << ((mark == '#') ? "\n</orderedlist>" : "\n</itemizedlist>"); + + std::string list_output; + out.swap(list_output); + + pop_output(); + + (in_list ? phrase : out) << list_output; + + pop_tagged_source_mode(); + } + + void state::start_list_item() + { + out << "<listitem>"; + write_anchors(*this, phrase); + } + + void state::end_list_item() + { + write_anchors(*this, phrase); + paragraph_action para(*this); + para(); + out << "</listitem>"; + } + + namespace + { + bool parse_template( + value const&, + quickbook::state& state, + bool is_attribute_template = false); + } + + void state::start_callouts() { ++callout_depth; } + + std::string state::add_callout(value v) + { + std::string callout_id1 = document.add_id("c", id_category::numbered); + std::string callout_id2 = document.add_id("c", id_category::numbered); + + callouts.insert(encoded_value(callout_id1)); + callouts.insert(encoded_value(callout_id2)); + callouts.insert(v); + + std::string code; + code += "<co id=\"" + callout_id1 + "\" "; + code += "linkends=\"" + callout_id2 + "\" />"; + + return code; + } + + std::string state::end_callouts() + { + assert(callout_depth > 0); + std::string block; + + --callout_depth; + if (callout_depth > 0) return block; + + value_consumer c = callouts.release(); + if (!c.check()) return block; + + block += "<calloutlist>"; + while (c.check()) { + std::string callout_id1 = c.consume().get_encoded(); + std::string callout_id2 = c.consume().get_encoded(); + value callout_body = c.consume(); + + std::string callout_value; + + { + state_save save(*this, state_save::scope_all); + ++template_depth; + + bool r = parse_template(callout_body, *this); + + if (!r) { + detail::outerr( + callout_body.get_file(), callout_body.get_position()) + << "Expanding callout." << std::endl + << "------------------begin------------------" + << std::endl + << callout_body.get_quickbook() << std::endl + << "------------------end--------------------" + << std::endl; + ++error_count; + } + + out.swap(callout_value); + } + + block += "<callout arearefs=\"" + callout_id1 + "\" "; + block += "id=\"" + callout_id2 + "\">"; + block += callout_value; + block += "</callout>"; + } + block += "</calloutlist>"; + + return block; + } + + void list_action(quickbook::state& state, value list) + { + write_anchors(state, state.out); + + detail::markup markup = detail::get_markup(list.get_tag()); + + state.out << markup.pre; + + QUICKBOOK_FOR (value item, list) { + state.out << "<listitem>"; + state.out << item.get_encoded(); + state.out << "</listitem>"; + } + + state.out << markup.post; + } + + void anchor_action(quickbook::state& state, value anchor) + { + value_consumer values = anchor; + value anchor_id = values.consume(); + // Note: anchor_id is never encoded as boostbook. If it + // is encoded, it's just things like escapes. + add_anchor(state, validate_id(state, anchor_id)); + values.finish(); + } + + void do_macro_action::operator()(std::string const& str) const + { + write_anchors(state, state.phrase); + + if (str == quickbook_get_date) { + char strdate[64]; + strftime(strdate, sizeof(strdate), "%Y-%b-%d", current_time); + state.phrase << strdate; + } + else if (str == quickbook_get_time) { + char strdate[64]; + strftime(strdate, sizeof(strdate), "%I:%M:%S %p", current_time); + state.phrase << strdate; + } + else { + state.phrase << str; + } + } + + void raw_char_action::operator()(char ch) const { state.phrase << ch; } + + void raw_char_action::operator()( + parse_iterator first, parse_iterator last) const + { + while (first != last) + state.phrase << *first++; + } + + void source_mode_action(quickbook::state& state, value source_mode) + { + state.change_source_mode(source_mode.get_tag()); + } + + void next_source_mode_action(quickbook::state& state, value source_mode) + { + value_consumer values = source_mode; + state.source_mode_next_pos = values.consume(); + state.source_mode_next = values.consume().get_int(); + values.finish(); + } + + void code_action(quickbook::state& state, value code_block) + { + int code_tag = code_block.get_tag(); + + value_consumer values = code_block; + quickbook::string_view code_value = values.consume().get_quickbook(); + values.finish(); + + bool inline_code = + code_tag == code_tags::inline_code || + (code_tag == code_tags::inline_code_block && qbk_version_n < 106u); + bool block = code_tag != code_tags::inline_code; + + source_mode_type source_mode = + state.source_mode_next ? state.source_mode_next + : state.current_source_mode().source_mode; + state.source_mode_next = 0; + + if (inline_code) { + write_anchors(state, state.phrase); + } + else { + paragraph_action para(state); + para(); + write_anchors(state, state.out); + } + + if (block) { + // preprocess the code section to remove the initial indentation + mapped_file_builder mapped; + mapped.start(state.current_file); + mapped.unindent_and_add(code_value); + + file_ptr f = mapped.release(); + + if (f->source().empty()) + return; // Nothing left to do here. The program is empty. + + if (qbk_version_n >= 107u) state.start_callouts(); + + parse_iterator first_(f->source().begin()); + parse_iterator last_(f->source().end()); + + file_ptr saved_file = f; + boost::swap(state.current_file, saved_file); + + // print the code with syntax coloring + // + // We must not place a \n after the <programlisting> tag + // otherwise PDF output starts code blocks with a blank line: + state.phrase << "<programlisting>"; + syntax_highlight(first_, last_, state, source_mode, block); + state.phrase << "</programlisting>\n"; + + boost::swap(state.current_file, saved_file); + + if (qbk_version_n >= 107u) state.phrase << state.end_callouts(); + + if (!inline_code) { + state.out << state.phrase.str(); + state.phrase.clear(); + } + } + else { + parse_iterator first_(code_value.begin()); + parse_iterator last_(code_value.end()); + + state.phrase << "<code>"; + syntax_highlight(first_, last_, state, source_mode, block); + state.phrase << "</code>"; + } + } + + void plain_char_action::operator()(char ch) const + { + write_anchors(state, state.phrase); + + detail::print_char(ch, state.phrase.get()); + } + + void plain_char_action::operator()( + parse_iterator first, parse_iterator last) const + { + write_anchors(state, state.phrase); + + while (first != last) + detail::print_char(*first++, state.phrase.get()); + } + + void escape_unicode_action::operator()( + parse_iterator first, parse_iterator last) const + { + write_anchors(state, state.phrase); + + while (first != last && *first == '0') + ++first; + + // Just ignore \u0000 + // Maybe I should issue a warning? + if (first == last) return; + + std::string hex_digits(first, last); + + if (hex_digits.size() == 2 && *first > '0' && *first <= '7') { + using namespace std; + detail::print_char( + (char)strtol(hex_digits.c_str(), 0, 16), state.phrase.get()); + } + else { + state.phrase << "&#x" << hex_digits << ";"; + } + } + + void write_plain_text(std::ostream& out, value const& v) + { + if (v.is_encoded()) { + detail::print_string(v.get_encoded(), out); + } + else { + quickbook::string_view value = v.get_quickbook(); + for (string_iterator first = value.begin(), last = value.end(); + first != last; ++first) { + if (*first == '\\' && ++first == last) break; + detail::print_char(*first, out); + } + } + } + + void image_action(quickbook::state& state, value image) + { + write_anchors(state, state.phrase); + + // Note: attributes are never encoded as boostbook, if they're + // encoded, it's just things like escapes. + typedef std::map<std::string, value> attribute_map; + attribute_map attributes; + + value_consumer values = image; + attributes["fileref"] = values.consume(); + + QUICKBOOK_FOR (value pair_, values) { + value_consumer pair = pair_; + value name = pair.consume(); + value value = pair.consume(); + std::string name_str( + name.get_quickbook().begin(), name.get_quickbook().end()); + pair.finish(); + if (!attributes.insert(std::make_pair(name_str, value)).second) { + detail::outwarn(name.get_file(), name.get_position()) + << "Duplicate image attribute: " << name.get_quickbook() + << std::endl; + } + } + + values.finish(); + + // Find the file basename and extension. + // + // Not using Boost.Filesystem because I want to stay in UTF-8. + // Need to think about uri encoding. + + std::string fileref = + attributes["fileref"].is_encoded() + ? attributes["fileref"].get_encoded() + : attributes["fileref"].get_quickbook().to_s(); + + // Check for windows paths, then convert. + // A bit crude, but there you go. + + if (fileref.find('\\') != std::string::npos) { + (qbk_version_n >= 106u ? detail::outerr( + attributes["fileref"].get_file(), + attributes["fileref"].get_position()) + : detail::outwarn( + attributes["fileref"].get_file(), + attributes["fileref"].get_position())) + << "Image path isn't portable: '" << fileref << "'" + << std::endl; + if (qbk_version_n >= 106u) ++state.error_count; + } + + boost::replace(fileref, '\\', '/'); + + // Find the file basename and extension. + // + // Not using Boost.Filesystem because I want to stay in UTF-8. + // Need to think about uri encoding. + + std::string::size_type pos; + std::string stem, extension; + + pos = fileref.rfind('/'); + stem = pos == std::string::npos ? fileref : fileref.substr(pos + 1); + + pos = stem.rfind('.'); + if (pos != std::string::npos) { + extension = stem.substr(pos + 1); + stem = stem.substr(0, pos); + } + + // Extract the alt tag, to use as a text description. + // Or if there isn't one, use the stem of the file name. + + attribute_map::iterator alt_pos = attributes.find("alt"); + quickbook::value alt_text = alt_pos != attributes.end() + ? alt_pos->second + : qbk_version_n < 106u + ? encoded_value(stem) + : quickbook::value(); + attributes.erase("alt"); + + if (extension == "svg") { + // + // SVG's need special handling: + // + // 1) We must set the "format" attribute, otherwise + // HTML generation produces code that will not display + // the image at all. + // 2) We need to set the "contentwidth" and "contentdepth" + // attributes, otherwise the image will be displayed inside + // a tiny box with scrollbars (Firefox), or else cropped to + // fit in a tiny box (IE7). + // + + attributes.insert( + attribute_map::value_type("format", encoded_value("SVG"))); + + // + // Image paths are relative to the html subdirectory: + // + fs::path img = detail::generic_to_path(fileref); + if (!img.has_root_directory()) + img = quickbook::image_location / img; // relative path + + // + // Now load the SVG file: + // + std::string svg_text; + if (state.dependencies.add_dependency(img)) { + fs::ifstream fs(img); + std::stringstream buffer; + buffer << fs.rdbuf(); + svg_text = buffer.str(); + } + + // + // Extract the svg header from the file: + // + std::string::size_type a, b; + a = svg_text.find("<svg"); + b = svg_text.find('>', a); + svg_text = + (a == std::string::npos) ? "" : svg_text.substr(a, b - a); + // + // Now locate the "width" and "height" attributes + // and borrow their values: + // + a = svg_text.find("width"); + a = svg_text.find('=', a); + a = svg_text.find('\"', a); + b = svg_text.find('\"', a + 1); + if (a != std::string::npos) { + attributes.insert(std::make_pair( + "contentwidth", encoded_value(std::string( + boost::next(svg_text.begin(), a + 1), + boost::next(svg_text.begin(), b))))); + } + a = svg_text.find("height"); + a = svg_text.find('=', a); + a = svg_text.find('\"', a); + b = svg_text.find('\"', a + 1); + if (a != std::string::npos) { + attributes.insert(std::make_pair( + "contentdepth", encoded_value(std::string( + boost::next(svg_text.begin(), a + 1), + boost::next(svg_text.begin(), b))))); + } + } + + state.phrase << "<inlinemediaobject>"; + + state.phrase << "<imageobject><imagedata"; + + QUICKBOOK_FOR (attribute_map::value_type const& attr, attributes) { + state.phrase << " " << attr.first << "=\""; + write_plain_text(state.phrase.get(), attr.second); + state.phrase << "\""; + } + + state.phrase << "></imagedata></imageobject>"; + + // Add a textobject containing the alt tag from earlier. + // This will be used for the alt tag in html. + if (alt_text.check()) { + state.phrase << "<textobject><phrase>"; + write_plain_text(state.phrase.get(), alt_text); + state.phrase << "</phrase></textobject>"; + } + + state.phrase << "</inlinemediaobject>"; + } + + void macro_definition_action( + quickbook::state& state, quickbook::value macro_definition) + { + value_consumer values = macro_definition; + std::string macro_id = values.consume().get_quickbook().to_s(); + value phrase_value = values.optional_consume(); + std::string phrase; + if (phrase_value.check()) phrase = phrase_value.get_encoded(); + values.finish(); + + std::string* existing_macro = + boost::spirit::classic::find(state.macro, macro_id.c_str()); + quickbook::ignore_variable(&existing_macro); + + if (existing_macro) { + if (qbk_version_n < 106) return; + + // Do this if you're using spirit's TST. + // + // *existing_macro = phrase; + // return; + } + + state.macro.add(macro_id.begin(), macro_id.end(), phrase); + } + + void template_body_action( + quickbook::state& state, quickbook::value template_definition) + { + value_consumer values = template_definition; + std::string identifier = values.consume().get_quickbook().to_s(); + + std::vector<std::string> template_values; + QUICKBOOK_FOR (value const& p, values.consume()) { + template_values.push_back(p.get_quickbook().to_s()); + } + + BOOST_ASSERT( + values.check(template_tags::block) || + values.check(template_tags::phrase)); + value body = values.consume(); + BOOST_ASSERT(!values.check()); + + if (!state.templates.add(template_symbol( + identifier, template_values, body, + &state.templates.top_scope()))) { + detail::outwarn(body.get_file(), body.get_position()) + << "Template Redefinition: " << identifier << std::endl; + ++state.error_count; + } + } + + namespace + { + string_iterator find_first_seperator( + string_iterator begin, string_iterator end) + { + if (qbk_version_n < 105) { + for (; begin != end; ++begin) { + switch (*begin) { + case ' ': + case '\t': + case '\n': + case '\r': + return begin; + default: + break; + } + } + } + else { + unsigned int depth = 0; + + for (; begin != end; ++begin) { + switch (*begin) { + case '[': + ++depth; + break; + case '\\': + if (++begin == end) return begin; + break; + case ']': + if (depth > 0) --depth; + break; + case ' ': + case '\t': + case '\n': + case '\r': + if (depth == 0) return begin; + default: + break; + } + } + } + + return begin; + } + + std::pair<string_iterator, string_iterator> find_seperator( + string_iterator begin, string_iterator end) + { + string_iterator first = begin = find_first_seperator(begin, end); + + for (; begin != end; ++begin) { + switch (*begin) { + case ' ': + case '\t': + case '\n': + case '\r': + break; + default: + return std::make_pair(first, begin); + } + } + + return std::make_pair(first, begin); + } + + void break_arguments( + std::vector<value>& args, + std::vector<std::string> const& params, + fs::path const& /* filename */ + ) + { + // Quickbook 1.4-: If there aren't enough parameters seperated by + // '..' then seperate the last parameter using + // whitespace. + // Quickbook 1.5+: If '..' isn't used to seperate the parameters + // then use whitespace to separate them + // (2 = template name + argument). + + if (qbk_version_n < 105 ? args.size() : args.size() == 1) { + + while (args.size() < params.size()) { + // Try to break the last argument at the first space found + // and push it into the back of args. Do this + // recursively until we have all the expected number of + // arguments, or if there are no more spaces left. + + value last_arg = args.back(); + string_iterator begin = last_arg.get_quickbook().begin(); + string_iterator end = last_arg.get_quickbook().end(); + + std::pair<string_iterator, string_iterator> pos = + find_seperator(begin, end); + if (pos.second == end) break; + value new_arg(qbk_value( + last_arg.get_file(), pos.second, end, + template_tags::phrase)); + + args.back() = qbk_value( + last_arg.get_file(), begin, pos.first, + last_arg.get_tag()); + args.push_back(new_arg); + } + } + } + + std::pair<bool, std::vector<std::string>::const_iterator> get_arguments( + std::vector<value> const& args, + std::vector<std::string> const& params, + template_scope const& scope, + string_iterator first, + quickbook::state& state) + { + std::vector<value>::const_iterator arg = args.begin(); + std::vector<std::string>::const_iterator tpl = params.begin(); + std::vector<std::string> empty_params; + + // Store each of the argument passed in as local templates: + while (arg != args.end()) { + if (!state.templates.add( + template_symbol(*tpl, empty_params, *arg, &scope))) { + detail::outerr(state.current_file, first) + << "Duplicate Symbol Found" << std::endl; + ++state.error_count; + return std::make_pair(false, tpl); + } + ++arg; + ++tpl; + } + return std::make_pair(true, tpl); + } + + bool parse_template( + value const& content, + quickbook::state& state, + bool is_attribute_template) + { + file_ptr saved_current_file = state.current_file; + + state.current_file = content.get_file(); + quickbook::string_view source = content.get_quickbook(); + + parse_iterator first(source.begin()); + parse_iterator last(source.end()); + + bool r = cl::parse( + first, last, + is_attribute_template + ? state.grammar().attribute_template_body + : content.get_tag() == template_tags::phrase + ? state.grammar().inline_phrase + : state.grammar().block_start) + .full; + + boost::swap(state.current_file, saved_current_file); + + return r; + } + } + + void call_template( + quickbook::state& state, + template_symbol const* symbol, + std::vector<value> const& args, + string_iterator first, + bool is_attribute_template = false) + { + bool is_block = symbol->content.get_tag() != template_tags::phrase; + assert(!(is_attribute_template && is_block)); + + quickbook::paragraph_action paragraph_action(state); + + // Finish off any existing paragraphs. + if (is_block) paragraph_action(); + + // If this template contains already encoded text, then just + // write it out, without going through any of the rigamarole. + + if (symbol->content.is_encoded()) { + (is_block ? state.out : state.phrase) + << symbol->content.get_encoded(); + return; + } + + // The template arguments should have the scope that the template was + // called from, not the template's own scope. + // + // Note that for quickbook 1.4- this value is just ignored when the + // arguments are expanded. + template_scope const& call_scope = state.templates.top_scope(); + + { + state_save save(state, state_save::scope_callables); + std::string save_block; + std::string save_phrase; + + state.templates.start_template(symbol); + + qbk_version_n = symbol->content.get_file()->version(); + + ++state.template_depth; + if (state.template_depth > state.max_template_depth) { + detail::outerr(state.current_file, first) + << "Infinite loop detected" << std::endl; + ++state.error_count; + return; + } + + // Store the current section level so that we can ensure that + // [section] and [endsect] tags in the template are balanced. + state.min_section_level = state.document.section_level(); + + /////////////////////////////////// + // Prepare the arguments as local templates + bool get_arg_result; + std::vector<std::string>::const_iterator tpl; + boost::tie(get_arg_result, tpl) = + get_arguments(args, symbol->params, call_scope, first, state); + + if (!get_arg_result) { + return; + } + + /////////////////////////////////// + // parse the template body: + + if (symbol->content.get_file()->version() < 107u) { + state.out.swap(save_block); + state.phrase.swap(save_phrase); + } + + if (!parse_template( + symbol->content, state, is_attribute_template)) { + detail::outerr(state.current_file, first) + << "Expanding " << (is_block ? "block" : "phrase") + << " template: " << symbol->identifier << "\n\n" + << "------------------begin------------------\n" + << symbol->content.get_quickbook() + << "------------------end--------------------\n" + << std::endl; + ++state.error_count; + return; + } + + if (state.document.section_level() != state.min_section_level) { + detail::outerr(state.current_file, first) + << "Mismatched sections in template " << symbol->identifier + << std::endl; + ++state.error_count; + return; + } + + if (symbol->content.get_file()->version() < 107u) { + state.out.swap(save_block); + state.phrase.swap(save_phrase); + + if (is_block || !save_block.empty()) { + paragraph_action(); + state.out << save_block; + state.phrase << save_phrase; + paragraph_action(); + } + else { + state.phrase << save_phrase; + } + } + else { + if (is_block) paragraph_action(); + } + } + } + + void call_code_snippet( + quickbook::state& state, + template_symbol const* symbol, + string_iterator first) + { + assert(symbol->params.size() == 0); + std::vector<value> args; + + // Create a fake symbol for call_template + template_symbol t( + symbol->identifier, symbol->params, symbol->content, + symbol->lexical_parent); + + state.start_callouts(); + call_template(state, &t, args, first); + state.out << state.end_callouts(); + } + + void do_template_action( + quickbook::state& state, value template_list, string_iterator first) + { + bool const is_attribute_template = + template_list.get_tag() == template_tags::attribute_template; + + // Get the arguments + value_consumer values = template_list; + + bool template_escape = values.check(template_tags::escape); + if (template_escape) values.consume(); + + std::string identifier = + values.consume(template_tags::identifier).get_quickbook().to_s(); + + std::vector<value> args; + + QUICKBOOK_FOR (value arg, values) { + args.push_back(arg); + } + + values.finish(); + + template_symbol const* symbol = state.templates.find(identifier); + BOOST_ASSERT(symbol); + + // Deal with escaped templates. + + if (template_escape) { + if (!args.empty()) { + detail::outerr(state.current_file, first) + << "Arguments for escaped template." << std::endl; + ++state.error_count; + } + + if (symbol->content.is_encoded()) { + state.phrase << symbol->content.get_encoded(); + } + else { + state.phrase << symbol->content.get_quickbook(); + + /* + + This would surround the escaped template in escape + comments to indicate to the post-processor that it + isn't quickbook generated markup. But I'm not sure if + it would work. + + quickbook::detail::markup escape_markup + = detail::get_markup(phrase_tags::escape); + + state.phrase + << escape_markup.pre + << symbol->content.get_quickbook() + << escape_markup.post + ; + */ + } + + return; + } + + /////////////////////////////////// + // Check that attribute templates are phrase templates + + if (is_attribute_template && + symbol->content.get_tag() != template_tags::phrase) { + detail::outerr(state.current_file, first) + << "Only phrase templates can be used in attribute values." + << std::endl; + + ++state.error_count; + return; + } + + /////////////////////////////////// + // Initialise the arguments + + switch (symbol->content.get_tag()) { + case template_tags::block: + case template_tags::phrase: + // Break the arguments for a template + + break_arguments(args, symbol->params, state.current_file->path); + + if (args.size() != symbol->params.size()) { + detail::outerr(state.current_file, first) + << "Invalid number of arguments passed. Expecting: " + << symbol->params.size() + << " argument(s), got: " << args.size() + << " argument(s) instead." << std::endl; + + ++state.error_count; + return; + } + + call_template(state, symbol, args, first, is_attribute_template); + break; + + case template_tags::snippet: + + if (!args.empty()) { + detail::outerr(state.current_file, first) + << "Arguments for code snippet." << std::endl; + ++state.error_count; + + args.clear(); + } + + call_code_snippet(state, symbol, first); + break; + + default: + assert(0); + } + } + + void link_action(quickbook::state& state, value link) + { + write_anchors(state, state.phrase); + + detail::markup markup = detail::get_markup(link.get_tag()); + + value_consumer values = link; + value dst_value = values.consume(); + value content = values.consume(); + values.finish(); + + std::string dst; + + if (link.get_tag() == phrase_tags::link) { + dst = validate_id(state, dst_value); + } + else { + dst = get_attribute_value(state, dst_value); + + if (link.get_tag() == phrase_tags::url) { + dst = detail::partially_escape_uri(dst); + } + } + + state.phrase << markup.pre; + detail::print_string(dst, state.phrase.get()); + state.phrase << "\">"; + + if (content.empty()) + detail::print_string(dst, state.phrase.get()); + else + state.phrase << content.get_encoded(); + + state.phrase << markup.post; + } + + void variable_list_action(quickbook::state& state, value variable_list) + { + write_anchors(state, state.out); + + value_consumer values = variable_list; + std::string title = + values.consume(table_tags::title).get_quickbook().to_s(); + + state.out << "<variablelist>\n"; + + state.out << "<title>"; + detail::print_string(title, state.out.get()); + state.out << "</title>\n"; + + QUICKBOOK_FOR (value_consumer entry, values) { + state.out << "<varlistentry>"; + + if (entry.check()) { + state.out << "<term>"; + state.out << entry.consume().get_encoded(); + state.out << "</term>"; + } + + if (entry.check()) { + state.out << "<listitem>"; + QUICKBOOK_FOR (value phrase, entry) + state.out << phrase.get_encoded(); + state.out << "</listitem>"; + } + + state.out << "</varlistentry>\n"; + } + + state.out << "</variablelist>\n"; + + values.finish(); + } + + void table_action(quickbook::state& state, value table) + { + write_anchors(state, state.out); + + value_consumer values = table; + + std::string element_id; + if (values.check(general_tags::element_id)) { + element_id = validate_id(state, values.consume()); + } + + value title = values.consume(table_tags::title); + bool has_title = !title.empty(); + + std::string table_id; + + if (!element_id.empty()) { + table_id = + state.document.add_id(element_id, id_category::explicit_id); + } + else if (has_title) { + if (state.document.compatibility_version() >= 105) { + table_id = state.document.add_id( + detail::make_identifier(title.get_quickbook()), + id_category::generated); + } + else { + table_id = state.document.add_id("t", id_category::numbered); + } + } + + // Emulating the old behaviour which used the width of the final + // row for span_count. + int row_count = 0; + int span_count = 0; + + value_consumer lookahead = values; + QUICKBOOK_FOR (value row, lookahead) { + ++row_count; + span_count = boost::distance(row); + } + lookahead.finish(); + + if (has_title) { + state.out << "<table frame=\"all\""; + if (!table_id.empty()) state.out << " id=\"" << table_id << "\""; + state.out << ">\n"; + state.out << "<title>"; + if (qbk_version_n < 106u) { + detail::print_string(title.get_quickbook(), state.out.get()); + } + else { + state.out << title.get_encoded(); + } + state.out << "</title>"; + } + else { + state.out << "<informaltable frame=\"all\""; + if (!table_id.empty()) state.out << " id=\"" << table_id << "\""; + state.out << ">\n"; + } + + state.out << "<tgroup cols=\"" << span_count << "\">\n"; + + if (row_count > 1) { + state.out << "<thead>" + << "<row>"; + QUICKBOOK_FOR (value cell, values.consume()) { + state.out << "<entry>" << cell.get_encoded() << "</entry>"; + } + state.out << "</row>\n" + << "</thead>\n"; + } + + state.out << "<tbody>\n"; + + QUICKBOOK_FOR (value row, values) { + state.out << "<row>"; + QUICKBOOK_FOR (value cell, row) { + state.out << "<entry>" << cell.get_encoded() << "</entry>"; + } + state.out << "</row>\n"; + } + + values.finish(); + + state.out << "</tbody>\n" + << "</tgroup>\n"; + + if (has_title) { + state.out << "</table>\n"; + } + else { + state.out << "</informaltable>\n"; + } + } + + void begin_section_action(quickbook::state& state, value begin_section_list) + { + value_consumer values = begin_section_list; + + value element_id = values.optional_consume(general_tags::element_id); + value content = values.consume(); + values.finish(); + + std::string full_id = state.document.begin_section( + element_id, + element_id.empty() + ? detail::make_identifier(content.get_quickbook()) + : validate_id(state, element_id), + element_id.empty() ? id_category::generated_section + : id_category::explicit_section_id, + state.current_source_mode()); + + state.out << "\n<section id=\"" << full_id << "\">\n"; + + std::string title = content.get_encoded(); + + if (!title.empty()) { + state.out << "<title>"; + + write_anchors(state, state.out); + + if (self_linked_headers && + state.document.compatibility_version() >= 103) { + state.out << quickbook::detail::linkify(title, full_id); + } + else { + state.out << title; + } + + state.out << "</title>\n"; + } + } + + void end_section_action( + quickbook::state& state, value end_section_list, string_iterator first) + { + value_consumer values = end_section_list; + value element_id = values.optional_consume(general_tags::element_id); + values.finish(); + + write_anchors(state, state.out); + + if (state.document.section_level() <= state.min_section_level) { + file_position const pos = state.current_file->position_of(first); + + detail::outerr(state.current_file->path, pos.line) + << "Mismatched [endsect] near column " << pos.column << ".\n"; + ++state.error_count; + + return; + } + + if (!element_id.empty() && + !(element_id == state.document.explicit_id())) { + file_position const pos = state.current_file->position_of(first); + value section_element_id = state.document.explicit_id(); + + if (section_element_id.empty()) { + detail::outerr(state.current_file->path, pos.line) + << "Endsect has unexpected id '" + << element_id.get_quickbook() + << "' in section with no explicit id, near column " + << pos.column << ".\n"; + } + else { + detail::outerr(state.current_file->path, pos.line) + << "Endsect has incorrect id '" + << element_id.get_quickbook() << "', expected '" + << state.document.explicit_id().get_quickbook() + << "', near column " << pos.column << ".\n"; + } + ++state.error_count; + } + + state.out << "</section>"; + state.document.end_section(); + } + + void element_id_warning_action::operator()( + parse_iterator first, parse_iterator) const + { + detail::outwarn(state.current_file, first.base()) << "Empty id.\n"; + } + + void xinclude_action(quickbook::state& state, value xinclude) + { + write_anchors(state, state.out); + + value_consumer values = xinclude; + path_parameter x = check_xinclude_path(values.consume(), state); + values.finish(); + + if (x.type == path_parameter::path) { + quickbook_path path = resolve_xinclude_path(x.value, state, true); + + state.out << "\n<xi:include href=\""; + detail::print_string( + file_path_to_url(path.abstract_file_path), state.out.get()); + state.out << "\" />\n"; + } + } + + void load_quickbook( + quickbook::state& state, + quickbook_path const& path, + value::tag_type load_type, + value const& include_doc_id = value()) + { + assert( + load_type == block_tags::include || + load_type == block_tags::import); + + // Check this before qbk_version_n gets changed by the inner file. + bool keep_inner_source_mode = (qbk_version_n < 106); + + { + // When importing, state doesn't scope templates and macros so that + // they're added to the existing scope. It might be better to add + // them to a new scope then explicitly import them into the + // existing scope. + // + // For old versions of quickbook, templates aren't scoped by the + // file. + state_save save( + state, + load_type == block_tags::import + ? state_save::scope_output + : qbk_version_n >= 106u ? state_save::scope_callables + : state_save::scope_macros); + + state.current_file = load(path.file_path); // Throws load_error + state.current_path = path; + state.imported = (load_type == block_tags::import); + + // update the __FILENAME__ macro + state.update_filename_macro(); + + // parse the file + quickbook::parse_file(state, include_doc_id, true); + + // Don't restore source_mode on older versions. + if (keep_inner_source_mode) save.source_mode = state.source_mode; + } + + // restore the __FILENAME__ macro + state.update_filename_macro(); + } + + void load_source_file( + quickbook::state& state, + quickbook_path const& path, + value::tag_type load_type, + string_iterator first, + value const& /* include_doc_id */ = value()) + { + assert( + load_type == block_tags::include || + load_type == block_tags::import); + + std::string ext = path.file_path.extension().generic_string(); + std::vector<template_symbol> storage; + // Throws load_error + state.error_count += + load_snippets(path.file_path, storage, ext, load_type); + + if (load_type == block_tags::include) { + state.templates.push(); + } + + QUICKBOOK_FOR (template_symbol& ts, storage) { + std::string tname = ts.identifier; + if (tname != "!") { + ts.lexical_parent = &state.templates.top_scope(); + if (!state.templates.add(ts)) { + detail::outerr( + ts.content.get_file(), ts.content.get_position()) + << "Template Redefinition: " << tname << std::endl; + ++state.error_count; + } + } + } + + if (load_type == block_tags::include) { + QUICKBOOK_FOR (template_symbol& ts, storage) { + std::string tname = ts.identifier; + + if (tname == "!") { + ts.lexical_parent = &state.templates.top_scope(); + call_code_snippet(state, &ts, first); + } + } + + state.templates.pop(); + } + } + + void include_action( + quickbook::state& state, value include, string_iterator first) + { + write_anchors(state, state.out); + + value_consumer values = include; + value include_doc_id = + values.optional_consume(general_tags::include_id); + path_parameter parameter = check_path(values.consume(), state); + values.finish(); + + std::set<quickbook_path> search = + include_search(parameter, state, first); + QUICKBOOK_FOR (quickbook_path const& path, search) { + try { + if (qbk_version_n >= 106) { + if (state.imported && + include.get_tag() == block_tags::include) + return; + + std::string ext = + path.file_path.extension().generic_string(); + + if (ext == ".qbk" || ext == ".quickbook") { + load_quickbook( + state, path, include.get_tag(), include_doc_id); + } + else { + load_source_file( + state, path, include.get_tag(), first, + include_doc_id); + } + } + else { + if (include.get_tag() == block_tags::include) { + load_quickbook( + state, path, include.get_tag(), include_doc_id); + } + else { + load_source_file( + state, path, include.get_tag(), first, + include_doc_id); + } + } + } catch (load_error& e) { + ++state.error_count; + + detail::outerr(state.current_file, first) + << "Loading file " << path.file_path << ": " << e.what() + << std::endl; + } + } + } + + bool to_value_scoped_action::start(value::tag_type t) + { + state.push_output(); + state.anchors.swap(saved_anchors); + tag = t; + + return true; + } + + void to_value_scoped_action::success( + parse_iterator first, parse_iterator last) + { + std::string value; + + if (!state.out.str().empty()) { + paragraph_action para(state); + para(); // For paragraphs before the template call. + write_anchors(state, state.out); + state.out.swap(value); + } + else { + write_anchors(state, state.phrase); + state.phrase.swap(value); + } + + state.values.builder.insert(encoded_qbk_value( + state.current_file, first.base(), last.base(), value, tag)); + } + + void to_value_scoped_action::cleanup() + { + state.pop_output(); + state.anchors.swap(saved_anchors); + } +} diff --git a/src/boost/tools/quickbook/src/actions.hpp b/src/boost/tools/quickbook/src/actions.hpp new file mode 100644 index 000000000..7039094dd --- /dev/null +++ b/src/boost/tools/quickbook/src/actions.hpp @@ -0,0 +1,379 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_ACTIONS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_ACTIONS_HPP + +#include <string> +#include <vector> +#include <boost/spirit/include/classic_parser.hpp> +#include "fwd.hpp" +#include "iterator.hpp" +#include "scoped.hpp" +#include "utils.hpp" +#include "values.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + // Match if quickbook version is within range + struct quickbook_range : cl::parser<quickbook_range> + { + explicit quickbook_range(unsigned lower_, unsigned upper_) + : lower(lower_), upper(upper_) + { + } + + bool in_range() const; + + template <typename ScannerT> + typename cl::parser_result<quickbook_range, ScannerT>::type parse( + ScannerT const& scan) const + { + return in_range() ? scan.empty_match() : scan.no_match(); + } + + unsigned lower, upper; + }; + + inline quickbook_range qbk_ver(unsigned lower, unsigned upper = 999u) + { + return quickbook_range(lower, upper); + } + + // Match if in strict mode. + struct quickbook_strict : cl::parser<quickbook_strict> + { + explicit quickbook_strict( + quickbook::state& state_, bool positive_ = true) + : state(state_), positive(positive_) + { + } + + bool is_strict_checking() const; + + template <typename ScannerT> + typename cl::parser_result<quickbook_range, ScannerT>::type parse( + ScannerT const& scan) const + { + return is_strict_checking() == positive ? scan.empty_match() + : scan.no_match(); + } + + quickbook_strict operator~() const + { + return quickbook_strict(state, !positive); + } + + quickbook::state& state; + bool positive; + }; + + inline quickbook_strict qbk_strict( + quickbook::state& state, unsigned lower = 999u) + { + return quickbook_strict(state, lower); + } + + // Throws load_error + int load_snippets( + fs::path const& file, + std::vector<template_symbol>& storage, + std::string const& extension, + value::tag_type load_type); + + struct error_message_action + { + // Prints an error message to std::cerr + + explicit error_message_action( + quickbook::state& state_, std::string const& message_) + : state(state_), message(message_) + { + } + + void operator()(parse_iterator, parse_iterator) const; + + quickbook::state& state; + std::string message; + }; + + struct error_action + { + // Prints an error message to std::cerr + + explicit error_action(quickbook::state& state_) : state(state_) {} + + void operator()(parse_iterator first, parse_iterator last) const; + + error_message_action operator()(std::string const& message) + { + return error_message_action(state, message); + } + + quickbook::state& state; + }; + + struct element_action + { + explicit element_action(quickbook::state& state_) : state(state_) {} + + void operator()(parse_iterator, parse_iterator) const; + + quickbook::state& state; + }; + + struct paragraph_action + { + // implicit paragraphs + // doesn't output the paragraph if it's only whitespace. + + explicit paragraph_action(quickbook::state& state_) : state(state_) {} + + void operator()() const; + void operator()(parse_iterator, parse_iterator) const { (*this)(); } + + quickbook::state& state; + }; + + struct explicit_list_action + { + // implicit paragraphs + // doesn't output the paragraph if it's only whitespace. + + explicit explicit_list_action(quickbook::state& state_) : state(state_) + { + } + + void operator()() const; + void operator()(parse_iterator, parse_iterator) const { (*this)(); } + + quickbook::state& state; + }; + + struct phrase_end_action + { + explicit phrase_end_action(quickbook::state& state_) : state(state_) {} + + void operator()() const; + void operator()(parse_iterator, parse_iterator) const { (*this)(); } + + quickbook::state& state; + }; + + struct simple_phrase_action + { + // Handles simple text formats + + explicit simple_phrase_action(quickbook::state& state_) : state(state_) + { + } + + void operator()(char) const; + + quickbook::state& state; + }; + + struct cond_phrase_push : scoped_action_base + { + cond_phrase_push(quickbook::state& x) : state(x) {} + + bool start(); + void cleanup(); + + quickbook::state& state; + bool saved_conditional; + std::vector<std::string> anchors; + }; + + struct do_macro_action + { + // Handles macro substitutions + + explicit do_macro_action(quickbook::state& state_) : state(state_) {} + + void operator()(std::string const& str) const; + quickbook::state& state; + }; + + struct raw_char_action + { + // Prints a space + + explicit raw_char_action(quickbook::state& state_) : state(state_) {} + + void operator()(char ch) const; + void operator()(parse_iterator first, parse_iterator last) const; + + quickbook::state& state; + }; + + struct plain_char_action + { + // Prints a single plain char. + // Converts '<' to "<"... etc See utils.hpp + + explicit plain_char_action(quickbook::state& state_) : state(state_) {} + + void operator()(char ch) const; + void operator()(parse_iterator first, parse_iterator last) const; + + quickbook::state& state; + }; + + struct escape_unicode_action + { + explicit escape_unicode_action(quickbook::state& state_) : state(state_) + { + } + + void operator()(parse_iterator first, parse_iterator last) const; + + quickbook::state& state; + }; + + struct break_action + { + explicit break_action(quickbook::state& state_) : state(state_) {} + + void operator()(parse_iterator f, parse_iterator) const; + + quickbook::state& state; + }; + + struct element_id_warning_action + { + explicit element_id_warning_action(quickbook::state& state_) + : state(state_) + { + } + + void operator()(parse_iterator first, parse_iterator last) const; + + quickbook::state& state; + }; + + // Returns the doc_type, or an empty string if there isn't one. + std::string pre( + quickbook::state& state, + parse_iterator pos, + value include_doc_id, + bool nested_file); + void post(quickbook::state& state, std::string const& doc_type); + + struct to_value_scoped_action : scoped_action_base + { + to_value_scoped_action(quickbook::state& state_) : state(state_) {} + + bool start(value::tag_type = value::default_tag); + void success(parse_iterator, parse_iterator); + void cleanup(); + + quickbook::state& state; + std::vector<std::string> saved_anchors; + value::tag_type tag; + }; + + // member_action + // + // Action for calling a member function taking two parse iterators. + + template <typename T> struct member_action + { + typedef void (T::*member_function)(parse_iterator, parse_iterator); + + T& l; + member_function mf; + + explicit member_action(T& l_, member_function mf_) : l(l_), mf(mf_) {} + + void operator()(parse_iterator first, parse_iterator last) const + { + (l.*mf)(first, last); + } + }; + + // member_action1 + // + // Action for calling a member function taking two parse iterators and a + // value. + + template <typename T, typename Arg1> struct member_action1 + { + typedef void (T::*member_function)( + parse_iterator, parse_iterator, Arg1); + + T& l; + member_function mf; + + explicit member_action1(T& l_, member_function mf_) : l(l_), mf(mf_) {} + + struct impl + { + member_action1 a; + Arg1 value; + + explicit impl(member_action1& a_, Arg1 value_) + : a(a_), value(value_) + { + } + + void operator()(parse_iterator first, parse_iterator last) const + { + (a.l.*a.mf)(first, last, value); + } + }; + + impl operator()(Arg1 a1) { return impl(*this, a1); } + }; + + // member_action_value + // + // Action for calling a unary member function. + + template <typename T, typename Value> struct member_action_value + { + typedef void (T::*member_function)(Value); + + T& l; + member_function mf; + + explicit member_action_value(T& l_, member_function mf_) + : l(l_), mf(mf_) + { + } + + void operator()(Value v) const { (l.*mf)(v); } + }; + + // member_action_value + // + // Action for calling a unary member function with a fixed value. + + template <typename T, typename Value> struct member_action_fixed_value + { + typedef void (T::*member_function)(Value); + + T& l; + member_function mf; + Value v; + + explicit member_action_fixed_value(T& l_, member_function mf_, Value v_) + : l(l_), mf(mf_), v(v_) + { + } + + void operator()() const { (l.*mf)(v); } + + void operator()(parse_iterator, parse_iterator) const { (l.*mf)(v); } + }; +} + +#endif // BOOST_SPIRIT_QUICKBOOK_ACTIONS_HPP diff --git a/src/boost/tools/quickbook/src/bb2html.cpp b/src/boost/tools/quickbook/src/bb2html.cpp new file mode 100644 index 000000000..44c8e7558 --- /dev/null +++ b/src/boost/tools/quickbook/src/bb2html.cpp @@ -0,0 +1,1626 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "bb2html.hpp" +#include <cassert> +#include <vector> +#include <boost/algorithm/string/predicate.hpp> +#include <boost/filesystem/fstream.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/stringize.hpp> +#include <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> +#include "boostbook_chunker.hpp" +#include "files.hpp" +#include "for.hpp" +#include "html_printer.hpp" +#include "path.hpp" +#include "post_process.hpp" +#include "stream.hpp" +#include "utils.hpp" +#include "xml_parse.hpp" + +namespace quickbook +{ + namespace fs = boost::filesystem; +} + +namespace quickbook +{ + namespace detail + { + struct html_state; + struct html_gen; + struct docinfo_gen; + struct id_info; + + typedef boost::unordered_map<string_view, id_info> ids_type; + + typedef void (*node_parser)(html_gen&, xml_element*); + typedef boost::unordered_map<quickbook::string_view, node_parser> + node_parsers_type; + static node_parsers_type node_parsers; + + struct docinfo_node_parser + { + typedef void (*parser_type)(docinfo_gen&, xml_element*); + enum docinfo_node_category + { + docinfo_general = 0, + docinfo_author + }; + + docinfo_node_category category; + parser_type parser; + }; + typedef boost:: + unordered_map<quickbook::string_view, docinfo_node_parser> + docinfo_node_pasers_type; + static docinfo_node_pasers_type docinfo_node_parsers; + + void generate_chunked_documentation( + chunk*, ids_type const&, html_options const&); + void generate_chunks(html_state&, chunk*); + void generate_chunk_navigation(html_gen&, chunk*); + void generate_inline_chunks(html_gen&, chunk*); + void generate_chunk_body(html_gen&, chunk*); + void generate_toc_html(html_gen& gen, chunk*); + void generate_toc_subtree( + html_gen& gen, chunk* page, chunk*, unsigned section_depth); + void generate_toc_item_html(html_gen&, xml_element*); + void generate_footnotes_html(html_gen&); + void number_callouts(html_gen& gen, xml_element* x); + void number_calloutlist_children( + html_gen& gen, unsigned& count, xml_element* x); + void generate_docinfo_html(html_gen&, xml_element*); + void generate_tree_html(html_gen&, xml_element*); + void generate_children_html(html_gen&, xml_element*); + void write_file( + html_state&, std::string const& path, std::string const& content); + std::string get_link_from_path( + html_gen&, quickbook::string_view, quickbook::string_view); + std::string relative_path_or_url(html_gen&, path_or_url const&); + std::string relative_path_from_fs_paths( + fs::path const&, fs::path const&); + std::string relative_path_from_url_paths( + quickbook::string_view, quickbook::string_view); + + ids_type get_id_paths(chunk* chunk); + void get_id_paths_impl(ids_type&, chunk*); + void get_id_paths_impl2(ids_type&, chunk*, xml_element*); + + void tag(html_gen& gen, quickbook::string_view name, xml_element* x); + void tag_start_with_id( + html_gen& gen, quickbook::string_view name, xml_element* x); + void open_tag_with_id( + html_gen& gen, quickbook::string_view name, xml_element* x); + void tag_self_close( + html_gen& gen, quickbook::string_view name, xml_element* x); + void graphics_tag( + html_gen& gen, + quickbook::string_view path, + quickbook::string_view fallback); + + struct id_info + { + private: + chunk* chunk_; + xml_element* element_; + + public: + explicit id_info(chunk* c, xml_element* x) : chunk_(c), element_(x) + { + assert(c); + assert(!x || x->has_attribute("id")); + } + + std::string path() const + { + std::string p = chunk_->path_; + + if (element_) { + p += '#'; + p += element_->get_attribute("id"); + } + else if (chunk_->inline_) { + p += '#'; + p += chunk_->id_; + } + return p; + } + }; + + struct html_state + { + ids_type const& ids; + html_options const& options; + unsigned int error_count; + + explicit html_state( + ids_type const& ids_, html_options const& options_) + : ids(ids_), options(options_), error_count(0) + { + } + }; + + struct callout_data + { + quickbook::string_view link_id; + unsigned number; + }; + + struct chunk_state + { + std::vector<xml_element*> footnotes; + boost::unordered_map<string_view, callout_data> callout_numbers; + boost::unordered_set<string_view> fragment_ids; + }; + + struct html_gen + { + html_printer printer; + html_state& state; + chunk_state& chunk; + string_view path; + bool in_toc; + + explicit html_gen( + html_state& state_, chunk_state& chunk_, string_view p) + : printer() + , state(state_) + , chunk(chunk_) + , path(p) + , in_toc(false) + { + } + + html_gen(html_gen const& x) + : printer() + , state(x.state) + , chunk(x.chunk) + , path(x.path) + , in_toc(false) + { + } + }; + + struct docinfo_gen + { + html_gen& gen; + std::vector<std::string> copyrights; + std::vector<std::string> pubdates; + std::vector<std::string> legalnotices; + std::vector<std::string> authors; + std::vector<std::string> editors; + std::vector<std::string> collabs; + + docinfo_gen(html_gen& gen_) : gen(gen_) {} + }; + + int boostbook_to_html( + quickbook::string_view source, html_options const& options) + { + xml_tree tree; + try { + tree = xml_parse(source); + } catch (quickbook::detail::xml_parse_error e) { + string_view source_view(source); + file_position p = relative_position(source_view.begin(), e.pos); + string_view::iterator line_start = + e.pos - (p.column < 40 ? p.column - 1 : 39); + string_view::iterator line_end = + std::find(e.pos, source_view.end(), '\n'); + if (line_end - e.pos > 80) { + line_end = e.pos + 80; + } + std::string indent; + for (auto i = e.pos - line_start; i; --i) { + indent += ' '; + } + ::quickbook::detail::outerr() + << "converting boostbook at line " << p.line << " char " + << p.column << ": " << e.message << "\n" + << string_view(line_start, line_end - line_start) << "\n" + << indent << "^" + << "\n\n"; + + return 1; + } + + chunk_tree chunked = chunk_document(tree); + // Overwrite paths depending on whether output is chunked or not. + // Really want to do something better, e.g. incorporate many section + // chunks into their parent. + chunked.root()->path_ = + path_to_generic(options.home_path.filename()); + if (options.chunked_output) { + inline_sections(chunked.root(), 0); + + // Create the root directory if necessary for chunked + // documentation. + fs::path parent = options.home_path.parent_path(); + if (!parent.empty() && !fs::exists(parent)) { + fs::create_directory(parent); + } + } + else { + inline_all(chunked.root()); + } + ids_type ids = get_id_paths(chunked.root()); + html_state state(ids, options); + if (chunked.root()) { + generate_chunks(state, chunked.root()); + } + return state.error_count; + } + + void gather_chunk_ids(chunk_state& c_state, xml_element* x) + { + if (!x) { + return; + } + if (x->has_attribute("id")) { + c_state.fragment_ids.emplace(x->get_attribute("id")); + } + for (auto it = x->children(); it; it = it->next()) { + gather_chunk_ids(c_state, it); + } + } + + void gather_chunk_ids(chunk_state& c_state, chunk* x) + { + gather_chunk_ids(c_state, x->contents_.root()); + gather_chunk_ids(c_state, x->title_.root()); + gather_chunk_ids(c_state, x->info_.root()); + + for (chunk* it = x->children(); it && it->inline_; + it = it->next()) { + gather_chunk_ids(c_state, it); + } + } + + string_view generate_id( + chunk_state& c_state, + xml_element* x, + string_view name, + string_view base) + { + std::string result; + result.reserve(base.size() + 2); + result.assign(base.begin(), base.end()); + result += '-'; + // TODO: Share implementation with id_generation.cpp? + for (unsigned count = 1;; ++count) { + auto num = boost::lexical_cast<std::string>(count); + result.reserve(base.size() + 1 + num.size()); + result.erase(base.size() + 1); + result += num; + if (c_state.fragment_ids.find(result) == + c_state.fragment_ids.end()) { + auto r = x->set_attribute(name, result); + c_state.fragment_ids.emplace(r); + return r; + } + } + } + + void generate_chunks(html_state& state, chunk* x) + { + chunk_state c_state; + gather_chunk_ids(c_state, x); + html_gen gen(state, c_state, x->path_); + gen.printer.html += "<!DOCTYPE html>\n"; + open_tag(gen.printer, "html"); + open_tag(gen.printer, "head"); + if (state.options.css_path) { + tag_start(gen.printer, "link"); + tag_attribute(gen.printer, "rel", "stylesheet"); + tag_attribute(gen.printer, "type", "text/css"); + tag_attribute( + gen.printer, "href", + relative_path_or_url(gen, state.options.css_path)); + tag_end_self_close(gen.printer); + } + close_tag(gen.printer, "head"); + open_tag(gen.printer, "body"); + generate_chunk_navigation(gen, x); + generate_chunk_body(gen, x); + chunk* it = x->children(); + for (; it && it->inline_; it = it->next()) { + generate_inline_chunks(gen, it); + } + generate_footnotes_html(gen); + close_tag(gen.printer, "body"); + close_tag(gen.printer, "html"); + write_file(state, x->path_, gen.printer.html); + for (; it; it = it->next()) { + assert(!it->inline_); + generate_chunks(state, it); + } + } + + void generate_chunk_navigation(html_gen& gen, chunk* x) + { + chunk* next = 0; + for (chunk* it = x->children(); it; it = it->next()) { + if (!it->inline_) { + next = it; + break; + } + } + if (!next) { + next = x->next(); + } + + chunk* prev = x->prev(); + if (prev) { + while (prev->children()) { + for (prev = prev->children(); prev->next(); + prev = prev->next()) { + } + } + } + else { + prev = x->parent(); + } + + if (next || prev || x->parent()) { + tag_start(gen.printer, "div"); + tag_attribute(gen.printer, "class", "spirit-nav"); + tag_end(gen.printer); + if (prev) { + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", + get_link_from_path(gen, prev->path_, x->path_)); + tag_attribute(gen.printer, "accesskey", "p"); + tag_end(gen.printer); + graphics_tag(gen, "/prev.png", "prev"); + close_tag(gen.printer, "a"); + gen.printer.html += " "; + } + if (x->parent()) { + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", + get_link_from_path(gen, x->parent()->path_, x->path_)); + tag_attribute(gen.printer, "accesskey", "u"); + tag_end(gen.printer); + graphics_tag(gen, "/up.png", "up"); + close_tag(gen.printer, "a"); + gen.printer.html += " "; + + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", + get_link_from_path(gen, "index.html", x->path_)); + tag_attribute(gen.printer, "accesskey", "h"); + tag_end(gen.printer); + graphics_tag(gen, "/home.png", "home"); + close_tag(gen.printer, "a"); + if (next) { + gen.printer.html += " "; + } + } + if (next) { + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", + get_link_from_path(gen, next->path_, x->path_)); + tag_attribute(gen.printer, "accesskey", "n"); + tag_end(gen.printer); + graphics_tag(gen, "/next.png", "next"); + close_tag(gen.printer, "a"); + } + close_tag(gen.printer, "div"); + } + } + + void generate_inline_chunks(html_gen& gen, chunk* x) + { + tag_start(gen.printer, "div"); + tag_attribute(gen.printer, "id", x->id_); + tag_end(gen.printer); + generate_chunk_body(gen, x); + for (chunk* it = x->children(); it; it = it->next()) { + assert(it->inline_); + generate_inline_chunks(gen, it); + } + close_tag(gen.printer, "div"); + } + + void generate_chunk_body(html_gen& gen, chunk* x) + { + gen.chunk.callout_numbers.clear(); + + number_callouts(gen, x->title_.root()); + number_callouts(gen, x->info_.root()); + number_callouts(gen, x->contents_.root()); + + generate_tree_html(gen, x->title_.root()); + generate_docinfo_html(gen, x->info_.root()); + generate_toc_html(gen, x); + generate_tree_html(gen, x->contents_.root()); + } + + void generate_toc_html(html_gen& gen, chunk* x) + { + if (x->children() && x->contents_.root()->name_ != "section") { + tag_start(gen.printer, "div"); + tag_attribute(gen.printer, "class", "toc"); + tag_end(gen.printer); + open_tag(gen.printer, "p"); + open_tag(gen.printer, "b"); + gen.printer.html += "Table of contents"; + close_tag(gen.printer, "b"); + close_tag(gen.printer, "p"); + generate_toc_subtree(gen, x, x, 1); + close_tag(gen.printer, "div"); + } + } + + void generate_toc_subtree( + html_gen& gen, chunk* page, chunk* x, unsigned section_depth) + { + if (x != page && section_depth == 0) { + bool has_non_section_child = false; + for (chunk* it = x->children(); it; it = it->next()) { + if (it->contents_.root()->name_ != "section") { + has_non_section_child = true; + } + } + if (!has_non_section_child) { + return; + } + } + + gen.printer.html += "<ul>"; + for (chunk* it = x->children(); it; it = it->next()) { + auto link = gen.state.ids.find(it->id_); + gen.printer.html += "<li>"; + if (link != gen.state.ids.end()) { + gen.printer.html += "<a href=\""; + gen.printer.html += encode_string(get_link_from_path( + gen, link->second.path(), page->path_)); + gen.printer.html += "\">"; + generate_toc_item_html(gen, it->title_.root()); + gen.printer.html += "</a>"; + } + else { + generate_toc_item_html(gen, it->title_.root()); + } + if (it->children()) { + generate_toc_subtree( + gen, page, it, + it->contents_.root()->name_ == "section" && + section_depth > 0 + ? section_depth - 1 + : section_depth); + } + gen.printer.html += "</li>"; + } + gen.printer.html += "</ul>"; + } + + void generate_toc_item_html(html_gen& gen, xml_element* x) + { + if (x) { + bool old = gen.in_toc; + gen.in_toc = true; + generate_children_html(gen, x); + gen.in_toc = old; + } + else { + gen.printer.html += "<i>Untitled</i>"; + } + } + + void generate_footnotes_html(html_gen& gen) + { + if (!gen.chunk.footnotes.empty()) { + tag_start(gen.printer, "div"); + tag_attribute(gen.printer, "class", "footnotes"); + tag_end(gen.printer); + gen.printer.html += "<br/>"; + gen.printer.html += "<hr/>"; + for (std::vector<xml_element*>::iterator it = + gen.chunk.footnotes.begin(); + it != gen.chunk.footnotes.end(); ++it) { + auto footnote_id = + (*it)->get_attribute("(((footnote-id)))"); + tag_start(gen.printer, "div"); + tag_attribute(gen.printer, "id", footnote_id); + tag_attribute(gen.printer, "class", "footnote"); + tag_end(gen.printer); + + generate_children_html(gen, *it); + close_tag(gen.printer, "div"); + } + close_tag(gen.printer, "div"); + } + } + + void number_callouts(html_gen& gen, xml_element* x) + { + if (!x) { + return; + } + + if (x->type_ == xml_element::element_node) { + if (x->name_ == "calloutlist") { + unsigned count = 0; + number_calloutlist_children(gen, count, x); + } + else if (x->name_ == "co") { + if (x->has_attribute("linkends")) { + auto linkends = x->get_attribute("linkends"); + if (!x->has_attribute("id")) { + generate_id(gen.chunk, x, "id", linkends); + } + gen.chunk.callout_numbers[linkends].link_id = + x->get_attribute("id"); + } + } + } + for (xml_element* it = x->children(); it; it = it->next()) { + number_callouts(gen, it); + } + } + + void number_calloutlist_children( + html_gen& gen, unsigned& count, xml_element* x) + { + for (xml_element* it = x->children(); it; it = it->next()) { + if (it->type_ == xml_element::element_node && + it->name_ == "callout") { + if (it->has_attribute("id")) { + gen.chunk.callout_numbers[it->get_attribute("id")] + .number = ++count; + } + } + number_calloutlist_children(gen, count, it); + } + } + + void generate_tree_html(html_gen& gen, xml_element* x) + { + if (!x) { + return; + } + switch (x->type_) { + case xml_element::element_text: { + gen.printer.html += x->contents_; + break; + } + case xml_element::element_html: { + gen.printer.html += x->contents_; + break; + } + case xml_element::element_node: { + node_parsers_type::iterator parser = + node_parsers.find(x->name_); + if (parser != node_parsers.end()) { + parser->second(gen, x); + } + else { + quickbook::detail::out() + << "Unsupported tag: " << x->name_ << std::endl; + generate_children_html(gen, x); + } + break; + } + default: + assert(false); + } + } + + void generate_children_html(html_gen& gen, xml_element* x) + { + for (xml_element* it = x->children(); it; it = it->next()) { + generate_tree_html(gen, it); + } + } + + void generate_docinfo_html_impl(docinfo_gen& d, xml_element* x) + { + for (xml_element* it = x->children(); it; it = it->next()) { + if (it->type_ == xml_element::element_node) { + auto parser = docinfo_node_parsers.find(it->name_); + if (parser != docinfo_node_parsers.end()) { + parser->second.parser(d, it); + } + else { + quickbook::detail::out() + << "Unsupported docinfo tag: " << x->name_ + << std::endl; + generate_docinfo_html_impl(d, it); + } + } + } + } + + void generate_docinfo_html(html_gen& gen, xml_element* x) + { + if (!x) { + return; + } + + docinfo_gen d(gen); + generate_docinfo_html_impl(d, x); + + if (!d.authors.empty() || !d.editors.empty() || + !d.collabs.empty()) { + gen.printer.html += "<div class=\"authorgroup\">\n"; + QUICKBOOK_FOR (auto const& author, d.authors) { + gen.printer.html += "<h3 class=\"author\">"; + gen.printer.html += author; + gen.printer.html += "</h3>\n"; + } + QUICKBOOK_FOR (auto const& editor, d.editors) { + gen.printer.html += "<h3 class=\"editor\">"; + gen.printer.html += editor; + gen.printer.html += "</h3>\n"; + } + QUICKBOOK_FOR (auto const& collab, d.collabs) { + gen.printer.html += "<h3 class=\"collab\">"; + gen.printer.html += collab; + gen.printer.html += "</h3>\n"; + } + gen.printer.html += "</div>\n"; + } + + QUICKBOOK_FOR (auto const& copyright, d.copyrights) { + gen.printer.html += "<p class=\"copyright\">"; + gen.printer.html += copyright; + gen.printer.html += "</p>"; + } + + QUICKBOOK_FOR (auto const& legalnotice, d.legalnotices) { + gen.printer.html += "<div class=\"legalnotice\">"; + gen.printer.html += legalnotice; + gen.printer.html += "</div>"; + } + } + + void write_file( + html_state& state, + std::string const& generic_path, + std::string const& content) + { + fs::path path = state.options.home_path.parent_path() / + generic_to_path(generic_path); + std::string html = content; + + if (state.options.pretty_print) { + try { + html = post_process(html, -1, -1, true); + } catch (quickbook::post_process_failure&) { + ::quickbook::detail::outerr(path) + << "Post Processing Failed." << std::endl; + ++state.error_count; + } + } + + fs::path parent = path.parent_path(); + if (state.options.chunked_output && !parent.empty() && + !fs::exists(parent)) { + fs::create_directories(parent); + } + + fs::ofstream fileout(path); + + if (fileout.fail()) { + ::quickbook::detail::outerr(path) + << "Error opening output file" << std::endl; + ++state.error_count; + return; + } + + fileout << html; + + if (fileout.fail()) { + ::quickbook::detail::outerr(path) + << "Error writing to output file" << std::endl; + ++state.error_count; + return; + } + } + + std::string get_link_from_path( + html_gen& gen, + quickbook::string_view link, + quickbook::string_view path) + { + if (boost::starts_with(link, "boost:")) { + // TODO: Parameterize the boost location, so that it can use + // relative paths. + string_iterator it = link.begin() + strlen("boost:"); + if (*it == '/') { + ++it; + } + if (!gen.state.options.boost_root_path) { + std::string result = + "http://www.boost.org/doc/libs/release/"; + result.append(it, link.end()); + return result; + } + else { + return relative_path_or_url( + gen, + gen.state.options.boost_root_path / + string_view(it, link.end() - it)); + } + } + + return relative_path_from_url_paths(link, path); + } + + std::string relative_path_or_url(html_gen& gen, path_or_url const& x) + { + assert(x); + if (x.is_url()) { + return x.get_url(); + } + else { + return relative_path_from_fs_paths( + x.get_path(), + gen.state.options.home_path.parent_path() / + gen.path.to_s()); + } + } + + // Note: assume that base is a file, not a directory. + std::string relative_path_from_fs_paths( + fs::path const& p, fs::path const& base) + { + return path_to_generic(path_difference(base.parent_path(), p)); + } + + std::string relative_path_from_url_paths( + quickbook::string_view path, quickbook::string_view base) + { + string_iterator path_it = path.begin(); + string_iterator base_it = base.begin(); + string_iterator path_diff_start = path_it; + string_iterator base_diff_start = base_it; + + for (; path_it != path.end() && base_it != base.end() && + *path_it == *base_it; + ++path_it, ++base_it) { + if (*path_it == '/') { + path_diff_start = path_it + 1; + base_diff_start = base_it + 1; + } + else if (*path_it == '#') { + return std::string(path_it, path.end()); + } + } + + if (base_it == base.end() && path_it != path.end() && + *path_it == '#') { + return std::string(path_it, path.end()); + } + + if (path_it == path.end() && + (base_it == base.end() || *base_it == '#')) { + return std::string("#"); + } + + auto up_count = std::count( + base_diff_start, std::find(base_it, base.end(), '#'), '/'); + + std::string result; + for (int i = 0; i < up_count; ++i) { + result += "../"; + } + result.append(path_diff_start, path.end()); + return result; + } + + // get_id_paths + + ids_type get_id_paths(chunk* chunk) + { + ids_type ids; + if (chunk) { + get_id_paths_impl(ids, chunk); + } + return ids; + } + + void get_id_paths_impl(ids_type& ids, chunk* c) + { + std::string p = c->path_; + if (c->inline_) { + p += '#'; + p += c->id_; + } + ids.emplace(c->id_, id_info(c, 0)); + + get_id_paths_impl2(ids, c, c->title_.root()); + get_id_paths_impl2(ids, c, c->info_.root()); + get_id_paths_impl2(ids, c, c->contents_.root()); + for (chunk* i = c->children(); i; i = i->next()) { + get_id_paths_impl(ids, i); + } + } + + void get_id_paths_impl2(ids_type& ids, chunk* c, xml_element* node) + { + if (!node) { + return; + } + if (node->has_attribute("id")) { + ids.emplace(node->get_attribute("id"), id_info(c, node)); + } + for (xml_element* i = node->children(); i; i = i->next()) { + get_id_paths_impl2(ids, c, i); + } + } + + void tag(html_gen& gen, quickbook::string_view name, xml_element* x) + { + open_tag_with_id(gen, name, x); + generate_children_html(gen, x); + close_tag(gen.printer, name); + } + + void open_tag_with_id( + html_gen& gen, quickbook::string_view name, xml_element* x) + { + tag_start_with_id(gen, name, x); + tag_end(gen.printer); + } + + void tag_self_close( + html_gen& gen, quickbook::string_view name, xml_element* x) + { + tag_start_with_id(gen, name, x); + tag_end_self_close(gen.printer); + } + + void graphics_tag( + html_gen& gen, + quickbook::string_view path, + quickbook::string_view fallback) + { + if (gen.state.options.graphics_path) { + tag_start(gen.printer, "img"); + tag_attribute( + gen.printer, "src", + relative_path_or_url( + gen, gen.state.options.graphics_path / path)); + tag_attribute(gen.printer, "alt", fallback); + tag_end(gen.printer); + } + else { + gen.printer.html.append(fallback.begin(), fallback.end()); + } + } + + void tag_start_with_id( + html_gen& gen, quickbook::string_view name, xml_element* x) + { + tag_start(gen.printer, name); + if (!gen.in_toc) { + if (x->has_attribute("id")) { + tag_attribute(gen.printer, "id", x->get_attribute("id")); + } + } + } + +// Handle boostbook nodes + +#define NODE_RULE(tag_name, gen, x) \ + void BOOST_PP_CAT(parser_, tag_name)(html_gen&, xml_element*); \ + static struct BOOST_PP_CAT(register_parser_type_, tag_name) \ + { \ + BOOST_PP_CAT(register_parser_type_, tag_name)() \ + { \ + node_parsers.emplace( \ + BOOST_PP_STRINGIZE(tag_name), \ + &BOOST_PP_CAT(parser_, tag_name)); \ + } \ + } BOOST_PP_CAT(register_parser_, tag_name); \ + void BOOST_PP_CAT(parser_, tag_name)(html_gen & gen, xml_element * x) + +#define DOCINFO_NODE_RULE(tag_name, category, gen, x) \ + void BOOST_PP_CAT(docinfo_parser_, tag_name)(docinfo_gen&, xml_element*); \ + static struct BOOST_PP_CAT(register_docinfo_parser_type_, tag_name) \ + { \ + BOOST_PP_CAT(register_docinfo_parser_type_, tag_name)() \ + { \ + docinfo_node_parser p = { \ + docinfo_node_parser::category, \ + &BOOST_PP_CAT(docinfo_parser_, tag_name)}; \ + docinfo_node_parsers.emplace(BOOST_PP_STRINGIZE(tag_name), p); \ + } \ + } BOOST_PP_CAT(register_docinfo_parser_, tag_name); \ + void BOOST_PP_CAT(docinfo_parser_, tag_name)( \ + docinfo_gen & gen, xml_element * x) + +#define NODE_MAP(tag_name, html_name) \ + NODE_RULE(tag_name, gen, x) { tag(gen, BOOST_PP_STRINGIZE(html_name), x); } + +#define NODE_MAP_CLASS(tag_name, html_name, class_name) \ + NODE_RULE(tag_name, gen, x) \ + { \ + tag_start_with_id(gen, BOOST_PP_STRINGIZE(html_name), x); \ + tag_attribute(gen.printer, "class", BOOST_PP_STRINGIZE(class_name)); \ + tag_end(gen.printer); \ + generate_children_html(gen, x); \ + close_tag(gen.printer, BOOST_PP_STRINGIZE(html_name)); \ + } + + // TODO: For some reason 'hr' generates an empty paragraph? + NODE_MAP(simpara, div) + NODE_MAP(orderedlist, ol) + NODE_MAP(itemizedlist, ul) + NODE_MAP(listitem, li) + NODE_MAP(blockquote, blockquote) + NODE_MAP(quote, q) + NODE_MAP(code, code) + NODE_MAP(macronname, code) + NODE_MAP(classname, code) + NODE_MAP_CLASS(programlisting, pre, programlisting) + NODE_MAP(literal, tt) + NODE_MAP(subscript, sub) + NODE_MAP(superscript, sup) + NODE_MAP(section, div) + NODE_MAP(anchor, span) + + NODE_MAP(title, h3) + + NODE_MAP_CLASS(warning, div, warning) + NODE_MAP_CLASS(caution, div, caution) + NODE_MAP_CLASS(important, div, important) + NODE_MAP_CLASS(note, div, note) + NODE_MAP_CLASS(tip, div, tip) + NODE_MAP_CLASS(replaceable, em, replaceable) + + NODE_RULE(sidebar, gen, x) + { + auto role = x->get_attribute("role"); + + tag_start_with_id(gen, "div", x); + if (role == "blurb") { + tag_attribute(gen.printer, "class", "blurb"); + } + else { + tag_attribute(gen.printer, "class", "sidebar"); + } + + tag_end(gen.printer); + generate_children_html(gen, x); + close_tag(gen.printer, "div"); + } + + NODE_RULE(sbr, gen, x) + { + if (!x->children()) { + tag_self_close(gen, "br", x); + } + else { + tag(gen, "br", x); + } + } + + NODE_RULE(bridgehead, gen, x) + { + auto renderas = x->get_attribute("renderas"); + char header[3] = "h3"; + if (renderas.size() == 5 && boost::starts_with(renderas, "sect")) { + char l = renderas[4]; + if (l >= '1' && l <= '6') { + header[1] = l; + } + } + return tag(gen, header, x); + } + + NODE_RULE(ulink, gen, x) + { + tag_start_with_id(gen, "a", x); + // TODO: error if missing? + if (x->has_attribute("url")) { + tag_attribute( + gen.printer, "href", + get_link_from_path(gen, x->get_attribute("url"), gen.path)); + } + tag_end(gen.printer); + generate_children_html(gen, x); + close_tag(gen.printer, "a"); + } + + NODE_RULE(link, gen, x) + { + // TODO: error if missing or not found? + auto it = gen.state.ids.end(); + if (x->has_attribute("linkend")) { + it = gen.state.ids.find(x->get_attribute("linkend")); + + if (it == gen.state.ids.end()) { + fs::path docbook("(generated docbook)"); + detail::outwarn(docbook) + << "link not found: " << x->get_attribute("linkend") + << std::endl; + } + } + + tag_start_with_id(gen, "a", x); + if (it != gen.state.ids.end()) { + tag_attribute( + gen.printer, "href", + relative_path_from_url_paths(it->second.path(), gen.path)); + } + tag_end(gen.printer); + generate_children_html(gen, x); + close_tag(gen.printer, "a"); + } + + NODE_RULE(phrase, gen, x) + { + auto role = x->get_attribute("role"); + + tag_start_with_id(gen, "span", x); + if (!role.empty()) { + tag_attribute(gen.printer, "class", role); + } + tag_end(gen.printer); + generate_children_html(gen, x); + close_tag(gen.printer, "span"); + } + + NODE_RULE(para, gen, x) + { + auto role = x->get_attribute("role"); + + tag_start_with_id(gen, "p", x); + if (!role.empty()) { + tag_attribute(gen.printer, "class", role); + } + tag_end(gen.printer); + generate_children_html(gen, x); + close_tag(gen.printer, "p"); + } + + NODE_RULE(emphasis, gen, x) + { + auto role = x->get_attribute("role"); + quickbook::string_view tag_name; + quickbook::string_view class_name; + + if (role.empty()) { + tag_name = "em"; + class_name = "emphasis"; + } + else if (role == "bold" || role == "strong") { + tag_name = "strong"; + class_name = role; + } + else { + class_name = role; + } + tag_start_with_id(gen, "span", x); + if (!class_name.empty()) { + tag_attribute(gen.printer, "class", class_name); + } + tag_end(gen.printer); + if (!tag_name.empty()) { + open_tag(gen.printer, tag_name); + generate_children_html(gen, x); + close_tag(gen.printer, tag_name); + } + else { + generate_children_html(gen, x); + } + close_tag(gen.printer, "span"); + } + + NODE_RULE(inlinemediaobject, gen, x) + { + bool has_image = false; + string_view image; + + // Get image link + for (xml_element* i = x->children(); i; i = i->next()) { + if (i->type_ == xml_element::element_node && + i->name_ == "imageobject") { + for (xml_element* j = i->children(); j; j = j->next()) { + if (j->type_ == xml_element::element_node && + j->name_ == "imagedata") { + if (j->has_attribute("fileref")) { + has_image = true; + image = j->get_attribute("fileref"); + break; + } + } + } + } + } + + std::string alt; + for (xml_element* i = x->children(); i; i = i->next()) { + if (i->type_ == xml_element::element_node && + i->name_ == "textobject") { + for (xml_element* j = i->children(); j; j = j->next()) { + if (j->type_ == xml_element::element_node && + j->name_ == "phrase") { + if (j->get_attribute("role") == "alt") { + html_gen gen2(gen); + generate_tree_html(gen2, j); + alt = gen2.printer.html; + } + } + } + } + } + // TODO: This was in the original php code, not sure why. + if (alt.empty()) { + alt = "[]"; + } + if (has_image) { + tag_start(gen.printer, "span"); + tag_attribute(gen.printer, "class", "inlinemediaobject"); + tag_end(gen.printer); + tag_start_with_id(gen, "img", x); + tag_attribute( + gen.printer, "src", + get_link_from_path(gen, image, gen.path)); + tag_attribute(gen.printer, "alt", alt); + tag_end_self_close(gen.printer); + close_tag(gen.printer, "span"); + } + } + + NODE_RULE(variablelist, gen, x) + { + typedef std::vector<std::pair<xml_element*, xml_element*> > + items_type; + items_type items; + for (xml_element* i = x->children(); i; i = i->next()) { + if (i && i->type_ == xml_element::element_node) { + if (i->name_ == "title") { + // TODO: What to do with titles? + continue; + } + else if (i->name_ == "varlistentry") { + // TODO: What if i has an id? + xml_element* term = 0; + xml_element* listitem = 0; + for (xml_element* j = i->children(); j; j = j->next()) { + if (j && j->type_ == xml_element::element_node) { + if (j->name_ == "term") { + term = j; + } + else if (j->name_ == "listitem") { + listitem = j; + } + } + } + if (term && listitem) { + items.push_back(std::make_pair(term, listitem)); + } + } + } + } + + if (!items.empty()) { + open_tag_with_id(gen, "dl", x); + for (items_type::iterator i = items.begin(); i != items.end(); + ++i) { + tag(gen, "dt", i->first); + tag(gen, "dd", i->second); + } + close_tag(gen.printer, "dl"); + } + } + + void write_table_rows(html_gen& gen, xml_element* x, char const* td_tag) + { + for (xml_element* i = x->children(); i; i = i->next()) { + if (i->type_ == xml_element::element_node && + i->name_ == "row") { + open_tag_with_id(gen, "tr", i); + for (xml_element* j = i->children(); j; j = j->next()) { + if (j->type_ == xml_element::element_node && + j->name_ == "entry") { + auto role = x->get_attribute("role"); + tag_start_with_id(gen, td_tag, j); + if (!role.empty()) { + tag_attribute(gen.printer, "class", role); + } + tag_end(gen.printer); + generate_children_html(gen, j); + close_tag(gen.printer, td_tag); + } + } + close_tag(gen.printer, "tr"); + } + } + } + + void write_table(html_gen& gen, xml_element* x) + { + xml_element* title = 0; + xml_element* tgroup = 0; + xml_element* thead = 0; + xml_element* tbody = 0; + + for (xml_element* i = x->children(); i; i = i->next()) { + if (i->type_ == xml_element::element_node && + i->name_ == "title") { + title = i; + } + if (i->type_ == xml_element::element_node && + i->name_ == "tgroup") { + tgroup = i; + } + } + + if (!tgroup) { + return; + } + + for (xml_element* i = tgroup->children(); i; i = i->next()) { + if (i->type_ == xml_element::element_node && + i->name_ == "thead") { + thead = i; + } + if (i->type_ == xml_element::element_node && + i->name_ == "tbody") { + tbody = i; + } + } + + tag_start_with_id(gen, "div", x); + tag_attribute(gen.printer, "class", x->name_); + tag_end(gen.printer); + open_tag(gen.printer, "table"); + if (title) { + tag(gen, "caption", title); + } + if (thead) { + open_tag(gen.printer, "thead"); + write_table_rows(gen, thead, "th"); + close_tag(gen.printer, "thead"); + } + if (tbody) { + open_tag(gen.printer, "tbody"); + write_table_rows(gen, tbody, "td"); + close_tag(gen.printer, "tbody"); + } + close_tag(gen.printer, "table"); + close_tag(gen.printer, "div"); + } + + NODE_RULE(table, gen, x) { write_table(gen, x); } + NODE_RULE(informaltable, gen, x) { write_table(gen, x); } + + NODE_MAP(calloutlist, div) + + NODE_RULE(callout, gen, x) + { + boost::unordered_map<string_view, callout_data>::const_iterator + data = gen.chunk.callout_numbers.end(); + auto link = gen.state.ids.end(); + if (x->has_attribute("id")) { + data = gen.chunk.callout_numbers.find(x->get_attribute("id")); + } + if (data != gen.chunk.callout_numbers.end() && + !data->second.link_id.empty()) { + link = gen.state.ids.find(data->second.link_id); + } + + open_tag_with_id(gen, "div", x); + if (link != gen.state.ids.end()) { + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", relative_path_from_url_paths( + link->second.path(), gen.path)); + tag_end(gen.printer); + } + graphics_tag( + gen, + "/callouts/" + + boost::lexical_cast<std::string>(data->second.number) + + ".png", + "(" + boost::lexical_cast<std::string>(data->second.number) + + ")"); + if (link != gen.state.ids.end()) { + close_tag(gen.printer, "a"); + } + gen.printer.html += " "; + generate_children_html(gen, x); + close_tag(gen.printer, "div"); + } + + NODE_RULE(co, gen, x) + { + boost::unordered_map<string_view, callout_data>::const_iterator + data = gen.chunk.callout_numbers.end(); + auto link = gen.state.ids.end(); + if (x->has_attribute("linkends")) { + auto linkends = x->get_attribute("linkends"); + data = gen.chunk.callout_numbers.find(linkends); + link = gen.state.ids.find(linkends); + } + + if (link != gen.state.ids.end()) { + tag_start(gen.printer, "a"); + tag_attribute( + gen.printer, "href", relative_path_from_url_paths( + link->second.path(), gen.path)); + tag_end(gen.printer); + } + if (data != gen.chunk.callout_numbers.end()) { + graphics_tag( + gen, + "/callouts/" + + boost::lexical_cast<std::string>(data->second.number) + + ".png", + "(" + + boost::lexical_cast<std::string>(data->second.number) + + ")"); + } + else { + gen.printer.html += "(0)"; + } + if (link != gen.state.ids.end()) { + close_tag(gen.printer, "a"); + } + } + + NODE_RULE(footnote, gen, x) + { + // TODO: Better id generation.... + static int footnote_number = 0; + ++footnote_number; + std::string footnote_label = + boost::lexical_cast<std::string>(footnote_number); + auto footnote_id = + generate_id(gen.chunk, x, "(((footnote-id)))", "footnote"); + if (!x->has_attribute("id")) { + generate_id(gen.chunk, x, "id", "footnote"); + } + + tag_start_with_id(gen, "a", x); + std::string href = "#"; + href += footnote_id; + tag_attribute(gen.printer, "href", href); + tag_end(gen.printer); + tag_start(gen.printer, "sup"); + tag_attribute(gen.printer, "class", "footnote"); + tag_end(gen.printer); + gen.printer.html += "[" + footnote_label + "]"; + close_tag(gen.printer, "sup"); + close_tag(gen.printer, "a"); + + // Generate HTML to add to footnote. + html_printer printer; + tag_start(printer, "a"); + std::string href2 = "#"; + href2 += x->get_attribute("id"); + tag_attribute(printer, "href", href2); + tag_end(printer); + tag_start(printer, "sup"); + tag_end(printer); + printer.html += "[" + footnote_label + "]"; + close_tag(printer, "sup"); + close_tag(printer, "a"); + printer.html += ' '; + xml_tree_builder builder; + builder.add_element(xml_element::html_node(printer.html)); + + // Find position to insert. + auto pos = x->children(); + for (; pos && pos->type_ == xml_element::element_text; + pos = pos->next()) { + if (pos->contents_.find_first_not_of("\t\n ") != + std::string::npos) { + break; + } + } + if (!pos) { + x->add_first_child(builder.release()); + } + else + switch (pos->type_) { + case xml_element::element_node: + // TODO: Check type of node? Recurse? + pos->add_first_child(builder.release()); + break; + default: + pos->add_before(builder.release()); + break; + } + + gen.chunk.footnotes.push_back(x); + } + + std::string docinfo_get_contents(docinfo_gen& d, xml_element* x) + { + html_gen gen2(d.gen); + generate_children_html(gen2, x); + return gen2.printer.html; + } + + std::string docinfo_get_author(docinfo_gen& d, xml_element* x) + { + auto personname = x->get_child("personname"); + if (personname) { + return docinfo_get_author(d, personname); + } + + std::string name; + + char const* name_parts[] = {"honorific", "firstname", "surname"}; + std::size_t const length = + sizeof(name_parts) / sizeof(name_parts[0]); + for (std::size_t i = 0; i < length; ++i) { + auto child = x->get_child(name_parts[i]); + if (child) { + if (name.size()) { + name += " "; + } + name += docinfo_get_contents(d, child); + } + } + + return name; + } + + // docinfo parsers + + // No support for: + // + // graphic, mediaobject + // modespec + // subjectset, keywordset + // itermset, indexterm + // abbrev + // abstract + // address + // artpagenums + // authorinitials + // bibliomisc, biblioset + // confgroup + // contractnum, contractsponsor + // corpname + // date + // edition + // invpartnumber, isbn, issn, issuenum, biblioid + // orgname + // citebiblioid, citetitle + // bibliosource, bibliorelation, bibliocoverage - Dublin core + // pagenums + // printhistory + // productname, productnumber + // pubdate *** + // publisher, publishername, pubsnumber + // releaseinfo + // revhistory + // seriesvolnums + // title, subtitle, titleabbrev - *** extract into parent? + // volumenum + // personname, honorific, firstname, surname, lineage, othername, + // affiliation, authorblurb, contrib - add to authors? + + DOCINFO_NODE_RULE(copyright, docinfo_general, d, x) + { + std::vector<xml_element*> years; + std::vector<xml_element*> holders; + + for (auto child = x->children(); child; child = child->next()) { + if (child->type_ == xml_element::element_node) { + if (child->name_ == "year") { + years.push_back(child); + } + else if (child->name_ == "holder") { + holders.push_back(child); + } + else { + quickbook::detail::out() + << "Unsupported copyright tag: " << x->name_ + << std::endl; + } + } + } + + // TODO: Format years, e.g. 2005 2006 2007 2010 => 2005-2007, 2010 + + std::string copyright; + QUICKBOOK_FOR (auto year, years) { + if (!copyright.empty()) { + copyright += ", "; + } + copyright += docinfo_get_contents(d, year); + } + bool first = true; + QUICKBOOK_FOR (auto holder, holders) { + if (first) { + if (!copyright.empty()) { + copyright += " "; + } + first = false; + } + else { + copyright += ", "; + } + copyright += docinfo_get_contents(d, holder); + } + d.copyrights.push_back(copyright); + } + + DOCINFO_NODE_RULE(legalnotice, docinfo_general, d, x) + { + d.legalnotices.push_back(docinfo_get_contents(d, x)); + } + + DOCINFO_NODE_RULE(pubdate, docinfo_general, d, x) + { + d.pubdates.push_back(docinfo_get_contents(d, x)); + } + + DOCINFO_NODE_RULE(authorgroup, docinfo_general, d, x) + { + // TODO: Check children are docinfo_author + generate_docinfo_html_impl(d, x); + } + + DOCINFO_NODE_RULE(author, docinfo_author, d, x) + { + d.authors.push_back(docinfo_get_author(d, x)); + } + + DOCINFO_NODE_RULE(editor, docinfo_author, d, x) + { + d.editors.push_back(docinfo_get_author(d, x)); + } + + DOCINFO_NODE_RULE(collab, docinfo_author, d, x) + { + // Ignoring affiliation. + auto collabname = x->get_child("collabname"); + if (collabname) { + d.collabs.push_back(docinfo_get_contents(d, collabname)); + } + } + + DOCINFO_NODE_RULE(corpauthor, docinfo_author, d, x) + { + d.authors.push_back(docinfo_get_contents(d, x)); + } + + DOCINFO_NODE_RULE(corpcredit, docinfo_author, d, x) + { + std::string text = docinfo_get_contents(d, x); + + string_view class_ = x->get_attribute("class"); + if (!class_.empty()) { + text = class_.to_s() + ": " + text; + } + + d.authors.push_back(text); + } + + DOCINFO_NODE_RULE(othercredit, docinfo_author, d, x) + { + std::string text = docinfo_get_author(d, x); + + string_view class_ = x->get_attribute("class"); + if (!class_.empty()) { + text = class_.to_s() + ": " + text; + } + + d.authors.push_back(text); + } + } +} diff --git a/src/boost/tools/quickbook/src/bb2html.hpp b/src/boost/tools/quickbook/src/bb2html.hpp new file mode 100644 index 000000000..a0230cea6 --- /dev/null +++ b/src/boost/tools/quickbook/src/bb2html.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_BOOSTBOOK_TO_HTML_HPP) +#define BOOST_QUICKBOOK_BOOSTBOOK_TO_HTML_HPP + +#include <string> +#include "path.hpp" +#include "string_view.hpp" + +namespace quickbook +{ + namespace detail + { + struct html_options + { + bool chunked_output; + boost::filesystem::path home_path; + path_or_url boost_root_path; + path_or_url css_path; + path_or_url graphics_path; + bool pretty_print; + + html_options() : chunked_output(false) {} + }; + + int boostbook_to_html(quickbook::string_view, html_options const&); + } +} + +#endif // BOOST_QUICKBOOK_BOOSTBOOK_TO_HTML_HPP diff --git a/src/boost/tools/quickbook/src/block_element_grammar.cpp b/src/boost/tools/quickbook/src/block_element_grammar.cpp new file mode 100644 index 000000000..b17581d82 --- /dev/null +++ b/src/boost/tools/quickbook/src/block_element_grammar.cpp @@ -0,0 +1,335 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/spirit/include/classic_assign_actor.hpp> +#include <boost/spirit/include/classic_clear_actor.hpp> +#include <boost/spirit/include/classic_if.hpp> +#include <boost/spirit/include/phoenix1_casts.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> +#include "actions.hpp" +#include "block_tags.hpp" +#include "grammar_impl.hpp" +#include "state.hpp" +#include "template_tags.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + namespace ph = phoenix; + + struct block_element_grammar_local + { + cl::rule<scanner> heading, inner_block, inner_phrase, def_macro, table, + table_title, table_row, variablelist, varlistentry, varlistterm, + list, cell, preformatted, begin_section, end_section, xinclude, + include, include_filename, template_, template_id, + template_formal_arg, template_body, identifier, import, element_id, + same_line; + }; + + void quickbook_grammar::impl::init_block_elements() + { + block_element_grammar_local& local = + cleanup_.add(new block_element_grammar_local); + + // Actions + error_action error(state); + element_id_warning_action element_id_warning(state); + raw_char_action raw_char(state); + explicit_list_action explicit_list(state); + scoped_parser<to_value_scoped_action> to_value(state); + + // clang-format off + + local.element_id = + !( ':' + >> ( qbk_ver(107u) + >> to_value(general_tags::element_id) [attribute_value_1_7] + | qbk_ver(0, 107u) + >> !(qbk_ver(105u) >> space) + >> (+(cl::alnum_p | '_')) [state.values.entry(ph::arg1, ph::arg2, general_tags::element_id)] + | cl::eps_p [element_id_warning] + ) + ) + ; + + elements.add + ("section", element_info(element_info::section_block, &local.begin_section, block_tags::begin_section)) + ("endsect", element_info(element_info::section_block, &local.end_section, block_tags::end_section)) + ; + + local.begin_section = + space + >> local.element_id + >> space + >> local.inner_phrase + ; + + local.end_section = + space + >> local.element_id + ; + + local.heading + = space + >> !(qbk_ver(106u) >> local.element_id) + >> space + >> local.inner_phrase + ; + + elements.add + ("heading", element_info(element_info::conditional_or_block, &local.heading, block_tags::generic_heading)) + ("h1", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading1)) + ("h2", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading2)) + ("h3", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading3)) + ("h4", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading4)) + ("h5", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading5)) + ("h6", element_info(element_info::conditional_or_block, &local.heading, block_tags::heading6)) + ; + + elements.add + ("blurb", element_info(element_info::nested_block, &local.inner_block, block_tags::blurb)) + (":", element_info(element_info::nested_block, &local.inner_block, block_tags::blockquote)) + ("warning", element_info(element_info::nested_block, &local.inner_block, block_tags::warning)) + ("caution", element_info(element_info::nested_block, &local.inner_block, block_tags::caution)) + ("important", element_info(element_info::nested_block, &local.inner_block, block_tags::important)) + ("note", element_info(element_info::nested_block, &local.inner_block, block_tags::note)) + ("tip", element_info(element_info::nested_block, &local.inner_block, block_tags::tip)) + ; + + elements.add + ("block", element_info(element_info::nested_block, &local.inner_phrase, block_tags::block, 106u)) + ; + + elements.add + ("pre", element_info(element_info::nested_block, &local.preformatted, block_tags::preformatted)) + ; + + local.preformatted = + ( qbk_ver(0, 106) >> space + | qbk_ver(106) >> blank >> !eol + ) + >> to_value() + [ + inside_preformatted + ] + ; + + elements.add + ("def", element_info(element_info::conditional_or_block, &local.def_macro, block_tags::macro_definition)) + ; + + local.def_macro = + space + >> macro_identifier [state.values.entry(ph::arg1, ph::arg2)] + >> blank + >> local.inner_phrase + ; + + local.identifier = + (cl::alpha_p | '_') >> *(cl::alnum_p | '_') + ; + + local.template_id = + local.identifier | (cl::punct_p - (cl::ch_p('[') | ']')) + ; + + elements.add + ("template", element_info(element_info::conditional_or_block, &local.template_, block_tags::template_definition)) + ; + + local.template_ = + space + >> local.template_id [state.values.entry(ph::arg1, ph::arg2)] + >> state.values.list()[ + !( + space >> '[' + >> *( + space + >> local.template_id [state.values.entry(ph::arg1, ph::arg2)] + ) + >> space >> ']' + ) + ] + >> ( cl::eps_p(*cl::blank_p >> cl::eol_p) + >> local.template_body [state.values.entry(ph::arg1, ph::arg2, template_tags::block)] + | local.template_body [state.values.entry(ph::arg1, ph::arg2, template_tags::phrase)] + ) + ; + + local.template_body = + qbk_ver(106u) + >> *(~cl::eps_p(']') >> skip_entity) + | qbk_ver(0,106u) + >> *(('[' >> local.template_body >> ']') | (cl::anychar_p - ']')) + >> cl::eps_p(space >> ']') + >> space + ; + + elements.add + ("variablelist", element_info(element_info::nested_block, &local.variablelist, block_tags::variable_list)) + ; + + local.variablelist = + (cl::eps_p(*cl::blank_p >> cl::eol_p) | space) + >> local.table_title + >> *local.varlistentry + ; + + local.varlistentry = + space + >> cl::ch_p('[') + >> state.values.list() + [ + ( + local.varlistterm + >> ( +local.cell + | cl::eps_p [error] + ) + >> cl::ch_p(']') + >> space + ) + | cl::eps_p [error] + ] + ; + + local.varlistterm = + space + >> cl::ch_p('[') + >> local.inner_phrase + >> ( cl::ch_p(']') + >> space + | cl::eps_p [error] + ) + ; + + elements.add + ("table", element_info(element_info::nested_block, &local.table, block_tags::table)) + ; + + local.same_line = *cl::blank_p >> !(comment >> space); + + local.table = + local.same_line + >> !(qbk_ver(105u) >> local.element_id) + >> local.same_line + >> local.table_title + >> *local.table_row + ; + + local.table_row = + space + >> cl::ch_p('[') + >> + ( + ( + state.values.list(table_tags::row) + [ *local.cell + ] + >> cl::ch_p(']') + >> space + ) + | cl::eps_p [error] + ) + ; + + local.table_title = + qbk_ver(0, 106) + >> (*(cl::anychar_p - eol)) [state.values.entry(ph::arg1, ph::arg2, table_tags::title)] + >> (+eol) + | qbk_ver(106) + >> to_value(table_tags::title) + [ + table_title_phrase + ] + >> space + ; + + elements.add + ("ordered_list", element_info(element_info::nested_block, &local.list, block_tags::ordered_list, 106)) + ("itemized_list", element_info(element_info::nested_block, &local.list, block_tags::itemized_list, 106)) + ; + + local.list = + *( cl::eps_p [explicit_list] + >> local.cell + ) + ; + + local.cell = + space + >> cl::ch_p('[') + >> ( local.inner_block + >> cl::ch_p(']') + >> space + | cl::eps_p [error] + ) + ; + + elements.add + ("xinclude", element_info(element_info::conditional_or_block, &local.xinclude, block_tags::xinclude)) + ("import", element_info(element_info::conditional_or_block, &local.import, block_tags::import)) + ("include", element_info(element_info::conditional_or_block, &local.include, block_tags::include)) + ; + + local.xinclude = + space + >> local.include_filename + ; + + local.import = + space + >> local.include_filename + ; + + local.include = + space + >> + !( + ':' + >> (*((cl::alnum_p | '_') - cl::space_p)) + [state.values.entry(ph::arg1, ph::arg2, general_tags::include_id)] + >> space + ) + >> local.include_filename + ; + + local.include_filename = + qbk_ver(0, 106u) + >> (*(cl::anychar_p - phrase_end)) [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(106u, 107u) + >> to_value() + [ *( raw_escape + | (cl::anychar_p - phrase_end) + [raw_char] + ) + ] + | qbk_ver(107u) + >> to_value() [ attribute_value_1_7 ] + ; + + local.inner_block = + to_value() + [ + inside_paragraph + ] + ; + + local.inner_phrase = + to_value() + [ + paragraph_phrase + ] + ; + + // clang-format on + } +} diff --git a/src/boost/tools/quickbook/src/block_tags.hpp b/src/boost/tools/quickbook/src/block_tags.hpp new file mode 100644 index 000000000..88d891715 --- /dev/null +++ b/src/boost/tools/quickbook/src/block_tags.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_TABLE_TAGS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_TABLE_TAGS_HPP + +#include "value_tags.hpp" + +namespace quickbook +{ + // clang-format off + + QUICKBOOK_VALUE_TAGS(block_tags, 0x200, + (begin_section)(end_section) + (generic_heading) + (heading1)(heading2)(heading3)(heading4)(heading5)(heading6) + (blurb)(blockquote)(preformatted) + (warning)(caution)(important)(note)(tip)(block) + (macro_definition)(template_definition) + (variable_list)(table) + (xinclude)(import)(include) + (paragraph)(paragraph_in_list) + (ordered_list)(itemized_list) + (hr) + ) + + QUICKBOOK_VALUE_TAGS(table_tags, 0x250, + (title)(row) + ) + + QUICKBOOK_VALUE_TAGS(general_tags, 0x300, + (element_id)(include_id)(list_indent)(list_mark) + ) + + // clang-format on +} + +#endif diff --git a/src/boost/tools/quickbook/src/boostbook_chunker.cpp b/src/boost/tools/quickbook/src/boostbook_chunker.cpp new file mode 100644 index 000000000..ec822d982 --- /dev/null +++ b/src/boost/tools/quickbook/src/boostbook_chunker.cpp @@ -0,0 +1,158 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "boostbook_chunker.hpp" +#include <boost/algorithm/string/replace.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/unordered_set.hpp> + +namespace quickbook +{ + namespace detail + { + boost::unordered_set<std::string> chunk_types; + boost::unordered_set<std::string> chunkinfo_types; + + static struct init_chunk_type + { + init_chunk_type() + { + chunk_types.insert("book"); + chunk_types.insert("article"); + chunk_types.insert("library"); + chunk_types.insert("chapter"); + chunk_types.insert("part"); + chunk_types.insert("appendix"); + chunk_types.insert("preface"); + chunk_types.insert("qandadiv"); + chunk_types.insert("qandaset"); + chunk_types.insert("reference"); + chunk_types.insert("set"); + chunk_types.insert("section"); + + for (boost::unordered_set<std::string>::const_iterator it = + chunk_types.begin(); + it != chunk_types.end(); ++it) { + chunkinfo_types.insert(*it + "info"); + } + } + } init_chunk; + + struct chunk_builder : tree_builder<chunk> + { + int count; + + chunk_builder() : count(0) {} + + std::string next_path_name() + { + ++count; + std::string result = "page-"; + result += boost::lexical_cast<std::string>(count); + ++count; + return result; + } + }; + + void chunk_nodes( + chunk_builder& builder, xml_tree& tree, xml_element* node); + std::string id_to_path(quickbook::string_view); + void inline_chunks(chunk*); + + chunk_tree chunk_document(xml_tree& tree) + { + chunk_builder builder; + for (xml_element* it = tree.root(); it;) { + xml_element* next = it->next(); + chunk_nodes(builder, tree, it); + it = next; + } + + return builder.release(); + } + + void inline_sections(chunk* c, int depth) + { + if (c->contents_.root()->name_ == "section" && depth > 1) { + --depth; + } + + // When depth is 0, inline leading sections. + chunk* it = c->children(); + if (depth == 0) { + for (; it && it->contents_.root()->name_ == "section"; + it = it->next()) { + inline_chunks(it); + } + } + + for (; it; it = it->next()) { + inline_sections(it, depth); + } + } + + void inline_all(chunk* c) + { + for (chunk* it = c->children(); it; it = it->next()) { + inline_chunks(it); + } + } + + void inline_chunks(chunk* c) + { + c->inline_ = true; + c->path_ = c->parent()->path_; + for (chunk* it = c->children(); it; it = it->next()) { + inline_chunks(it); + } + } + + void chunk_nodes( + chunk_builder& builder, xml_tree& tree, xml_element* node) + { + chunk* parent = builder.parent(); + + if (parent && node->type_ == xml_element::element_node && + node->name_ == "title") { + parent->title_ = tree.extract(node); + } + else if ( + parent && node->type_ == xml_element::element_node && + chunkinfo_types.find(node->name_) != chunkinfo_types.end()) { + parent->info_ = tree.extract(node); + } + else if ( + node->type_ == xml_element::element_node && + chunk_types.find(node->name_) != chunk_types.end()) { + chunk* chunk_node = new chunk(tree.extract(node)); + builder.add_element(chunk_node); + + chunk_node->id_ = node->has_attribute("id") + ? node->get_attribute("id").to_s() + : builder.next_path_name(); + chunk_node->path_ = id_to_path(chunk_node->id_); + + builder.start_children(); + for (xml_element* it = node->children(); it;) { + xml_element* next = it->next(); + chunk_nodes(builder, tree, it); + it = next; + } + builder.end_children(); + } + } + + std::string id_to_path(quickbook::string_view id) + { + std::string result(id.begin(), id.end()); + boost::replace_all(result, ".", "/"); + result += ".html"; + return result; + } + } +} diff --git a/src/boost/tools/quickbook/src/boostbook_chunker.hpp b/src/boost/tools/quickbook/src/boostbook_chunker.hpp new file mode 100644 index 000000000..b9a2d1f28 --- /dev/null +++ b/src/boost/tools/quickbook/src/boostbook_chunker.hpp @@ -0,0 +1,41 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_BOOSTBOOK_CHUNKER_HPP) +#define BOOST_QUICKBOOK_BOOSTBOOK_CHUNKER_HPP + +#include "xml_parse.hpp" + +namespace quickbook +{ + namespace detail + { + struct chunk : tree_node<chunk> + { + xml_tree contents_; + xml_tree title_; + xml_tree info_; + bool inline_; + std::string id_; + std::string path_; + + explicit chunk(xml_tree&& contents) + : contents_(std::move(contents)), inline_(false) + { + } + }; + + typedef tree<chunk> chunk_tree; + + chunk_tree chunk_document(xml_tree&); + void inline_sections(chunk*, int depth); + void inline_all(chunk*); + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/cleanup.hpp b/src/boost/tools/quickbook/src/cleanup.hpp new file mode 100644 index 000000000..41ca4da72 --- /dev/null +++ b/src/boost/tools/quickbook/src/cleanup.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Copyright (c) 2010.2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_CLEANUP_HPP) +#define BOOST_SPIRIT_QUICKBOOK_CLEANUP_HPP + +namespace quickbook +{ + // This header defines a class which will store pointers and delete what + // they're pointing to on destruction. Add an object, and you can use + // pointers and references to it during the cleanup object's lifespan. + // + // Example use: + // + // struct wonder_struct { + // quickbook::cleanup cleanup; + // }; + // + // wonder_struct w; + // thing& t = w.cleanup.add(new thing()); + // + // Can now use 't' until the wonder_struct is destroyed. + // + // Anything added to cleanup is destroyed in reverse order, so it + // should be okay for an object to depend on something that was previously + // added. + + namespace detail + { + struct cleanup_node; + } + struct cleanup + { + cleanup() : first_(0) {} + ~cleanup(); + template <typename T> T& add(T*); + + private: + detail::cleanup_node* first_; + + cleanup& operator=(cleanup const&); + cleanup(cleanup const&); + }; + + namespace detail + { + template <typename T> void delete_impl(void* ptr) + { + delete static_cast<T*>(ptr); + } + + struct cleanup_node + { + void* ptr_; + void (*del_)(void*); + cleanup_node* next_; + + cleanup_node() : ptr_(0), del_(0), next_(0) {} + cleanup_node(void* ptr, void (*del)(void* x)) + : ptr_(ptr), del_(del), next_(0) + { + } + ~cleanup_node() + { + if (ptr_) del_(ptr_); + } + + void move_assign(cleanup_node& n) + { + ptr_ = n.ptr_; + del_ = n.del_; + n.ptr_ = 0; + n.del_ = 0; + } + + private: + cleanup_node(cleanup_node const&); + cleanup_node& operator=(cleanup_node const&); + }; + } + + template <typename T> T& cleanup::add(T* ptr) + { + detail::cleanup_node n(ptr, &detail::delete_impl<T>); + detail::cleanup_node* n2 = new detail::cleanup_node(); + n2->next_ = first_; + first_ = n2; + n2->move_assign(n); + return *ptr; + } + + inline cleanup::~cleanup() + { + while (first_) { + detail::cleanup_node* to_delete = first_; + first_ = first_->next_; + delete to_delete; + } + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/code_snippet.cpp b/src/boost/tools/quickbook/src/code_snippet.cpp new file mode 100644 index 000000000..e2fd13738 --- /dev/null +++ b/src/boost/tools/quickbook/src/code_snippet.cpp @@ -0,0 +1,532 @@ +/*============================================================================= + Copyright (c) 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/bind/bind.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/spirit/include/classic_actor.hpp> +#include <boost/spirit/include/classic_confix.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include "actions.hpp" +#include "block_tags.hpp" +#include "files.hpp" +#include "state.hpp" +#include "stream.hpp" +#include "template_stack.hpp" +#include "values.hpp" + +using namespace boost::placeholders; + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + struct code_snippet_actions + { + code_snippet_actions( + std::vector<template_symbol>& storage_, + file_ptr source_file_, + char const* source_type_) + : last_code_pos(source_file_->source().begin()) + , in_code(false) + , snippet_stack() + , storage(storage_) + , source_file(source_file_) + , source_type(source_type_) + , error_count(0) + { + source_file->is_code_snippets = true; + content.start(source_file); + } + + void mark(string_iterator first, string_iterator last); + void pass_thru(string_iterator first, string_iterator last); + void escaped_comment(string_iterator first, string_iterator last); + void start_snippet(string_iterator first, string_iterator last); + void start_snippet_impl(std::string const&, string_iterator); + void end_snippet(string_iterator first, string_iterator last); + void end_snippet_impl(string_iterator); + void end_file(string_iterator, string_iterator); + + void append_code(string_iterator first, string_iterator last); + void close_code(); + + struct snippet_data + { + snippet_data(std::string const& id_) : id(id_), start_code(false) {} + + std::string id; + bool start_code; + string_iterator source_pos; + mapped_file_builder::pos_type start_pos; + boost::shared_ptr<snippet_data> next; + }; + + void push_snippet_data(std::string const& id, string_iterator pos) + { + boost::shared_ptr<snippet_data> new_snippet(new snippet_data(id)); + new_snippet->next = snippet_stack; + snippet_stack = new_snippet; + snippet_stack->start_code = in_code; + snippet_stack->source_pos = pos; + snippet_stack->start_pos = content.get_pos(); + } + + boost::shared_ptr<snippet_data> pop_snippet_data() + { + boost::shared_ptr<snippet_data> snippet(snippet_stack); + snippet_stack = snippet->next; + snippet->next.reset(); + return snippet; + } + + mapped_file_builder content; + string_iterator mark_begin, mark_end; + string_iterator last_code_pos; + bool in_code; + boost::shared_ptr<snippet_data> snippet_stack; + std::vector<template_symbol>& storage; + file_ptr source_file; + char const* const source_type; + int error_count; + }; + + struct python_code_snippet_grammar + : cl::grammar<python_code_snippet_grammar> + { + typedef code_snippet_actions actions_type; + + python_code_snippet_grammar(actions_type& actions_) : actions(actions_) + { + } + + template <typename Scanner> struct definition + { + typedef code_snippet_actions actions_type; + + definition(python_code_snippet_grammar const& self) + { + // clang-format off + + start_ = (*code_elements) [boost::bind(&actions_type::end_file, &self.actions, _1, _2)] + ; + + identifier = + (cl::alpha_p | '_') >> *(cl::alnum_p | '_') + ; + + code_elements = + start_snippet [boost::bind(&actions_type::start_snippet, &self.actions, _1, _2)] + | end_snippet [boost::bind(&actions_type::end_snippet, &self.actions, _1, _2)] + | escaped_comment [boost::bind(&actions_type::escaped_comment, &self.actions, _1, _2)] + | pass_thru_comment [boost::bind(&actions_type::pass_thru, &self.actions, _1, _2)] + | ignore [boost::bind(&actions_type::append_code, &self.actions, _1, _2)] + | cl::anychar_p + ; + + start_snippet = + *cl::blank_p + >> !(cl::eol_p >> *cl::blank_p) + >> "#[" + >> *cl::blank_p + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + >> *(cl::anychar_p - cl::eol_p) + ; + + end_snippet = + *cl::blank_p + >> !(cl::eol_p >> *cl::blank_p) + >> "#]" + >> *(cl::anychar_p - cl::eol_p) + ; + + ignore + = cl::confix_p( + *cl::blank_p >> "#<-", + *cl::anychar_p, + "#->" >> *cl::blank_p >> (cl::eol_p | cl::end_p) + ) + | cl::confix_p( + "\"\"\"<-\"\"\"", + *cl::anychar_p, + "\"\"\"->\"\"\"" + ) + | cl::confix_p( + "\"\"\"<-", + *cl::anychar_p, + "->\"\"\"" + ) + ; + + escaped_comment = + cl::confix_p( + *cl::space_p >> "#`", + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + (cl::eol_p | cl::end_p) + ) + | cl::confix_p( + *cl::space_p >> "\"\"\"`", + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + "\"\"\"" + ) + ; + + // Note: Unlike escaped_comment and ignore, this doesn't + // swallow preceeding whitespace. + pass_thru_comment + = "#=" >> (cl::eps_p - '=') + >> ( *(cl::anychar_p - cl::eol_p) + >> (cl::eol_p | cl::end_p) + ) [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + | cl::confix_p( + "\"\"\"=" >> (cl::eps_p - '='), + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + "\"\"\"" + ) + ; + + // clang-format on + } + + cl::rule<Scanner> start_, identifier, code_elements, start_snippet, + end_snippet, escaped_comment, pass_thru_comment, ignore; + + cl::rule<Scanner> const& start() const { return start_; } + }; + + actions_type& actions; + }; + + struct cpp_code_snippet_grammar : cl::grammar<cpp_code_snippet_grammar> + { + typedef code_snippet_actions actions_type; + + cpp_code_snippet_grammar(actions_type& actions_) : actions(actions_) {} + + template <typename Scanner> struct definition + { + definition(cpp_code_snippet_grammar const& self) + { + // clang-format off + + start_ = (*code_elements) [boost::bind(&actions_type::end_file, &self.actions, _1, _2)] + ; + + identifier = + (cl::alpha_p | '_') >> *(cl::alnum_p | '_') + ; + + code_elements = + start_snippet [boost::bind(&actions_type::start_snippet, &self.actions, _1, _2)] + | end_snippet [boost::bind(&actions_type::end_snippet, &self.actions, _1, _2)] + | escaped_comment [boost::bind(&actions_type::escaped_comment, &self.actions, _1, _2)] + | ignore [boost::bind(&actions_type::append_code, &self.actions, _1, _2)] + | pass_thru_comment [boost::bind(&actions_type::pass_thru, &self.actions, _1, _2)] + | cl::anychar_p + ; + + start_snippet = + *cl::blank_p + >> !(cl::eol_p >> *cl::blank_p) + >> "//[" + >> *cl::blank_p + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + >> *(cl::anychar_p - cl::eol_p) + | + *cl::blank_p + >> cl::eol_p + >> *cl::blank_p + >> "/*[" + >> *cl::space_p + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + >> *cl::space_p + >> "*/" + >> *cl::blank_p + >> cl::eps_p(cl::eol_p) + | + "/*[" + >> *cl::space_p + >> identifier [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + >> *cl::space_p + >> "*/" + ; + + end_snippet = + *cl::blank_p + >> !(cl::eol_p >> *cl::blank_p) + >> "//]" + >> *(cl::anychar_p - cl::eol_p) + | + *cl::blank_p + >> cl::eol_p + >> *cl::blank_p + >> "/*]*/" + >> *cl::blank_p + >> cl::eps_p(cl::eol_p) + | + "/*[*/" + ; + + ignore + = cl::confix_p( + *cl::blank_p >> "//<-", + *cl::anychar_p, + "//->" + ) + >> *cl::blank_p + >> cl::eol_p + | cl::confix_p( + "/*<-*/", + *cl::anychar_p, + "/*->*/" + ) + | cl::confix_p( + "/*<-", + *cl::anychar_p, + "->*/" + ) + ; + + escaped_comment + = cl::confix_p( + *cl::space_p >> "//`", + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + (cl::eol_p | cl::end_p) + ) + | cl::confix_p( + *cl::space_p >> "/*`", + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + "*/" + ) + ; + + // Note: Unlike escaped_comment and ignore, this doesn't + // swallow preceeding whitespace. + pass_thru_comment + = "//=" >> (cl::eps_p - '=') + >> ( *(cl::anychar_p - cl::eol_p) + >> (cl::eol_p | cl::end_p) + ) [boost::bind(&actions_type::mark, &self.actions, _1, _2)] + | cl::confix_p( + "/*=" >> (cl::eps_p - '='), + (*cl::anychar_p) [boost::bind(&actions_type::mark, &self.actions, _1, _2)], + "*/" + ) + ; + + // clang-format on + } + + cl::rule<Scanner> start_, identifier, code_elements, start_snippet, + end_snippet, escaped_comment, pass_thru_comment, ignore; + + cl::rule<Scanner> const& start() const { return start_; } + }; + + actions_type& actions; + }; + + int load_snippets( + fs::path const& filename, + std::vector<template_symbol>& storage // snippets are stored in a + // vector of template_symbols + , + std::string const& extension, + value::tag_type load_type) + { + ignore_variable(&load_type); // Avoid unreferenced parameter warning. + assert( + load_type == block_tags::include || + load_type == block_tags::import); + + bool is_python = extension == ".py" || extension == ".jam"; + code_snippet_actions a( + storage, load(filename, qbk_version_n), + is_python ? "[python]" : "[c++]"); + + string_iterator first(a.source_file->source().begin()); + string_iterator last(a.source_file->source().end()); + + cl::parse_info<string_iterator> info; + + if (is_python) { + info = boost::spirit::classic::parse( + first, last, python_code_snippet_grammar(a)); + } + else { + info = boost::spirit::classic::parse( + first, last, cpp_code_snippet_grammar(a)); + } + + assert(info.full); + return a.error_count; + } + + void code_snippet_actions::append_code( + string_iterator first, string_iterator last) + { + assert(last_code_pos <= first); + + if (snippet_stack) { + if (last_code_pos != first) { + if (!in_code) { + content.add_at_pos("\n\n", last_code_pos); + content.add_at_pos(source_type, last_code_pos); + content.add_at_pos("```\n", last_code_pos); + + in_code = true; + } + + content.add(quickbook::string_view( + last_code_pos, first - last_code_pos)); + } + } + + last_code_pos = last; + } + + void code_snippet_actions::close_code() + { + if (!snippet_stack) return; + + if (in_code) { + content.add_at_pos("\n```\n\n", last_code_pos); + in_code = false; + } + } + + void code_snippet_actions::mark(string_iterator first, string_iterator last) + { + mark_begin = first; + mark_end = last; + } + + void code_snippet_actions::pass_thru( + string_iterator first, string_iterator last) + { + if (!snippet_stack) return; + append_code(first, last); + + if (!in_code) { + content.add_at_pos("\n\n", first); + content.add_at_pos(source_type, first); + content.add_at_pos("```\n", first); + in_code = true; + } + + content.add(quickbook::string_view(mark_begin, mark_end - mark_begin)); + } + + void code_snippet_actions::escaped_comment( + string_iterator first, string_iterator last) + { + append_code(first, last); + close_code(); + + if (mark_begin != mark_end) { + if (!snippet_stack) { + start_snippet_impl("!", first); + } + + snippet_data& snippet = *snippet_stack; + + content.add_at_pos("\n", mark_begin); + content.unindent_and_add( + quickbook::string_view(mark_begin, mark_end - mark_begin)); + + if (snippet.id == "!") { + end_snippet_impl(last); + } + } + } + + void code_snippet_actions::start_snippet( + string_iterator first, string_iterator last) + { + append_code(first, last); + start_snippet_impl(std::string(mark_begin, mark_end), first); + } + + void code_snippet_actions::end_snippet( + string_iterator first, string_iterator last) + { + append_code(first, last); + + if (!snippet_stack) { + if (qbk_version_n >= 106u) { + detail::outerr(source_file, first) + << "Mismatched end snippet." << std::endl; + ++error_count; + } + else { + detail::outwarn(source_file, first) + << "Mismatched end snippet." << std::endl; + } + return; + } + + end_snippet_impl(first); + } + + void code_snippet_actions::end_file(string_iterator, string_iterator pos) + { + append_code(pos, pos); + close_code(); + + while (snippet_stack) { + if (qbk_version_n >= 106u) { + detail::outerr(source_file->path) + << "Unclosed snippet '" << snippet_stack->id << "'" + << std::endl; + ++error_count; + } + else { + detail::outwarn(source_file->path) + << "Unclosed snippet '" << snippet_stack->id << "'" + << std::endl; + } + + end_snippet_impl(pos); + } + } + + void code_snippet_actions::start_snippet_impl( + std::string const& id, string_iterator position) + { + push_snippet_data(id, position); + } + + void code_snippet_actions::end_snippet_impl(string_iterator position) + { + assert(snippet_stack); + + boost::shared_ptr<snippet_data> snippet = pop_snippet_data(); + + mapped_file_builder f; + f.start(source_file); + if (snippet->start_code) { + f.add_at_pos("\n\n", snippet->source_pos); + f.add_at_pos(source_type, snippet->source_pos); + f.add_at_pos("```\n", snippet->source_pos); + } + f.add(content, snippet->start_pos, content.get_pos()); + if (in_code) { + f.add_at_pos("\n```\n\n", position); + } + + std::vector<std::string> params; + + file_ptr body = f.release(); + + storage.push_back(template_symbol( + snippet->id, params, + qbk_value( + body, body->source().begin(), body->source().end(), + template_tags::snippet))); + } +} diff --git a/src/boost/tools/quickbook/src/collector.cpp b/src/boost/tools/quickbook/src/collector.cpp new file mode 100644 index 000000000..31324ab32 --- /dev/null +++ b/src/boost/tools/quickbook/src/collector.cpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "collector.hpp" +#include <boost/assert.hpp> + +namespace quickbook +{ + string_stream::string_stream() + : buffer_ptr(new std::string()) + , stream_ptr( + new ostream(boost::iostreams::back_inserter(*buffer_ptr.get()))) + { + } + + string_stream::string_stream(string_stream const& other) + : buffer_ptr(other.buffer_ptr), stream_ptr(other.stream_ptr) + { + } + + string_stream& string_stream::operator=(string_stream const& other) + { + buffer_ptr = other.buffer_ptr; + stream_ptr = other.stream_ptr; + return *this; + } + + collector::collector() : main(default_), top(default_) {} + + collector::collector(string_stream& out) : main(out), top(out) {} + + collector::~collector() + { + BOOST_ASSERT( + streams.empty()); // assert there are no more pushes than pops!!! + } + + void collector::push() + { + streams.push(string_stream()); + top = boost::ref(streams.top()); + } + + void collector::pop() + { + BOOST_ASSERT(!streams.empty()); + streams.pop(); + + if (streams.empty()) + top = boost::ref(main); + else + top = boost::ref(streams.top()); + } +} diff --git a/src/boost/tools/quickbook/src/collector.hpp b/src/boost/tools/quickbook/src/collector.hpp new file mode 100644 index 000000000..eb2772c84 --- /dev/null +++ b/src/boost/tools/quickbook/src/collector.hpp @@ -0,0 +1,97 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_COLLECTOR_HPP) +#define BOOST_SPIRIT_QUICKBOOK_COLLECTOR_HPP + +#include <stack> +#include <string> +#include <boost/iostreams/device/back_inserter.hpp> +#include <boost/iostreams/filtering_stream.hpp> +#include <boost/noncopyable.hpp> +#include <boost/ref.hpp> +#include <boost/shared_ptr.hpp> + +namespace quickbook +{ + struct string_stream + { + typedef boost::iostreams::filtering_ostream ostream; + + string_stream(); + string_stream(string_stream const& other); + string_stream& operator=(string_stream const& other); + + std::string const& str() const + { + stream_ptr->flush(); + return *buffer_ptr.get(); + } + + std::ostream& get() const { return *stream_ptr.get(); } + + void clear() { buffer_ptr->clear(); } + + void swap(std::string& other) + { + stream_ptr->flush(); + std::swap(other, *buffer_ptr.get()); + } + + void append(std::string const& other) + { + stream_ptr->flush(); + *buffer_ptr.get() += other; + } + + private: + boost::shared_ptr<std::string> buffer_ptr; + boost::shared_ptr<ostream> stream_ptr; + }; + + struct collector : boost::noncopyable + { + collector(); + collector(string_stream& out); + ~collector(); + + void push(); + void pop(); + + std::ostream& get() const { return top.get().get(); } + + std::string const& str() const { return top.get().str(); } + + void clear() { top.get().clear(); } + + void swap(std::string& other) { top.get().swap(other); } + + void append(std::string const& other) { top.get().append(other); } + + private: + std::stack<string_stream> streams; + boost::reference_wrapper<string_stream> main; + boost::reference_wrapper<string_stream> top; + string_stream default_; + }; + + template <typename T> + inline collector& operator<<(collector& out, T const& val) + { + out.get() << val; + return out; + } + + inline collector& operator<<(collector& out, std::string const& val) + { + out.append(val); + return out; + } +} + +#endif // BOOST_SPIRIT_QUICKBOOK_COLLECTOR_HPP diff --git a/src/boost/tools/quickbook/src/dependency_tracker.cpp b/src/boost/tools/quickbook/src/dependency_tracker.cpp new file mode 100644 index 000000000..5f50352b1 --- /dev/null +++ b/src/boost/tools/quickbook/src/dependency_tracker.cpp @@ -0,0 +1,134 @@ +/*============================================================================= + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "dependency_tracker.hpp" +#include <boost/filesystem/fstream.hpp> +#include <boost/filesystem/operations.hpp> +#include "for.hpp" +#include "path.hpp" + +namespace quickbook +{ + static char const* control_escapes[16] = { + "\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a", + "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\016", "\\017"}; + + static std::string escaped_path(std::string const& generic) + { + std::string result; + result.reserve(generic.size()); + + QUICKBOOK_FOR (char c, generic) { + if (c >= 0 && c < 16) { + result += control_escapes[(unsigned int)c]; + } + else if (c == '\\') { + result += "\\\\"; + } + else if (c == 127) { + result += "\\177"; + } + else { + result += c; + } + } + + return result; + } + + static std::string get_path( + fs::path const& path, dependency_tracker::flags f) + { + std::string generic = quickbook::detail::path_to_generic(path); + + if (f & dependency_tracker::escaped) { + generic = escaped_path(generic); + } + + return generic; + } + + dependency_tracker::dependency_tracker() + : dependencies() + , glob_dependencies() + , last_glob(glob_dependencies.end()) + { + } + + bool dependency_tracker::add_dependency(fs::path const& f) + { + bool found = fs::exists(fs::status(f)); + dependencies[f] |= found; + return found; + } + + void dependency_tracker::add_glob(fs::path const& f) + { + std::pair<glob_list::iterator, bool> r = glob_dependencies.insert( + std::make_pair(f, glob_list::mapped_type())); + last_glob = r.first; + } + + void dependency_tracker::add_glob_match(fs::path const& f) + { + assert(last_glob != glob_dependencies.end()); + last_glob->second.insert(f); + } + + void dependency_tracker::write_dependencies( + fs::path const& file_out, flags f) + { + fs::ofstream out(file_out); + + if (out.fail()) { + throw std::runtime_error( + "Error opening dependency file " + + quickbook::detail::path_to_generic(file_out)); + } + + out.exceptions(std::ios::badbit); + write_dependencies(out, f); + } + + void dependency_tracker::write_dependencies(std::ostream& out, flags f) + { + if (f & checked) { + QUICKBOOK_FOR (dependency_list::value_type const& d, dependencies) { + out << (d.second ? "+ " : "- ") << get_path(d.first, f) + << std::endl; + } + + QUICKBOOK_FOR (glob_list::value_type const& g, glob_dependencies) { + out << "g " << get_path(g.first, f) << std::endl; + + QUICKBOOK_FOR (fs::path const& p, g.second) { + out << "+ " << get_path(p, f) << std::endl; + } + } + } + else { + std::set<std::string> paths; + + QUICKBOOK_FOR (dependency_list::value_type const& d, dependencies) { + if (d.second) { + paths.insert(get_path(d.first, f)); + } + } + + QUICKBOOK_FOR (glob_list::value_type const& g, glob_dependencies) { + QUICKBOOK_FOR (fs::path const& p, g.second) { + paths.insert(get_path(p, f)); + } + } + + QUICKBOOK_FOR (std::string const& p, paths) { + out << p << std::endl; + } + } + } +} diff --git a/src/boost/tools/quickbook/src/dependency_tracker.hpp b/src/boost/tools/quickbook/src/dependency_tracker.hpp new file mode 100644 index 000000000..b0a3764fa --- /dev/null +++ b/src/boost/tools/quickbook/src/dependency_tracker.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(QUICKBOOK_DEPENDENCY_TRACKER_HPP) +#define QUICKBOOK_DEPENDENCY_TRACKER_HPP + +#include <iosfwd> +#include <map> +#include <set> +#include <boost/filesystem/path.hpp> + +namespace quickbook +{ + namespace fs = boost::filesystem; + + struct dependency_tracker + { + private: + typedef std::map<fs::path, bool> dependency_list; + typedef std::map<fs::path, std::set<fs::path> > glob_list; + + dependency_list dependencies; + glob_list glob_dependencies; + glob_list::iterator last_glob; + + public: + enum flags + { + default_ = 0, + checked = 1, + escaped = 2 + }; + + dependency_tracker(); + + // Call this before loading any file so that it will be included in the + // list of dependencies. Returns true if file exists. + bool add_dependency(fs::path const&); + + void add_glob(fs::path const&); + void add_glob_match(fs::path const&); + + void write_dependencies(fs::path const&, flags = default_); + void write_dependencies(std::ostream&, flags = default_); + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/doc_info_actions.cpp b/src/boost/tools/quickbook/src/doc_info_actions.cpp new file mode 100644 index 000000000..1472eed0d --- /dev/null +++ b/src/boost/tools/quickbook/src/doc_info_actions.cpp @@ -0,0 +1,610 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include <sstream> +#include <boost/algorithm/string/join.hpp> +#include <boost/bind/bind.hpp> +#include <boost/filesystem/operations.hpp> +#include "doc_info_tags.hpp" +#include "document_state.hpp" +#include "files.hpp" +#include "for.hpp" +#include "path.hpp" +#include "quickbook.hpp" +#include "state.hpp" +#include "stream.hpp" +#include "utils.hpp" + +using namespace boost::placeholders; + +namespace quickbook +{ + struct doc_info_values + { + std::string doc_type; + value doc_title; + std::vector<value> escaped_attributes; + value qbk_version, compatibility_mode; + value id, dirname, last_revision, purpose; + std::vector<value> categories; + value lang, version; + std::vector<value> authors; + std::vector<value> copyrights; + value license; + std::vector<value> biblioids; + value xmlbase; + std::string xmlbase_value; + + std::string id_placeholder; + std::string include_doc_id_, id_; + }; + + static void write_document_title( + collector& out, value const& title, value const& version); + std::string write_boostbook_header( + quickbook::state& state, doc_info_values const& info, bool nested_file); + + static std::string doc_info_output(value const& p, unsigned version) + { + if (qbk_version_n < version) { + std::string value = p.get_quickbook().to_s(); + value.erase(value.find_last_not_of(" \t") + 1); + return value; + } + else { + return p.get_encoded(); + } + } + + char const* doc_info_attribute_name(value::tag_type tag) + { + return doc_attributes::is_tag(tag) ? doc_attributes::name(tag) + : doc_info_attributes::name(tag); + } + + // Each docinfo attribute is stored in a value list, these are then stored + // in a sorted value list. The following convenience methods extract all the + // values for an attribute tag. + + // Expecting at most one attribute, with several values in the list. + value consume_list( + value_consumer& c, + value::tag_type tag, + std::vector<std::string>* duplicates) + { + value p; + + int count = 0; + while (c.check(tag)) { + p = c.consume(); + ++count; + } + + if (count > 1) duplicates->push_back(doc_info_attribute_name(tag)); + + return p; + } + + // Expecting at most one attribute, with a single value, so extract that + // immediately. + value consume_value_in_list( + value_consumer& c, + value::tag_type tag, + std::vector<std::string>* duplicates) + { + value l = consume_list(c, tag, duplicates); + if (l.empty()) return l; + + assert(l.is_list()); + value_consumer c2 = l; + value p = c2.consume(); + c2.finish(); + + return p; + } + + // Any number of attributes, so stuff them into a vector. + std::vector<value> consume_multiple_values( + value_consumer& c, value::tag_type tag) + { + std::vector<value> values; + + while (c.check(tag)) { + values.push_back(c.consume()); + } + + return values; + } + + enum version_state + { + version_unknown, + version_stable, + version_dev + }; + version_state classify_version(unsigned v) + { + return v < 100u ? version_unknown + : v <= 107u ? version_stable : + // v <= 107u ? version_dev : + version_unknown; + } + + unsigned get_version( + quickbook::state& state, bool using_docinfo, value version) + { + unsigned result = 0; + + if (!version.empty()) { + value_consumer version_values(version); + bool before_docinfo = + version_values.optional_consume(doc_info_tags::before_docinfo) + .check(); + int major_verison = version_values.consume().get_int(); + int minor_verison = version_values.consume().get_int(); + version_values.finish(); + + if (before_docinfo || using_docinfo) { + result = + ((unsigned)major_verison * 100) + (unsigned)minor_verison; + + if (classify_version(result) == version_unknown) { + detail::outerr(state.current_file->path) + << "Unknown version: " << major_verison << "." + << minor_verison << std::endl; + ++state.error_count; + } + } + } + + return result; + } + + std::string pre( + quickbook::state& state, + parse_iterator pos, + value include_doc_id, + bool nested_file) + { + // The doc_info in the file has been parsed. Here's what we'll do + // *before* anything else. + // + // If there isn't a doc info block, then values will be empty, so most + // of the following code won't actually do anything. + + value_consumer values = state.values.release(); + + // Skip over invalid attributes + + while (values.check(value::default_tag)) + values.consume(); + + bool use_doc_info = false; + doc_info_values info; + + if (values.check(doc_info_tags::type)) { + info.doc_type = + values.consume(doc_info_tags::type).get_quickbook().to_s(); + info.doc_title = values.consume(doc_info_tags::title); + use_doc_info = !nested_file || qbk_version_n >= 106u; + } + else { + if (!nested_file) { + detail::outerr(state.current_file, pos.base()) + << "No doc_info block." << std::endl; + + ++state.error_count; + + // Create a fake document info block in order to continue. + info.doc_type = "article"; + info.doc_title = qbk_value( + state.current_file, pos.base(), pos.base(), + doc_info_tags::type); + use_doc_info = true; + } + } + + std::vector<std::string> duplicates; + + info.escaped_attributes = + consume_multiple_values(values, doc_info_tags::escaped_attribute); + + info.qbk_version = + consume_list(values, doc_attributes::qbk_version, &duplicates); + info.compatibility_mode = consume_list( + values, doc_attributes::compatibility_mode, &duplicates); + consume_multiple_values(values, doc_attributes::source_mode); + + info.id = + consume_value_in_list(values, doc_info_attributes::id, &duplicates); + info.dirname = consume_value_in_list( + values, doc_info_attributes::dirname, &duplicates); + info.last_revision = consume_value_in_list( + values, doc_info_attributes::last_revision, &duplicates); + info.purpose = consume_value_in_list( + values, doc_info_attributes::purpose, &duplicates); + info.categories = + consume_multiple_values(values, doc_info_attributes::category); + info.lang = consume_value_in_list( + values, doc_info_attributes::lang, &duplicates); + info.version = consume_value_in_list( + values, doc_info_attributes::version, &duplicates); + info.authors = + consume_multiple_values(values, doc_info_attributes::authors); + info.copyrights = + consume_multiple_values(values, doc_info_attributes::copyright); + info.license = consume_value_in_list( + values, doc_info_attributes::license, &duplicates); + info.biblioids = + consume_multiple_values(values, doc_info_attributes::biblioid); + info.xmlbase = consume_value_in_list( + values, doc_info_attributes::xmlbase, &duplicates); + + values.finish(); + + if (!duplicates.empty()) { + detail::outwarn(state.current_file->path) + << (duplicates.size() > 1 ? "Duplicate attributes" + : "Duplicate attribute") + << ":" << boost::algorithm::join(duplicates, ", ") << "\n"; + } + + if (!include_doc_id.empty()) + info.include_doc_id_ = include_doc_id.get_quickbook().to_s(); + if (!info.id.empty()) info.id_ = info.id.get_quickbook().to_s(); + + // Quickbook version + + unsigned new_version = + get_version(state, use_doc_info, info.qbk_version); + + if (new_version != qbk_version_n) { + if (classify_version(new_version) == version_dev) { + detail::outwarn(state.current_file->path) + << "Quickbook " << (new_version / 100) << "." + << (new_version % 100) + << " is still under development and is " + "likely to change in the future." + << std::endl; + } + } + + if (new_version) { + qbk_version_n = new_version; + } + else if (use_doc_info) { + // hard code quickbook version to v1.1 + qbk_version_n = 101; + detail::outwarn(state.current_file, pos.base()) + << "Quickbook version undefined. " + "Version 1.1 is assumed" + << std::endl; + } + + state.current_file->version(qbk_version_n); + + // Compatibility Version + + unsigned compatibility_version = + get_version(state, use_doc_info, info.compatibility_mode); + + if (!compatibility_version) { + compatibility_version = + use_doc_info ? qbk_version_n + : state.document.compatibility_version(); + } + + // Start file, finish here if not generating document info. + + if (!use_doc_info) { + state.document.start_file( + compatibility_version, info.include_doc_id_, info.id_, + info.doc_title); + return ""; + } + + info.id_placeholder = state.document.start_file_with_docinfo( + compatibility_version, info.include_doc_id_, info.id_, + info.doc_title); + + // Make sure we really did have a document info block. + + assert(info.doc_title.check() && !info.doc_type.empty()); + + // Set xmlbase + + // std::string xmlbase_value; + + if (!info.xmlbase.empty()) { + path_parameter x = check_xinclude_path(info.xmlbase, state); + + if (x.type == path_parameter::path) { + quickbook_path path = resolve_xinclude_path(x.value, state); + + if (!fs::is_directory(path.file_path)) { + detail::outerr( + info.xmlbase.get_file(), info.xmlbase.get_position()) + << "xmlbase \"" << info.xmlbase.get_quickbook() + << "\" isn't a directory." << std::endl; + + ++state.error_count; + } + else { + info.xmlbase_value = + dir_path_to_url(path.abstract_file_path); + state.xinclude_base = path.file_path; + } + } + } + + // Warn about invalid fields + + if (info.doc_type != "library") { + std::vector<std::string> invalid_attributes; + + if (!info.purpose.empty()) invalid_attributes.push_back("purpose"); + + if (!info.categories.empty()) + invalid_attributes.push_back("category"); + + if (!info.dirname.empty()) invalid_attributes.push_back("dirname"); + + if (!invalid_attributes.empty()) { + detail::outwarn(state.current_file->path) + << (invalid_attributes.size() > 1 ? "Invalid attributes" + : "Invalid attribute") + << " for '" << info.doc_type << " document info': " + << boost::algorithm::join(invalid_attributes, ", ") << "\n"; + } + } + + return write_boostbook_header(state, info, nested_file); + } + + std::string write_boostbook_header( + quickbook::state& state, doc_info_values const& info, bool nested_file) + { + // Write out header + + if (!nested_file) { + state.out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + << "<!DOCTYPE " << info.doc_type + << " PUBLIC \"-//Boost//DTD BoostBook XML V1.0//EN\"\n" + << " " + "\"http://www.boost.org/tools/boostbook/dtd/" + "boostbook.dtd\">\n"; + } + + state.out << '<' << info.doc_type << "\n" + << " id=\"" << info.id_placeholder << "\"\n"; + + if (!info.lang.empty()) { + state.out << " lang=\"" << doc_info_output(info.lang, 106) + << "\"\n"; + } + + if (info.doc_type == "library" && !info.doc_title.empty()) { + state.out << " name=\"" << doc_info_output(info.doc_title, 106) + << "\"\n"; + } + + // Set defaults for dirname + last_revision + + if (!info.dirname.empty() || info.doc_type == "library") { + state.out << " dirname=\""; + if (!info.dirname.empty()) { + state.out << doc_info_output(info.dirname, 106); + } + else if (!info.id_.empty()) { + state.out << info.id_; + } + else if (!info.include_doc_id_.empty()) { + state.out << info.include_doc_id_; + } + else if (!info.doc_title.empty()) { + state.out << detail::make_identifier( + info.doc_title.get_quickbook()); + } + else { + state.out << "library"; + } + + state.out << "\"\n"; + } + + state.out << " last-revision=\""; + if (!info.last_revision.empty()) { + state.out << doc_info_output(info.last_revision, 106); + } + else { + // default value for last-revision is now + + char strdate[64]; + strftime( + strdate, sizeof(strdate), + (debug_mode ? "DEBUG MODE Date: %Y/%m/%d %H:%M:%S $" + : "$" /* prevent CVS substitution */ + "Date: %Y/%m/%d %H:%M:%S $"), + current_gm_time); + + state.out << strdate; + } + + state.out << "\" \n"; + + if (!info.xmlbase_value.empty()) { + state.out << " xml:base=\"" << info.xmlbase_value << "\"\n"; + } + + state.out << " xmlns:xi=\"http://www.w3.org/2001/XInclude\">\n"; + + std::ostringstream tmp; + + if (!info.authors.empty()) { + tmp << " <authorgroup>\n"; + QUICKBOOK_FOR (value_consumer author_values, info.authors) { + while (author_values.check()) { + value surname = + author_values.consume(doc_info_tags::author_surname); + value first = + author_values.consume(doc_info_tags::author_first); + + tmp << " <author>\n" + << " <firstname>" << doc_info_output(first, 106) + << "</firstname>\n" + << " <surname>" << doc_info_output(surname, 106) + << "</surname>\n" + << " </author>\n"; + } + } + tmp << " </authorgroup>\n"; + } + + QUICKBOOK_FOR (value_consumer copyright, info.copyrights) { + while (copyright.check()) { + tmp << "\n" + << " <copyright>\n"; + + while (copyright.check(doc_info_tags::copyright_year)) { + value year_start_value = copyright.consume(); + int year_start = year_start_value.get_int(); + int year_end = + copyright.check(doc_info_tags::copyright_year_end) + ? copyright.consume().get_int() + : year_start; + + if (year_end < year_start) { + ++state.error_count; + + detail::outerr( + state.current_file, + copyright.begin()->get_position()) + << "Invalid year range: " << year_start << "-" + << year_end << "." << std::endl; + } + + for (; year_start <= year_end; ++year_start) + tmp << " <year>" << year_start << "</year>\n"; + } + + tmp << " <holder>" + << doc_info_output( + copyright.consume(doc_info_tags::copyright_name), + 106) + << "</holder>\n" + << " </copyright>\n" + << "\n"; + } + } + + if (!info.license.empty()) { + tmp << " <legalnotice id=\"" + << state.document.add_id("legal", id_category::generated) + << "\">\n" + << " <para>\n" + << " " << doc_info_output(info.license, 103) << "\n" + << " </para>\n" + << " </legalnotice>\n" + << "\n"; + } + + if (!info.purpose.empty()) { + tmp << " <" << info.doc_type << "purpose>\n" + << " " << doc_info_output(info.purpose, 103) << " </" + << info.doc_type << "purpose>\n" + << "\n"; + } + + QUICKBOOK_FOR (value_consumer category_values, info.categories) { + value category = category_values.optional_consume(); + if (!category.empty()) { + tmp << " <" << info.doc_type << "category name=\"category:" + << doc_info_output(category, 106) << "\"></" + << info.doc_type << "category>\n" + << "\n"; + } + category_values.finish(); + } + + QUICKBOOK_FOR (value_consumer biblioid, info.biblioids) { + value class_ = biblioid.consume(doc_info_tags::biblioid_class); + value value_ = biblioid.consume(doc_info_tags::biblioid_value); + + tmp << " <biblioid class=\"" << class_.get_quickbook() << "\">" + << doc_info_output(value_, 106) << "</biblioid>" + << "\n"; + biblioid.finish(); + } + + QUICKBOOK_FOR (value escaped, info.escaped_attributes) { + tmp << "<!--quickbook-escape-prefix-->" << escaped.get_quickbook() + << "<!--quickbook-escape-postfix-->"; + } + + if (info.doc_type != "library") { + write_document_title(state.out, info.doc_title, info.version); + } + + std::string docinfo = tmp.str(); + if (!docinfo.empty()) { + state.out << " <" << info.doc_type << "info>\n" + << docinfo << " </" << info.doc_type << "info>\n" + << "\n"; + } + + if (info.doc_type == "library") { + write_document_title(state.out, info.doc_title, info.version); + } + + return info.doc_type; + } + + void post(quickbook::state& state, std::string const& doc_type) + { + // We've finished generating our output. Here's what we'll do + // *after* everything else. + + // Close any open sections. + if (!doc_type.empty() && state.document.section_level() > 1) { + if (state.strict_mode) { + detail::outerr(state.current_file->path) + << "Missing [endsect] detected at end of file (strict " + "mode)." + << std::endl; + ++state.error_count; + } + else { + detail::outwarn(state.current_file->path) + << "Missing [endsect] detected at end of file." + << std::endl; + } + + while (state.document.section_level() > 1) { + state.out << "</section>"; + state.document.end_section(); + } + } + + state.document.end_file(); + if (!doc_type.empty()) state.out << "\n</" << doc_type << ">\n\n"; + } + + static void write_document_title( + collector& out, value const& title, value const& version) + { + if (!title.empty()) { + out << " <title>" << doc_info_output(title, 106); + if (!version.empty()) { + out << ' ' << doc_info_output(version, 106); + } + out << "</title>\n\n\n"; + } + } +} diff --git a/src/boost/tools/quickbook/src/doc_info_grammar.cpp b/src/boost/tools/quickbook/src/doc_info_grammar.cpp new file mode 100644 index 000000000..b3ca44aff --- /dev/null +++ b/src/boost/tools/quickbook/src/doc_info_grammar.cpp @@ -0,0 +1,323 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <map> +#include <boost/spirit/include/classic_chset.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_loops.hpp> +#include <boost/spirit/include/classic_numerics.hpp> +#include <boost/spirit/include/classic_symbols.hpp> +#include <boost/spirit/include/phoenix1_operators.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> +#include "actions.hpp" +#include "doc_info_tags.hpp" +#include "for.hpp" +#include "grammar_impl.hpp" +#include "phrase_tags.hpp" +#include "state.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + struct attribute_info + { + attribute_info(value::tag_type t, cl::rule<scanner>* r) + : tag(t), rule(r) + { + } + + value::tag_type tag; + cl::rule<scanner>* rule; + }; + + struct doc_info_grammar_local + { + struct assign_attribute_type + { + assign_attribute_type(doc_info_grammar_local& l_) : l(l_) {} + + void operator()(value::tag_type& t) const + { + l.attribute_rule = *l.attribute_rules[t]; + l.attribute_tag = t; + } + + doc_info_grammar_local& l; + }; + + struct fallback_attribute_type + { + fallback_attribute_type(doc_info_grammar_local& l_) : l(l_) {} + + void operator()(parse_iterator, parse_iterator) const + { + l.attribute_rule = l.doc_fallback; + l.attribute_tag = value::default_tag; + } + + doc_info_grammar_local& l; + }; + + cl::rule<scanner> doc_info_block, doc_attribute, doc_info_attribute, + doc_info_escaped_attributes, doc_title, doc_simple, doc_phrase, + doc_fallback, doc_authors, doc_author, doc_copyright, + doc_copyright_holder, doc_source_mode, doc_biblioid, + doc_compatibility_mode, quickbook_version, macro, char_; + cl::uint_parser<int, 10, 4, 4> doc_copyright_year; + cl::symbols<> doc_types; + cl::symbols<value::tag_type> doc_info_attributes; + cl::symbols<value::tag_type> doc_attributes; + std::map<value::tag_type, cl::rule<scanner>*> attribute_rules; + value::tag_type attribute_tag; + cl::rule<scanner> attribute_rule; + assign_attribute_type assign_attribute; + fallback_attribute_type fallback_attribute; + + doc_info_grammar_local() + : assign_attribute(*this), fallback_attribute(*this) + { + } + + bool source_mode_unset; + }; + + void quickbook_grammar::impl::init_doc_info() + { + doc_info_grammar_local& local = + cleanup_.add(new doc_info_grammar_local); + + typedef cl::uint_parser<int, 10, 1, 2> uint2_t; + + local.doc_types = "book", "article", "library", "chapter", "part", + "appendix", "preface", "qandadiv", "qandaset", "reference", "set"; + + QUICKBOOK_FOR (value::tag_type t, doc_attributes::tags()) { + local.doc_attributes.add(doc_attributes::name(t), t); + local.doc_info_attributes.add(doc_attributes::name(t), t); + } + + QUICKBOOK_FOR (value::tag_type t, doc_info_attributes::tags()) { + local.doc_info_attributes.add(doc_info_attributes::name(t), t); + } + + // Actions + error_action error(state); + plain_char_action plain_char(state); + do_macro_action do_macro(state); + scoped_parser<to_value_scoped_action> to_value(state); + member_action_value<quickbook::state, source_mode_type> + change_source_mode(state, &state::change_source_mode); + member_action_fixed_value<quickbook::state, source_mode_type> + default_source_mode( + state, &state::change_source_mode, source_mode_tags::cpp); + + // clang-format off + + doc_info_details = + cl::eps_p [ph::var(local.source_mode_unset) = true] + >> *( space + >> local.doc_attribute + ) + >> !( space + >> local.doc_info_block + ) + >> *eol + ; + + local.doc_info_block = + '[' + >> space + >> (local.doc_types >> cl::eps_p) + [state.values.entry(ph::arg1, ph::arg2, doc_info_tags::type)] + >> hard_space + >> to_value(doc_info_tags::title) + [ *( ~cl::eps_p(blank >> (cl::ch_p('[') | ']' | cl::eol_p)) + >> local.char_ + ) + // Include 'blank' here so that it will be included in + // id generation. + >> blank + ] + >> space + >> !(qbk_ver(106u) >> cl::eps_p(ph::var(local.source_mode_unset)) + [default_source_mode] + ) + >> ( *( ( local.doc_info_attribute + | local.doc_info_escaped_attributes + ) + >> space + ) + ) [state.values.sort()] + >> ( ']' + >> (eol | cl::end_p) + | cl::eps_p [error] + ) + ; + + local.doc_attribute = + '[' + >> space + >> local.doc_attributes [local.assign_attribute] + >> hard_space + >> state.values.list(ph::var(local.attribute_tag)) + [ cl::eps_p [state.values.entry(ph::arg1, ph::arg2, doc_info_tags::before_docinfo)] + >> local.attribute_rule + ] + >> space + >> ']' + ; + + local.doc_info_attribute = + '[' + >> space + >> ( local.doc_info_attributes + [local.assign_attribute] + | (+(cl::alnum_p | '_' | '-')) + [local.fallback_attribute] + [error("Unrecognized document attribute: '%s'.")] + ) + >> hard_space + >> state.values.list(ph::var(local.attribute_tag)) + [local.attribute_rule] + >> space + >> ']' + ; + + local.doc_fallback = to_value() [ + *(~cl::eps_p(']') >> local.char_) + ]; + + local.doc_info_escaped_attributes = + ("'''" >> !eol) + >> (*(cl::anychar_p - "'''")) [state.values.entry(ph::arg1, ph::arg2, doc_info_tags::escaped_attribute)] + >> ( cl::str_p("'''") + | cl::eps_p [error("Unclosed boostbook escape.")] + ) + ; + + // Document Attributes + + local.quickbook_version = + cl::uint_p [state.values.entry(ph::arg1)] + >> '.' + >> uint2_t() [state.values.entry(ph::arg1)] + ; + + local.attribute_rules[doc_attributes::qbk_version] = &local.quickbook_version; + + local.doc_compatibility_mode = + cl::uint_p [state.values.entry(ph::arg1)] + >> '.' + >> uint2_t() [state.values.entry(ph::arg1)] + ; + + local.attribute_rules[doc_attributes::compatibility_mode] = &local.doc_compatibility_mode; + + local.doc_source_mode = source_modes + [change_source_mode] + [ph::var(local.source_mode_unset) = false] + ; + + local.attribute_rules[doc_attributes::source_mode] = &local.doc_source_mode; + + // Document Info Attributes + + local.doc_simple = to_value() [*(~cl::eps_p(']') >> local.char_)]; + local.attribute_rules[doc_info_attributes::version] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::id] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::dirname] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::category] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::last_revision] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::lang] = &local.doc_simple; + local.attribute_rules[doc_info_attributes::xmlbase] = &local.doc_simple; + + local.doc_copyright_holder + = *( ~cl::eps_p + ( ']' + | ',' >> space >> local.doc_copyright_year + ) + >> local.char_ + ); + + local.doc_copyright = + *( +( local.doc_copyright_year + [state.values.entry(ph::arg1, doc_info_tags::copyright_year)] + >> space + >> !( '-' + >> space + >> local.doc_copyright_year + [state.values.entry(ph::arg1, doc_info_tags::copyright_year_end)] + >> space + ) + >> !cl::ch_p(',') + >> space + ) + >> to_value(doc_info_tags::copyright_name) [ local.doc_copyright_holder ] + >> !cl::ch_p(',') + >> space + ) + ; + + local.attribute_rules[doc_info_attributes::copyright] = &local.doc_copyright; + + local.doc_phrase = to_value() [ nested_phrase ]; + local.attribute_rules[doc_info_attributes::purpose] = &local.doc_phrase; + local.attribute_rules[doc_info_attributes::license] = &local.doc_phrase; + + local.doc_author = + '[' + >> space + >> to_value(doc_info_tags::author_surname) + [*(~cl::eps_p(',') >> local.char_)] + >> ',' >> space + >> to_value(doc_info_tags::author_first) + [*(~cl::eps_p(']') >> local.char_)] + >> ']' + ; + + local.doc_authors = + *( local.doc_author + >> space + >> !(cl::ch_p(',') >> space) + ) + ; + + local.attribute_rules[doc_info_attributes::authors] = &local.doc_authors; + + local.doc_biblioid = + (+cl::alnum_p) [state.values.entry(ph::arg1, ph::arg2, doc_info_tags::biblioid_class)] + >> hard_space + >> to_value(doc_info_tags::biblioid_value) + [+(~cl::eps_p(']') >> local.char_)] + ; + + local.attribute_rules[doc_info_attributes::biblioid] = &local.doc_biblioid; + + local.char_ = + escape + | local.macro + | cl::anychar_p[plain_char]; + ; + + local.macro = + cl::eps_p + ( ( state.macro + >> ~cl::eps_p(cl::alpha_p | '_') + // must not be followed by alpha or underscore + ) + & macro_identifier // must be a valid macro for the current version + ) + >> state.macro [do_macro] + ; + + // clang-format on + } +} diff --git a/src/boost/tools/quickbook/src/doc_info_tags.hpp b/src/boost/tools/quickbook/src/doc_info_tags.hpp new file mode 100644 index 000000000..2f20c4a07 --- /dev/null +++ b/src/boost/tools/quickbook/src/doc_info_tags.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_DOC_INFO_TAGS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_DOC_INFO_TAGS_HPP + +#include "value_tags.hpp" + +namespace quickbook +{ + // clang-format off + + QUICKBOOK_VALUE_TAGS(doc_info_tags, 0x400, + (before_docinfo) + (type) + (title) + (author_surname)(author_first) + (copyright_year)(copyright_year_end)(copyright_name) + (license) + (biblioid_class)(biblioid_value) + (escaped_attribute) + ) + + QUICKBOOK_VALUE_NAMED_TAGS(doc_attributes, 0x440, + ((qbk_version)("quickbook")) + ((compatibility_mode)("compatibility-mode")) + ((source_mode)("source-mode")) + ) + + QUICKBOOK_VALUE_NAMED_TAGS(doc_info_attributes, 0x450, + ((id)("id")) + ((dirname)("dirname")) + ((last_revision)("last-revision")) + ((purpose)("purpose")) + ((category)("category")) + ((lang)("lang")) + ((version)("version")) + ((authors)("authors")) + ((copyright)("copyright")) + ((license)("license")) + ((biblioid)("biblioid")) + ((xmlbase)("xmlbase")) + ) + + // clang-format on +} + +#endif diff --git a/src/boost/tools/quickbook/src/document_state.cpp b/src/boost/tools/quickbook/src/document_state.cpp new file mode 100644 index 000000000..aaf872ec8 --- /dev/null +++ b/src/boost/tools/quickbook/src/document_state.cpp @@ -0,0 +1,500 @@ +/*============================================================================= + Copyright (c) 2011, 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <cctype> +#include <boost/lexical_cast.hpp> +#include <boost/make_shared.hpp> +#include <boost/range/algorithm/count.hpp> +#include "document_state_impl.hpp" +#include "utils.hpp" + +namespace quickbook +{ + struct file_info + { + boost::shared_ptr<file_info> const parent; + boost::shared_ptr<doc_info> const document; + + unsigned const compatibility_version; + unsigned const depth; + unsigned const override_depth; + id_placeholder const* const override_id; + + // The 1.1-1.5 document id would actually change per file due to + // explicit ids in includes and a bug which would sometimes use the + // document title instead of the id. + std::string const doc_id_1_1; + + // Constructor for files that aren't the root of a document. + explicit file_info( + boost::shared_ptr<file_info> const& parent_, + unsigned compatibility_version_, + quickbook::string_view doc_id_1_1_, + id_placeholder const* override_id_) + : parent(parent_) + , document(parent->document) + , compatibility_version(compatibility_version_) + , depth(parent->depth + 1) + , override_depth(override_id_ ? depth : parent->override_depth) + , override_id(override_id_ ? override_id_ : parent->override_id) + , doc_id_1_1(doc_id_1_1_.to_s()) + { + } + + // Constructor for files that are the root of a document. + explicit file_info( + boost::shared_ptr<file_info> const& parent_, + boost::shared_ptr<doc_info> const& document_, + unsigned compatibility_version_, + quickbook::string_view doc_id_1_1_) + : parent(parent_) + , document(document_) + , compatibility_version(compatibility_version_) + , depth(0) + , override_depth(0) + , override_id(0) + , doc_id_1_1(doc_id_1_1_.to_s()) + { + } + }; + + struct doc_info + { + boost::shared_ptr<section_info> current_section; + + // Note: these are mutable to remain bug compatible with old versions + // of quickbook. They would set these values at the start of new files + // and sections and then not restore them at the end. + std::string last_title_1_1; + std::string section_id_1_1; + }; + + struct section_info + { + boost::shared_ptr<section_info> const parent; + unsigned const compatibility_version; + unsigned const file_depth; + unsigned const level; + + value const explicit_id; + std::string const id_1_1; + id_placeholder const* const placeholder_1_6; + source_mode_info const source_mode; + + explicit section_info( + boost::shared_ptr<section_info> const& parent_, + file_info const* current_file_, + value const& explicit_id_, + quickbook::string_view id_1_1_, + id_placeholder const* placeholder_1_6_, + source_mode_info const& source_mode_) + : parent(parent_) + , compatibility_version(current_file_->compatibility_version) + , file_depth(current_file_->depth) + , level(parent ? parent->level + 1 : 1) + , explicit_id(explicit_id_) + , id_1_1(id_1_1_.to_s()) + , placeholder_1_6(placeholder_1_6_) + , source_mode(source_mode_) + { + } + }; + + // + // document_state + // + + document_state::document_state() : state(new document_state_impl) {} + + document_state::~document_state() {} + + void document_state::start_file( + unsigned compatibility_version_, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title_) + { + state->start_file( + compatibility_version_, false, include_doc_id, id, title_); + } + + std::string document_state::start_file_with_docinfo( + unsigned compatibility_version_, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title_) + { + return state + ->start_file( + compatibility_version_, true, include_doc_id, id, title_) + ->to_string(); + } + + void document_state::end_file() { state->end_file(); } + + std::string document_state::begin_section( + value const& explicit_id_, + quickbook::string_view id, + id_category category, + source_mode_info const& source_mode) + { + return state->begin_section(explicit_id_, id, category, source_mode) + ->to_string(); + } + + void document_state::end_section() { return state->end_section(); } + + int document_state::section_level() const + { + return state->current_file->document->current_section->level; + } + + value const& document_state::explicit_id() const + { + return state->current_file->document->current_section->explicit_id; + } + + source_mode_info document_state::section_source_mode() const + { + return state->current_file + ? state->current_file->document->current_section->source_mode + : source_mode_info(); + } + + std::string document_state::old_style_id( + quickbook::string_view id, id_category category) + { + return state->old_style_id(id, category)->to_string(); + } + + std::string document_state::add_id( + quickbook::string_view id, id_category category) + { + return state->add_id(id, category)->to_string(); + } + + std::string document_state::add_anchor( + quickbook::string_view id, id_category category) + { + return state->add_placeholder(id, category)->to_string(); + } + + std::string document_state::replace_placeholders_with_unresolved_ids( + quickbook::string_view xml) const + { + return replace_ids(*state, xml); + } + + std::string document_state::replace_placeholders( + quickbook::string_view xml) const + { + assert(!state->current_file); + std::vector<std::string> ids = generate_ids(*state, xml); + return replace_ids(*state, xml, &ids); + } + + unsigned document_state::compatibility_version() const + { + return state->current_file->compatibility_version; + } + + // + // id_placeholder + // + + id_placeholder::id_placeholder( + std::size_t index_, + quickbook::string_view id_, + id_category category_, + id_placeholder const* parent_) + : index(index_) + , id(id_.begin(), id_.end()) + , unresolved_id(parent_ ? parent_->unresolved_id + '.' + id : id) + , parent(parent_) + , category(category_) + , num_dots( + boost::range::count(id, '.') + + (parent_ ? parent_->num_dots + 1 : 0)) + { + } + + std::string id_placeholder::to_string() const + { + return '$' + boost::lexical_cast<std::string>(index); + } + + // + // document_state_impl + // + + id_placeholder const* document_state_impl::add_placeholder( + quickbook::string_view id, + id_category category, + id_placeholder const* parent) + { + placeholders.push_back( + id_placeholder(placeholders.size(), id, category, parent)); + return &placeholders.back(); + } + + id_placeholder const* document_state_impl::get_placeholder( + quickbook::string_view value) const + { + // If this isn't a placeholder id. + if (value.size() <= 1 || *value.begin() != '$') return 0; + + unsigned index = boost::lexical_cast<unsigned>( + std::string(value.begin() + 1, value.end())); + + return &placeholders.at(index); + } + + id_placeholder const* document_state_impl::get_id_placeholder( + boost::shared_ptr<section_info> const& section) const + { + return !section ? 0 + : section->file_depth < current_file->override_depth + ? current_file->override_id + : section->placeholder_1_6; + } + + id_placeholder const* document_state_impl::start_file( + unsigned compatibility_version, + bool document_root, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title) + { + boost::shared_ptr<file_info> parent = current_file; + assert(parent || document_root); + + boost::shared_ptr<doc_info> document = + document_root ? boost::make_shared<doc_info>() : parent->document; + + // Choose specified id to use. Prefer 'include_doc_id' (the id + // specified in an 'include' element) unless backwards compatibility + // is required. + + quickbook::string_view initial_doc_id; + + if (document_root || compatibility_version >= 106u || + parent->compatibility_version >= 106u) { + initial_doc_id = !include_doc_id.empty() ? include_doc_id : id; + } + else { + initial_doc_id = !id.empty() ? id : include_doc_id; + } + + // Work out this file's doc_id for older versions of quickbook. + // A bug meant that this need to be done per file, not per + // document. + + std::string doc_id_1_1; + + if (document_root || compatibility_version < 106u) { + if (title.check()) + document->last_title_1_1 = title.get_quickbook().to_s(); + + doc_id_1_1 = + !initial_doc_id.empty() + ? initial_doc_id.to_s() + : detail::make_identifier(document->last_title_1_1); + } + else if (parent) { + doc_id_1_1 = parent->doc_id_1_1; + } + + if (document_root) { + // Create new file + + current_file = boost::make_shared<file_info>( + parent, document, compatibility_version, doc_id_1_1); + + // Create a section for the new document. + + source_mode_info default_source_mode; + + if (!initial_doc_id.empty()) { + return create_new_section( + empty_value(), id, id_category::explicit_section_id, + default_source_mode); + } + else if (!title.empty()) { + return create_new_section( + empty_value(), + detail::make_identifier(title.get_quickbook()), + id_category::generated_doc, default_source_mode); + } + else if (compatibility_version >= 106u) { + return create_new_section( + empty_value(), "doc", id_category::numbered, + default_source_mode); + } + else { + return create_new_section( + empty_value(), "", id_category::generated_doc, + default_source_mode); + } + } + else { + // If an id was set for the file, then the file overrides the + // current section's id with this id. + // + // Don't do this for document_root as it will create a section + // for the document. + // + // Don't do this for older versions, as they use a different + // backwards compatible mechanism to handle file ids. + + id_placeholder const* override_id = 0; + + if (!initial_doc_id.empty() && compatibility_version >= 106u) { + boost::shared_ptr<section_info> null_section; + + override_id = add_id_to_section( + initial_doc_id, id_category::explicit_section_id, + null_section); + } + + // Create new file + + current_file = boost::make_shared<file_info>( + parent, compatibility_version, doc_id_1_1, override_id); + + return 0; + } + } + + void document_state_impl::end_file() + { + current_file = current_file->parent; + } + + id_placeholder const* document_state_impl::add_id( + quickbook::string_view id, id_category category) + { + return add_id_to_section( + id, category, current_file->document->current_section); + } + + id_placeholder const* document_state_impl::add_id_to_section( + quickbook::string_view id, + id_category category, + boost::shared_ptr<section_info> const& section) + { + std::string id_part(id.begin(), id.end()); + + // Note: Normalizing id according to file compatibility version, but + // adding to section according to section compatibility version. + + if (current_file->compatibility_version >= 106u && + category.c < id_category::explicit_id) { + id_part = normalize_id(id); + } + + id_placeholder const* placeholder_1_6 = get_id_placeholder(section); + + if (!section || section->compatibility_version >= 106u) { + return add_placeholder(id_part, category, placeholder_1_6); + } + else { + std::string const& qualified_id = section->id_1_1; + + std::string new_id; + if (!placeholder_1_6) new_id = current_file->doc_id_1_1; + if (!new_id.empty() && !qualified_id.empty()) new_id += '.'; + new_id += qualified_id; + if (!new_id.empty() && !id_part.empty()) new_id += '.'; + new_id += id_part; + + return add_placeholder(new_id, category, placeholder_1_6); + } + } + + id_placeholder const* document_state_impl::old_style_id( + quickbook::string_view id, id_category category) + { + return current_file->compatibility_version < 103u + ? add_placeholder( + current_file->document->section_id_1_1 + "." + + id.to_s(), + category) + : add_id(id, category); + } + + id_placeholder const* document_state_impl::begin_section( + value const& explicit_id, + quickbook::string_view id, + id_category category, + source_mode_info const& source_mode) + { + current_file->document->section_id_1_1 = id.to_s(); + return create_new_section(explicit_id, id, category, source_mode); + } + + id_placeholder const* document_state_impl::create_new_section( + value const& explicit_id, + quickbook::string_view id, + id_category category, + source_mode_info const& source_mode) + { + boost::shared_ptr<section_info> parent = + current_file->document->current_section; + + id_placeholder const* p = 0; + id_placeholder const* placeholder_1_6 = 0; + + std::string id_1_1; + + if (parent && current_file->compatibility_version < 106u) { + id_1_1 = parent->id_1_1; + if (!id_1_1.empty() && !id.empty()) id_1_1 += "."; + id_1_1.append(id.begin(), id.end()); + } + + if (current_file->compatibility_version >= 106u) { + p = placeholder_1_6 = add_id_to_section(id, category, parent); + } + else if (current_file->compatibility_version >= 103u) { + placeholder_1_6 = get_id_placeholder(parent); + + std::string new_id; + if (!placeholder_1_6) { + new_id = current_file->doc_id_1_1; + if (!id_1_1.empty()) new_id += '.'; + } + new_id += id_1_1; + + p = add_placeholder(new_id, category, placeholder_1_6); + } + else { + placeholder_1_6 = get_id_placeholder(parent); + + std::string new_id; + if (parent && !placeholder_1_6) + new_id = current_file->doc_id_1_1 + '.'; + + new_id += id.to_s(); + + p = add_placeholder(new_id, category, placeholder_1_6); + } + + current_file->document->current_section = + boost::make_shared<section_info>( + parent, current_file.get(), explicit_id, id_1_1, + placeholder_1_6, source_mode); + + return p; + } + + void document_state_impl::end_section() + { + current_file->document->current_section = + current_file->document->current_section->parent; + } +} diff --git a/src/boost/tools/quickbook/src/document_state.hpp b/src/boost/tools/quickbook/src/document_state.hpp new file mode 100644 index 000000000..a2e056a53 --- /dev/null +++ b/src/boost/tools/quickbook/src/document_state.hpp @@ -0,0 +1,94 @@ +/*============================================================================= + Copyright (c) 2011,2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_DOCUMENT_STATE_HPP) +#define BOOST_QUICKBOOK_DOCUMENT_STATE_HPP + +#include <string> +#include <boost/scoped_ptr.hpp> +#include "string_view.hpp" +#include "syntax_highlight.hpp" +#include "values.hpp" + +namespace quickbook +{ + // id_category + // + // Higher categories get priority over lower ones. + + struct id_category + { + enum categories + { + default_category = 0, + numbered, // Just used to avoid random docbook ids + generated, // Generated ids for other elements. + generated_heading, // Generated ids for headings. + generated_section, // Generated ids for sections. + generated_doc, // Generated ids for document. + explicit_id, // Explicitly given by user + explicit_section_id, + explicit_anchor_id + }; + + id_category() : c(default_category) {} + id_category(categories c_) : c(c_) {} + explicit id_category(int c_) : c(categories(c_)) {} + + bool operator==(id_category rhs) const { return c == rhs.c; } + + categories c; + }; + + struct document_state_impl; + + struct document_state + { + document_state(); + ~document_state(); + + std::string start_file_with_docinfo( + unsigned compatibility_version, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title); + + void start_file( + unsigned compatibility_version, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title); + + void end_file(); + + std::string begin_section( + value const&, + quickbook::string_view, + id_category, + source_mode_info const&); + void end_section(); + int section_level() const; + value const& explicit_id() const; + source_mode_info section_source_mode() const; + + std::string old_style_id(quickbook::string_view, id_category); + std::string add_id(quickbook::string_view, id_category); + std::string add_anchor(quickbook::string_view, id_category); + + std::string replace_placeholders_with_unresolved_ids( + quickbook::string_view) const; + std::string replace_placeholders(quickbook::string_view) const; + + unsigned compatibility_version() const; + + private: + boost::scoped_ptr<document_state_impl> state; + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/document_state_impl.hpp b/src/boost/tools/quickbook/src/document_state_impl.hpp new file mode 100644 index 000000000..e9107d68e --- /dev/null +++ b/src/boost/tools/quickbook/src/document_state_impl.hpp @@ -0,0 +1,156 @@ +/*============================================================================= + Copyright (c) 2011-2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_DOCUMENT_STATE_IMPL_HPP) +#define BOOST_QUICKBOOK_DOCUMENT_STATE_IMPL_HPP + +#include <deque> +#include <string> +#include <vector> +#include <boost/shared_ptr.hpp> +#include "document_state.hpp" +#include "phrase_tags.hpp" +#include "string_view.hpp" +#include "utils.hpp" + +namespace quickbook +{ + // + // id_placeholder + // + // When generating the xml, quickbook can't allocate the identifiers until + // the end, so it stores in the intermedia xml a placeholder string, + // e.g. id="$1". This represents one of these placeholders. + // + + struct id_placeholder + { + std::size_t index; // The index in document_state_impl::placeholders. + // Use for the dollar identifiers in + // intermediate xml. + std::string id; // The node id. + std::string unresolved_id; + // The id that would be generated + // without any duplicate handling. + // Used for generating old style header anchors. + id_placeholder const* parent; + // Placeholder of the parent id. + id_category category; + std::ptrdiff_t num_dots; // Number of dots in the id. + // Normally equal to the section level + // but not when an explicit id contains + // dots. + + id_placeholder( + std::size_t index, + quickbook::string_view id, + id_category category, + id_placeholder const* parent_); + + std::string to_string() const; + }; + + // + // document_state_impl + // + // Contains all the data tracked by document_state. + // + + struct file_info; + struct doc_info; + struct section_info; + + struct document_state_impl + { + boost::shared_ptr<file_info> current_file; + std::deque<id_placeholder> placeholders; + + // Placeholder methods + + id_placeholder const* add_placeholder( + quickbook::string_view, + id_category, + id_placeholder const* parent = 0); + + id_placeholder const* get_placeholder(quickbook::string_view) const; + + id_placeholder const* get_id_placeholder( + boost::shared_ptr<section_info> const& section) const; + + // Events + + id_placeholder const* start_file( + unsigned compatibility_version, + bool document_root, + quickbook::string_view include_doc_id, + quickbook::string_view id, + value const& title); + + void end_file(); + + id_placeholder const* add_id( + quickbook::string_view id, id_category category); + id_placeholder const* old_style_id( + quickbook::string_view id, id_category category); + id_placeholder const* begin_section( + value const& explicit_id, + quickbook::string_view id, + id_category category, + source_mode_info const&); + void end_section(); + + private: + id_placeholder const* add_id_to_section( + quickbook::string_view id, + id_category category, + boost::shared_ptr<section_info> const& section); + id_placeholder const* create_new_section( + value const& explicit_id, + quickbook::string_view id, + id_category category, + source_mode_info const&); + }; + + std::string replace_ids( + document_state_impl const& state, + quickbook::string_view xml, + std::vector<std::string> const* = 0); + std::vector<std::string> generate_ids( + document_state_impl const&, quickbook::string_view); + + std::string normalize_id(quickbook::string_view src_id); + std::string normalize_id(quickbook::string_view src_id, std::size_t); + + // + // Xml subset parser used for finding id values. + // + // I originally tried to integrate this into the post processor + // but that proved tricky. Alternatively it could use a proper + // xml parser, but I want this to be able to survive badly + // marked up escapes. + // + + struct xml_processor + { + xml_processor(); + + std::vector<std::string> id_attributes; + + struct callback + { + virtual void start(quickbook::string_view) {} + virtual void id_value(quickbook::string_view) {} + virtual void finish(quickbook::string_view) {} + virtual ~callback() {} + }; + + void parse(quickbook::string_view, callback&); + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/files.cpp b/src/boost/tools/quickbook/src/files.cpp new file mode 100644 index 000000000..8c2140ac6 --- /dev/null +++ b/src/boost/tools/quickbook/src/files.cpp @@ -0,0 +1,600 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "files.hpp" +#include <fstream> +#include <iterator> +#include <vector> +#include <boost/filesystem/fstream.hpp> +#include <boost/range/algorithm/transform.hpp> +#include <boost/range/algorithm/upper_bound.hpp> +#include <boost/unordered_map.hpp> +#include "for.hpp" + +namespace quickbook +{ + namespace + { + boost::unordered_map<fs::path, file_ptr> files; + } + + // Read the first few bytes in a file to see it starts with a byte order + // mark. If it doesn't, then write the characters we've already read in. + // Although, given how UTF-8 works, if we've read anything in, the files + // probably broken. + + template <typename InputIterator, typename OutputIterator> + bool check_bom( + InputIterator& begin, + InputIterator end, + OutputIterator out, + char const* chars, + int length) + { + char const* ptr = chars; + + while (begin != end && *begin == *ptr) { + ++begin; + ++ptr; + --length; + if (length == 0) return true; + } + + // Failed to match, so write the skipped characters to storage: + while (chars != ptr) + *out++ = *chars++; + + return false; + } + + template <typename InputIterator, typename OutputIterator> + std::string read_bom( + InputIterator& begin, InputIterator end, OutputIterator out) + { + if (begin == end) return ""; + + const char* utf8 = "\xef\xbb\xbf"; + const char* utf32be = "\0\0\xfe\xff"; + const char* utf32le = "\xff\xfe\0\0"; + + unsigned char c = *begin; + switch (c) { + case 0xEF: { // UTF-8 + return check_bom(begin, end, out, utf8, 3) ? "UTF-8" : ""; + } + case 0xFF: // UTF-16/UTF-32 little endian + return !check_bom(begin, end, out, utf32le, 2) + ? "" + : check_bom(begin, end, out, utf32le + 2, 2) ? "UTF-32" + : "UTF-16"; + case 0: // UTF-32 big endian + return check_bom(begin, end, out, utf32be, 4) ? "UTF-32" : ""; + case 0xFE: // UTF-16 big endian + return check_bom(begin, end, out, utf32be + 2, 2) ? "UTF-16" : ""; + default: + return ""; + } + } + + // Copy a string, converting mac and windows style newlines to unix + // newlines. + + template <typename InputIterator, typename OutputIterator> + void normalize(InputIterator begin, InputIterator end, OutputIterator out) + { + std::string encoding = read_bom(begin, end, out); + + if (encoding != "UTF-8" && encoding != "") + throw load_error(encoding + " is not supported. Please use UTF-8."); + + while (begin != end) { + if (*begin == '\r') { + *out++ = '\n'; + ++begin; + if (begin != end && *begin == '\n') ++begin; + } + else { + *out++ = *begin++; + } + } + } + + file_ptr load(fs::path const& filename, unsigned qbk_version) + { + boost::unordered_map<fs::path, file_ptr>::iterator pos = + files.find(filename); + + if (pos == files.end()) { + fs::ifstream in(filename, std::ios_base::in); + + if (!in) throw load_error("Could not open input file."); + + // Turn off white space skipping on the stream + in.unsetf(std::ios::skipws); + + std::string source; + normalize( + std::istream_iterator<char>(in), std::istream_iterator<char>(), + std::back_inserter(source)); + + if (in.bad()) throw load_error("Error reading input file."); + + bool inserted; + + boost::tie(pos, inserted) = files.emplace( + filename, new file(filename, source, qbk_version)); + + assert(inserted); + } + + return pos->second; + } + + std::ostream& operator<<(std::ostream& out, file_position const& x) + { + return out << "line: " << x.line << ", column: " << x.column; + } + + file_position relative_position( + string_iterator begin, string_iterator iterator) + { + file_position pos; + string_iterator line_begin = begin; + + while (begin != iterator) { + if (*begin == '\r') { + ++begin; + ++pos.line; + line_begin = begin; + } + else if (*begin == '\n') { + ++begin; + ++pos.line; + line_begin = begin; + if (begin == iterator) break; + if (*begin == '\r') { + ++begin; + line_begin = begin; + } + } + else { + ++begin; + } + } + + pos.column = iterator - line_begin + 1; + return pos; + } + + file_position file::position_of(string_iterator iterator) const + { + return relative_position(source().begin(), iterator); + } + + // Mapped files. + + struct mapped_file_section + { + enum section_types + { + normal, + empty, + indented + }; + + std::string::size_type original_pos; + std::string::size_type our_pos; + section_types section_type; + + explicit mapped_file_section( + std::string::size_type original_pos_, + std::string::size_type our_pos_, + section_types section_type_ = normal) + : original_pos(original_pos_) + , our_pos(our_pos_) + , section_type(section_type_) + { + } + }; + + struct mapped_section_original_cmp + { + bool operator()( + mapped_file_section const& x, mapped_file_section const& y) + { + return x.original_pos < y.original_pos; + } + + bool operator()( + mapped_file_section const& x, std::string::size_type const& y) + { + return x.original_pos < y; + } + + bool operator()( + std::string::size_type const& x, mapped_file_section const& y) + { + return x < y.original_pos; + } + }; + + struct mapped_section_pos_cmp + { + bool operator()( + mapped_file_section const& x, mapped_file_section const& y) + { + return x.our_pos < y.our_pos; + } + + bool operator()( + mapped_file_section const& x, std::string::size_type const& y) + { + return x.our_pos < y; + } + + bool operator()( + std::string::size_type const& x, mapped_file_section const& y) + { + return x < y.our_pos; + } + }; + + struct mapped_file : file + { + explicit mapped_file(file_ptr original_) + : file(*original_, std::string()) + , original(original_) + , mapped_sections() + { + } + + file_ptr original; + std::vector<mapped_file_section> mapped_sections; + + void add_empty_mapped_file_section(string_iterator pos) + { + std::string::size_type original_pos = + pos - original->source().begin(); + + if (mapped_sections.empty() || + mapped_sections.back().section_type != + mapped_file_section::empty || + mapped_sections.back().original_pos != original_pos) { + mapped_sections.push_back(mapped_file_section( + original_pos, source().size(), mapped_file_section::empty)); + } + } + + void add_mapped_file_section(string_iterator pos) + { + mapped_sections.push_back(mapped_file_section( + pos - original->source().begin(), source().size())); + } + + void add_indented_mapped_file_section(string_iterator pos) + { + mapped_sections.push_back(mapped_file_section( + pos - original->source().begin(), source().size(), + mapped_file_section::indented)); + } + + std::string::size_type to_original_pos( + std::vector<mapped_file_section>::const_iterator section, + std::string::size_type pos) const + { + switch (section->section_type) { + case mapped_file_section::normal: + return pos - section->our_pos + section->original_pos; + + case mapped_file_section::empty: + return section->original_pos; + + case mapped_file_section::indented: { + // Will contain the start of the current line. + quickbook::string_view::size_type our_line = section->our_pos; + + // Will contain the number of lines in the block before + // the current line. + unsigned newline_count = 0; + + for (quickbook::string_view::size_type i = section->our_pos; + i != pos; ++i) { + if (source()[i] == '\n') { + our_line = i + 1; + ++newline_count; + } + } + + // The start of the line in the original source. + quickbook::string_view::size_type original_line = + section->original_pos; + + while (newline_count > 0) { + if (original->source()[original_line] == '\n') + --newline_count; + ++original_line; + } + + // The start of line content (i.e. after indentation). + our_line = skip_indentation(source(), our_line); + + // The position is in the middle of indentation, so + // just return the start of the whitespace, which should + // be good enough. + if (our_line > pos) return original_line; + + original_line = + skip_indentation(original->source(), original_line); + + // Confirm that we are actually in the same position. + assert(original->source()[original_line] == source()[our_line]); + + // Calculate the position + return original_line + (pos - our_line); + } + default: + assert(false); + return section->original_pos; + } + } + + std::vector<mapped_file_section>::const_iterator find_section( + string_iterator pos) const + { + std::vector<mapped_file_section>::const_iterator section = + boost::upper_bound( + mapped_sections, + std::string::size_type(pos - source().begin()), + mapped_section_pos_cmp()); + assert(section != mapped_sections.begin()); + --section; + + return section; + } + + virtual file_position position_of(string_iterator) const; + + private: + static std::string::size_type skip_indentation( + quickbook::string_view src, std::string::size_type i) + { + while (i != src.size() && (src[i] == ' ' || src[i] == '\t')) + ++i; + return i; + } + }; + + namespace + { + std::list<mapped_file> mapped_files; + } + + struct mapped_file_builder_data + { + mapped_file_builder_data() { reset(); } + void reset() { new_file.reset(); } + + boost::intrusive_ptr<mapped_file> new_file; + }; + + mapped_file_builder::mapped_file_builder() : data(0) {} + mapped_file_builder::~mapped_file_builder() { delete data; } + + void mapped_file_builder::start(file_ptr f) + { + if (!data) { + data = new mapped_file_builder_data; + } + + assert(!data->new_file); + data->new_file = new mapped_file(f); + } + + file_ptr mapped_file_builder::release() + { + file_ptr r = data->new_file; + data->reset(); + return r; + } + + void mapped_file_builder::clear() { data->reset(); } + + bool mapped_file_builder::empty() const + { + return data->new_file->source().empty(); + } + + mapped_file_builder::pos_type mapped_file_builder::get_pos() const + { + return data->new_file->source().size(); + } + + void mapped_file_builder::add_at_pos(quickbook::string_view x, iterator pos) + { + data->new_file->add_empty_mapped_file_section(pos); + data->new_file->source_.append(x.begin(), x.end()); + } + + void mapped_file_builder::add(quickbook::string_view x) + { + data->new_file->add_mapped_file_section(x.begin()); + data->new_file->source_.append(x.begin(), x.end()); + } + + void mapped_file_builder::add(mapped_file_builder const& x) + { + add(x, 0, x.data->new_file->source_.size()); + } + + void mapped_file_builder::add( + mapped_file_builder const& x, pos_type begin, pos_type end) + { + assert(data->new_file->original == x.data->new_file->original); + assert(begin <= x.data->new_file->source_.size()); + assert(end <= x.data->new_file->source_.size()); + + if (begin != end) { + std::vector<mapped_file_section>::const_iterator i = + x.data->new_file->find_section( + x.data->new_file->source().begin() + begin); + + std::string::size_type size = data->new_file->source_.size(); + + data->new_file->mapped_sections.push_back(mapped_file_section( + x.data->new_file->to_original_pos(i, begin), size, + i->section_type)); + + for (++i; i != x.data->new_file->mapped_sections.end() && + i->our_pos < end; + ++i) { + data->new_file->mapped_sections.push_back(mapped_file_section( + i->original_pos, i->our_pos - begin + size, + i->section_type)); + } + + data->new_file->source_.append( + x.data->new_file->source_.begin() + begin, + x.data->new_file->source_.begin() + end); + } + } + + quickbook::string_view::size_type indentation_count( + quickbook::string_view x) + { + unsigned count = 0; + + QUICKBOOK_FOR (auto c, x) { + switch (c) { + case ' ': + ++count; + break; + case '\t': + // hardcoded tab to 4 for now + count = count - (count % 4) + 4; + break; + default: + assert(false); + } + } + + return count; + } + + void mapped_file_builder::unindent_and_add(quickbook::string_view x) + { + // I wanted to do everything using a string_ref, but unfortunately + // they don't have all the overloads used in here. So... + std::string const program(x.begin(), x.end()); + + // Erase leading blank lines and newlines: + std::string::size_type text_start = + program.find_first_not_of(" \t\r\n"); + if (text_start == std::string::npos) return; + + text_start = program.find_last_of("\r\n", text_start); + text_start = text_start == std::string::npos ? 0 : text_start + 1; + + assert(text_start < program.size()); + + // Get the first line indentation + std::string::size_type indent = + program.find_first_not_of(" \t", text_start) - text_start; + quickbook::string_view::size_type full_indent = indentation_count( + quickbook::string_view(&program[text_start], indent)); + + std::string::size_type pos = text_start; + + // Calculate the minimum indent from the rest of the lines + // Detecting a mix of spaces and tabs. + while (std::string::npos != + (pos = program.find_first_of("\r\n", pos))) { + pos = program.find_first_not_of("\r\n", pos); + if (std::string::npos == pos) break; + + std::string::size_type n = program.find_first_not_of(" \t", pos); + if (n == std::string::npos) break; + + char ch = program[n]; + if (ch == '\r' || ch == '\n') continue; // ignore empty lines + + indent = (std::min)(indent, n - pos); + full_indent = (std::min)( + full_indent, indentation_count(quickbook::string_view( + &program[pos], n - pos))); + } + + // Detect if indentation is mixed. + bool mixed_indentation = false; + quickbook::string_view first_indent(&program[text_start], indent); + pos = text_start; + + while (std::string::npos != + (pos = program.find_first_of("\r\n", pos))) { + pos = program.find_first_not_of("\r\n", pos); + if (std::string::npos == pos) break; + + std::string::size_type n = program.find_first_not_of(" \t", pos); + if (n == std::string::npos || n - pos < indent) continue; + + if (quickbook::string_view(&program[pos], indent) != first_indent) { + mixed_indentation = true; + break; + } + } + + // Trim white spaces from column 0..indent + std::string unindented_program; + std::string::size_type copy_start = text_start; + pos = text_start; + + do { + if (std::string::npos == + (pos = program.find_first_not_of("\r\n", pos))) + break; + + unindented_program.append( + program.begin() + copy_start, program.begin() + pos); + copy_start = pos; + + // Find the end of the indentation. + std::string::size_type next = program.find_first_not_of(" \t", pos); + if (next == std::string::npos) next = program.size(); + + if (mixed_indentation) { + string_view::size_type length = indentation_count( + quickbook::string_view(&program[pos], next - pos)); + + if (length > full_indent) { + std::string new_indentation(length - full_indent, ' '); + unindented_program.append(new_indentation); + } + + copy_start = next; + } + else { + copy_start = (std::min)(pos + indent, next); + } + + pos = next; + } while (std::string::npos != + (pos = program.find_first_of("\r\n", pos))); + + unindented_program.append(program.begin() + copy_start, program.end()); + + data->new_file->add_indented_mapped_file_section(x.begin()); + data->new_file->source_.append(unindented_program); + } + + file_position mapped_file::position_of(string_iterator pos) const + { + return original->position_of( + original->source().begin() + + to_original_pos(find_section(pos), pos - source().begin())); + } +} diff --git a/src/boost/tools/quickbook/src/files.hpp b/src/boost/tools/quickbook/src/files.hpp new file mode 100644 index 000000000..4ff669dfe --- /dev/null +++ b/src/boost/tools/quickbook/src/files.hpp @@ -0,0 +1,160 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_FILES_HPP) +#define BOOST_QUICKBOOK_FILES_HPP + +#include <cassert> +#include <iosfwd> +#include <stdexcept> +#include <string> +#include <boost/filesystem/path.hpp> +#include <boost/intrusive_ptr.hpp> +#include "string_view.hpp" + +namespace quickbook +{ + + namespace fs = boost::filesystem; + + struct file; + typedef boost::intrusive_ptr<file> file_ptr; + + struct file_position + { + file_position() : line(1), column(1) {} + file_position(std::ptrdiff_t l, std::ptrdiff_t c) : line(l), column(c) + { + } + + std::ptrdiff_t line; + std::ptrdiff_t column; + + bool operator==(file_position const& other) const + { + return line == other.line && column == other.column; + } + + friend std::ostream& operator<<(std::ostream&, file_position const&); + }; + + file_position relative_position( + string_iterator begin, string_iterator iterator); + + struct file + { + private: + // Non copyable + file& operator=(file const&); + file(file const&); + + public: + fs::path const path; + std::string source_; + bool is_code_snippets; + + private: + unsigned qbk_version; + unsigned ref_count; + + public: + quickbook::string_view source() const { return source_; } + + file( + fs::path const& path_, + quickbook::string_view source_view, + unsigned qbk_version_) + : path(path_) + , source_(source_view.begin(), source_view.end()) + , is_code_snippets(false) + , qbk_version(qbk_version_) + , ref_count(0) + { + } + + explicit file(file const& f, quickbook::string_view s) + : path(f.path) + , source_(s.begin(), s.end()) + , is_code_snippets(f.is_code_snippets) + , qbk_version(f.qbk_version) + , ref_count(0) + { + } + + virtual ~file() { assert(!ref_count); } + + unsigned version() const + { + assert(qbk_version); + return qbk_version; + } + + void version(unsigned v) + { + // Check that either version hasn't been set, or it was + // previously set to the same version (because the same + // file has been loaded twice). + assert(!qbk_version || qbk_version == v); + qbk_version = v; + } + + virtual file_position position_of(string_iterator) const; + + friend void intrusive_ptr_add_ref(file* ptr) { ++ptr->ref_count; } + + friend void intrusive_ptr_release(file* ptr) + { + if (--ptr->ref_count == 0) delete ptr; + } + }; + + // If version isn't supplied then it must be set later. + file_ptr load(fs::path const& filename, unsigned qbk_version = 0); + + struct load_error : std::runtime_error + { + explicit load_error(std::string const& arg) : std::runtime_error(arg) {} + }; + + // Interface for creating fake files which are mapped to + // real files, so that the position can be found later. + + struct mapped_file_builder_data; + + struct mapped_file_builder + { + typedef string_iterator iterator; + typedef quickbook::string_view::size_type pos_type; + + mapped_file_builder(); + ~mapped_file_builder(); + + void start(file_ptr); + file_ptr release(); + void clear(); + + bool empty() const; + pos_type get_pos() const; + + void add_at_pos(quickbook::string_view, iterator); + void add(quickbook::string_view); + void add(mapped_file_builder const&); + void add(mapped_file_builder const&, pos_type, pos_type); + void unindent_and_add(quickbook::string_view); + + private: + mapped_file_builder_data* data; + + mapped_file_builder(mapped_file_builder const&); + mapped_file_builder& operator=(mapped_file_builder const&); + }; +} + +#endif // BOOST_QUICKBOOK_FILES_HPP diff --git a/src/boost/tools/quickbook/src/for.hpp b/src/boost/tools/quickbook/src/for.hpp new file mode 100644 index 000000000..dd5a1a8cf --- /dev/null +++ b/src/boost/tools/quickbook/src/for.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Macro for C++11 range based for loop, with BOOST_FOREACH as a fallback. +// Can't use C++11 loop in Visual C++ 10/Visual Studio 2010 or gcc 4.4. +// BOOST_FOREACH was causing warnings in Visual C++ 14.11/Visual Studio 2017 + +#if !defined(BOOST_QUICKBOOK_FOR_HPP) +#define BOOST_QUICKBOOK_FOR_HPP + +#include <boost/config.hpp> + +#if !defined(BOOST_NO_CXX11_RANGE_BASED_FOR) +#define QUICKBOOK_FOR(x, y) for (x : y) +#else +#include <boost/foreach.hpp> +#define QUICKBOOK_FOR(x, y) BOOST_FOREACH (x, y) +#endif + +#endif diff --git a/src/boost/tools/quickbook/src/fwd.hpp b/src/boost/tools/quickbook/src/fwd.hpp new file mode 100644 index 000000000..f079aa5bc --- /dev/null +++ b/src/boost/tools/quickbook/src/fwd.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2010 Daniel James + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_FWD_HPP) +#define BOOST_SPIRIT_FWD_HPP + +#include <boost/intrusive_ptr.hpp> + +namespace quickbook +{ + struct state; + struct quickbook_grammar; + struct collector; + struct document_state; + struct section_info; + struct file; + struct template_symbol; + typedef boost::intrusive_ptr<file> file_ptr; + typedef unsigned source_mode_type; + + inline void ignore_variable(void const*) {} +} + +#endif diff --git a/src/boost/tools/quickbook/src/glob.cpp b/src/boost/tools/quickbook/src/glob.cpp new file mode 100644 index 000000000..224b9ce48 --- /dev/null +++ b/src/boost/tools/quickbook/src/glob.cpp @@ -0,0 +1,349 @@ +/*============================================================================= + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "glob.hpp" +#include <cassert> + +namespace quickbook +{ + typedef string_iterator glob_iterator; + + void check_glob_range(glob_iterator&, glob_iterator); + void check_glob_escape(glob_iterator&, glob_iterator); + + bool match_section( + glob_iterator& pattern_begin, + glob_iterator pattern_end, + glob_iterator& filename_begin, + glob_iterator& filename_end); + bool match_range( + glob_iterator& pattern_begin, glob_iterator pattern_end, char x); + + // Is pattern a glob or a plain file name? + // Throws glob_error if pattern is an invalid glob. + bool check_glob(quickbook::string_view pattern) + { + bool is_glob = false; + bool is_ascii = true; + + glob_iterator begin = pattern.begin(); + glob_iterator end = pattern.end(); + + while (begin != end) { + if (*begin < 32 || (*begin & 0x80)) is_ascii = false; + + switch (*begin) { + case '\\': + check_glob_escape(begin, end); + break; + + case '[': + check_glob_range(begin, end); + is_glob = true; + break; + + case ']': + throw glob_error("uneven square brackets"); + + case '?': + is_glob = true; + ++begin; + break; + + case '*': + is_glob = true; + ++begin; + + if (begin != end && *begin == '*') { + throw glob_error("'**' not supported"); + } + break; + + default: + ++begin; + } + } + + if (is_glob && !is_ascii) + throw glob_error("invalid character, globs are ascii only"); + + return is_glob; + } + + void check_glob_range(glob_iterator& begin, glob_iterator end) + { + assert(begin != end && *begin == '['); + ++begin; + + if (*begin == ']') throw glob_error("empty range"); + + while (begin != end) { + switch (*begin) { + case '\\': + ++begin; + + if (begin == end) { + throw glob_error("trailing escape"); + } + else if (*begin == '\\' || *begin == '/') { + throw glob_error("contains escaped slash"); + } + + ++begin; + break; + case '[': + throw glob_error("nested square brackets"); + case ']': + ++begin; + return; + case '/': + throw glob_error("slash in square brackets"); + default: + ++begin; + } + } + + throw glob_error("uneven square brackets"); + } + + void check_glob_escape(glob_iterator& begin, glob_iterator end) + { + assert(begin != end && *begin == '\\'); + + ++begin; + + if (begin == end) { + throw glob_error("trailing escape"); + } + else if (*begin == '\\' || *begin == '/') { + throw glob_error("contains escaped slash"); + } + + ++begin; + } + + // Does filename match pattern? + // Might throw glob_error if pattern is an invalid glob, + // but should call check_glob first to validate the glob. + bool glob( + quickbook::string_view const& pattern, + quickbook::string_view const& filename) + { + // If there wasn't this special case then '*' would match an + // empty string. + if (filename.empty()) return pattern.empty(); + + glob_iterator pattern_it = pattern.begin(); + glob_iterator pattern_end = pattern.end(); + + glob_iterator filename_it = filename.begin(); + glob_iterator filename_end = filename.end(); + + if (!match_section(pattern_it, pattern_end, filename_it, filename_end)) + return false; + + while (pattern_it != pattern_end) { + assert(*pattern_it == '*'); + ++pattern_it; + + if (pattern_it == pattern_end) return true; + + if (*pattern_it == '*') { + throw glob_error("'**' not supported"); + } + + for (;;) { + if (filename_it == filename_end) return false; + if (match_section( + pattern_it, pattern_end, filename_it, filename_end)) + break; + ++filename_it; + } + } + + return filename_it == filename_end; + } + + bool match_section( + glob_iterator& pattern_begin, + glob_iterator pattern_end, + glob_iterator& filename_begin, + glob_iterator& filename_end) + { + glob_iterator pattern_it = pattern_begin; + glob_iterator filename_it = filename_begin; + + while (pattern_it != pattern_end && *pattern_it != '*') { + if (filename_it == filename_end) return false; + + switch (*pattern_it) { + case '*': + assert(false); + throw new glob_error("Internal error"); + case '[': + if (!match_range(pattern_it, pattern_end, *filename_it)) + return false; + ++filename_it; + break; + case ']': + throw glob_error("uneven square brackets"); + case '?': + ++pattern_it; + ++filename_it; + break; + case '\\': + ++pattern_it; + if (pattern_it == pattern_end) { + throw glob_error("trailing escape"); + } + else if (*pattern_it == '\\' || *pattern_it == '/') { + throw glob_error("contains escaped slash"); + } + BOOST_FALLTHROUGH; + default: + if (*pattern_it != *filename_it) return false; + ++pattern_it; + ++filename_it; + } + } + + if (pattern_it == pattern_end && filename_it != filename_end) + return false; + + pattern_begin = pattern_it; + filename_begin = filename_it; + return true; + } + + bool match_range( + glob_iterator& pattern_begin, glob_iterator pattern_end, char x) + { + assert(pattern_begin != pattern_end && *pattern_begin == '['); + ++pattern_begin; + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + + bool invert_match = false; + bool matched = false; + + if (*pattern_begin == '^') { + invert_match = true; + ++pattern_begin; + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + } + else if (*pattern_begin == ']') { + throw glob_error("empty range"); + } + + // Search for a match + for (;;) { + unsigned char first = *pattern_begin; + ++pattern_begin; + if (first == ']') break; + if (first == '[') { + throw glob_error("nested square brackets"); + } + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + + if (first == '\\') { + first = *pattern_begin; + if (first == '\\' || first == '/') { + throw glob_error("contains escaped slash"); + } + ++pattern_begin; + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + } + else if (first == '/') { + throw glob_error("slash in square brackets"); + } + + if (*pattern_begin != '-') { + matched = matched || (first == x); + } + else { + ++pattern_begin; + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + + unsigned char second = *pattern_begin; + ++pattern_begin; + if (second == ']') { + matched = matched || (first == x) || (x == '-'); + break; + } + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + + if (second == '\\') { + second = *pattern_begin; + if (second == '\\' || second == '/') { + throw glob_error("contains escaped slash"); + } + ++pattern_begin; + if (pattern_begin == pattern_end) { + throw glob_error("uneven square brackets"); + } + } + else if (second == '/') { + throw glob_error("slash in square brackets"); + } + + matched = matched || (first <= x && x <= second); + } + } + + return invert_match != matched; + } + + std::size_t find_glob_char(quickbook::string_view pattern, std::size_t pos) + { + // Weird style is because quickbook::string_view's find_first_of + // doesn't take a position argument. + std::size_t removed = 0; + + for (;;) { + pos = pattern.find_first_of("[]?*\\"); + if (pos == quickbook::string_view::npos) return pos; + if (pattern[pos] != '\\') return pos + removed; + pattern.remove_prefix(pos + 2); + removed += pos + 2; + } + } + + std::string glob_unescape(quickbook::string_view pattern) + { + std::string result; + + for (;;) { + std::size_t pos = pattern.find("\\"); + if (pos == quickbook::string_view::npos) { + result.append(pattern.data(), pattern.size()); + break; + } + + result.append(pattern.data(), pos); + ++pos; + if (pos < pattern.size()) { + result += pattern[pos]; + ++pos; + } + pattern.remove_prefix(pos); + } + + return result; + } +} diff --git a/src/boost/tools/quickbook/src/glob.hpp b/src/boost/tools/quickbook/src/glob.hpp new file mode 100644 index 000000000..5d657c0c7 --- /dev/null +++ b/src/boost/tools/quickbook/src/glob.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_GLOB_HPP) +#define BOOST_QUICKBOOK_GLOB_HPP + +#include <stdexcept> +#include "string_view.hpp" + +namespace quickbook +{ + struct glob_error : std::runtime_error + { + explicit glob_error(char const* error) : std::runtime_error(error) {} + }; + + // Is this path a glob? Throws glob_error if glob is invalid. + bool check_glob(quickbook::string_view); + + // pre: glob is valid (call check_glob first on user data). + bool glob( + quickbook::string_view const& pattern, + quickbook::string_view const& filename); + + std::size_t find_glob_char(quickbook::string_view, std::size_t start = 0); + std::string glob_unescape(quickbook::string_view); +} + +#endif diff --git a/src/boost/tools/quickbook/src/grammar.cpp b/src/boost/tools/quickbook/src/grammar.cpp new file mode 100644 index 000000000..24a3e96ad --- /dev/null +++ b/src/boost/tools/quickbook/src/grammar.cpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2010 Daniel James + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "grammar_impl.hpp" + +namespace quickbook +{ + quickbook_grammar::quickbook_grammar(quickbook::state& s) + : impl_(new impl(s)) + , command_line_macro(impl_->command_line, "command_line_macro") + , inline_phrase(impl_->inline_phrase, "inline_phrase") + , phrase_start(impl_->phrase_start, "phrase") + , block_start(impl_->block_start, "block") + , attribute_template_body( + impl_->attribute_template_body, "attribute_template_body") + , doc_info(impl_->doc_info_details, "doc_info") + { + } + + quickbook_grammar::~quickbook_grammar() {} + + quickbook_grammar::impl::impl(quickbook::state& s) : state(s), cleanup_() + { + init_main(); + init_block_elements(); + init_phrase_elements(); + init_doc_info(); + } +} diff --git a/src/boost/tools/quickbook/src/grammar.hpp b/src/boost/tools/quickbook/src/grammar.hpp new file mode 100644 index 000000000..17fea7d44 --- /dev/null +++ b/src/boost/tools/quickbook/src/grammar.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_GRAMMARS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_GRAMMARS_HPP + +#include <boost/spirit/include/classic_core.hpp> +#include "fwd.hpp" +#include "iterator.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + // The spirit scanner for explicitly instantiating grammars. This is a + // spirit implementation detail, but since classic is no longer under + // development, it won't change. And spirit 2 won't require such a hack. + + typedef cl::scanner< + parse_iterator, + cl::scanner_policies< + cl::iteration_policy, + cl::match_policy, + cl::action_policy> > + scanner; + + template <typename Scanner> + struct Scanner_must_be_the_quickbook_scanner_typedef; + template <> struct Scanner_must_be_the_quickbook_scanner_typedef<scanner> + { + }; + + struct grammar : public cl::grammar<grammar> + { + grammar(cl::rule<scanner> const& start_rule_, char const* /* name */) + : start_rule(start_rule_) + { + } + + template <typename Scanner> + struct definition + : Scanner_must_be_the_quickbook_scanner_typedef<Scanner> + { + definition(grammar const& self) : start_rule(self.start_rule) {} + cl::rule<scanner> const& start() const { return start_rule; } + cl::rule<scanner> const& start_rule; + }; + + cl::rule<scanner> const& start_rule; + }; + + struct quickbook_grammar + { + public: + struct impl; + + private: + boost::scoped_ptr<impl> impl_; + + public: + grammar command_line_macro; + grammar inline_phrase; + grammar phrase_start; + grammar block_start; + grammar attribute_template_body; + grammar doc_info; + + quickbook_grammar(quickbook::state&); + ~quickbook_grammar(); + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/grammar_impl.hpp b/src/boost/tools/quickbook/src/grammar_impl.hpp new file mode 100644 index 000000000..74c50155c --- /dev/null +++ b/src/boost/tools/quickbook/src/grammar_impl.hpp @@ -0,0 +1,168 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2010 Daniel James + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_GRAMMARS_IMPL_HPP) +#define BOOST_SPIRIT_QUICKBOOK_GRAMMARS_IMPL_HPP + +#include <boost/spirit/include/classic_symbols.hpp> +#include "cleanup.hpp" +#include "grammar.hpp" +#include "values.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + // Information about a square bracket element (e.g. [* word]), and + // some other syntactic elements (such as lists and horizontal rules).. + struct element_info + { + // Types of elements. + // + // Used to determine: + // + // - where they can be used. + // - whether they end a paragraph + // - how following newlines are interpreted by the grammar. + // - and possibly other things..... + enum type_enum + { + // Used when there's no element. + nothing = 0, + + // A section tag. These can't be nested. + section_block = 1, + + // Block elements that can be used in conditional phrases and lists, + // but not nested. + conditional_or_block = 2, + + // Block elements that can be nested in other elements. + nested_block = 4, + + // Phrase elements. + phrase = 8, + + // Depending on the context this can be a block or phrase. + // + // Currently this is only used for elements that don't actually + // generate output (e.g. anchors, source mode tags). The main + // reason is so that lists can be preceeded by the element, e.g. + // + // [#anchor] + // * list item. + // + // If the anchor was considered to be a phrase element, then the + // list wouldn't be recognised. + maybe_block = 16 + }; + + // Masks to determine which context elements can be used in (in_*), and + // whether they are consided to be a block element (is_*). + enum context + { + // At the top level we allow everything. + in_top_level = phrase | maybe_block | nested_block | + conditional_or_block | section_block, + + // In conditional phrases and list blocks we everything but section + // elements. + in_conditional = + phrase | maybe_block | nested_block | conditional_or_block, + in_list_block = + phrase | maybe_block | nested_block | conditional_or_block, + + // In nested blocks we allow a more limited range of elements. + in_nested_block = phrase | maybe_block | nested_block, + + // In a phrase we only allow phrase elements, ('maybe_block' + // elements are treated as phrase elements in this context) + in_phrase = phrase | maybe_block, + + // At the start of a block these are all block elements. + is_contextual_block = maybe_block | nested_block | + conditional_or_block | section_block, + + // These are all block elements in all other contexts. + is_block = nested_block | conditional_or_block | section_block + }; + + element_info() : type(nothing), rule(), tag(0) {} + + element_info( + type_enum t, + cl::rule<scanner>* r, + value::tag_type tag_ = value::default_tag, + unsigned int v = 0) + : type(t), rule(r), tag(tag_), qbk_version(v) + { + } + + type_enum type; + cl::rule<scanner>* rule; + value::tag_type tag; + unsigned int qbk_version; + }; + + struct quickbook_grammar::impl + { + quickbook::state& state; + cleanup cleanup_; + + // Main Grammar + cl::rule<scanner> block_start; + cl::rule<scanner> phrase_start; + cl::rule<scanner> nested_phrase; + cl::rule<scanner> inline_phrase; + cl::rule<scanner> paragraph_phrase; + cl::rule<scanner> extended_phrase; + cl::rule<scanner> table_title_phrase; + cl::rule<scanner> inside_preformatted; + cl::rule<scanner> inside_paragraph; + cl::rule<scanner> command_line; + cl::rule<scanner> attribute_template_body; + cl::rule<scanner> attribute_value_1_7; + cl::rule<scanner> escape; + cl::rule<scanner> raw_escape; + cl::rule<scanner> skip_entity; + + // Miscellaneous stuff + cl::rule<scanner> hard_space; // Either non-empty space, or + // empty and not followed by + // alphanumeric/_. Use to match the + // the end of an itendifier. + cl::rule<scanner> space; // Space/tab/newline/comment (possibly empty) + cl::rule<scanner> blank; // Space/tab/comment (possibly empty) + cl::rule<scanner> eol; // blank >> eol + cl::rule<scanner> phrase_end; // End of phrase text, context sensitive + cl::rule<scanner> comment; + cl::rule<scanner> line_comment; + cl::rule<scanner> macro_identifier; + + // Element Symbols + cl::symbols<element_info> elements; + + // Source mode + cl::symbols<source_mode_type> source_modes; + + // Doc Info + cl::rule<scanner> doc_info_details; + + impl(quickbook::state&); + + private: + void init_main(); + void init_block_elements(); + void init_phrase_elements(); + void init_doc_info(); + }; +} + +#endif // BOOST_SPIRIT_QUICKBOOK_GRAMMARS_HPP diff --git a/src/boost/tools/quickbook/src/html_printer.cpp b/src/boost/tools/quickbook/src/html_printer.cpp new file mode 100644 index 000000000..b8ff43db6 --- /dev/null +++ b/src/boost/tools/quickbook/src/html_printer.cpp @@ -0,0 +1,51 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "html_printer.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace detail + { + void open_tag(html_printer& printer, quickbook::string_view name) + { + tag_start(printer, name); + tag_end(printer); + } + + void close_tag(html_printer& printer, quickbook::string_view name) + { + printer.html += "</"; + printer.html.append(name.begin(), name.end()); + printer.html += ">"; + } + + void tag_start(html_printer& printer, quickbook::string_view name) + { + printer.html += "<"; + printer.html.append(name.begin(), name.end()); + } + + void tag_end(html_printer& printer) { printer.html += ">"; } + + void tag_end_self_close(html_printer& printer) { printer.html += "/>"; } + + void tag_attribute( + html_printer& printer, + quickbook::string_view name, + quickbook::string_view value) + { + printer.html += " "; + printer.html.append(name.begin(), name.end()); + printer.html += "=\""; + printer.html.append(encode_string(value)); + printer.html += "\""; + } + } +} diff --git a/src/boost/tools/quickbook/src/html_printer.hpp b/src/boost/tools/quickbook/src/html_printer.hpp new file mode 100644 index 000000000..8cef974b1 --- /dev/null +++ b/src/boost/tools/quickbook/src/html_printer.hpp @@ -0,0 +1,38 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_BOOSTBOOK_HTML_PRINTER_HPP) +#define BOOST_QUICKBOOK_BOOSTBOOK_HTML_PRINTER_HPP + +#include <string> +#include "string_view.hpp" + +namespace quickbook +{ + namespace detail + { + struct html_printer; + + void open_tag(html_printer&, quickbook::string_view name); + void close_tag(html_printer&, quickbook::string_view name); + void tag_attribute( + html_printer&, + quickbook::string_view name, + quickbook::string_view value); + void tag_start(html_printer&, quickbook::string_view name); + void tag_end(html_printer&); + void tag_end_self_close(html_printer&); + + struct html_printer + { + std::string html; + }; + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/id_generation.cpp b/src/boost/tools/quickbook/src/id_generation.cpp new file mode 100644 index 000000000..15c5e397e --- /dev/null +++ b/src/boost/tools/quickbook/src/id_generation.cpp @@ -0,0 +1,376 @@ +/*============================================================================= + Copyright (c) 2011, 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <cctype> +#include <boost/lexical_cast.hpp> +#include <boost/make_shared.hpp> +#include <boost/range/algorithm/sort.hpp> +#include <boost/unordered_map.hpp> +#include "document_state_impl.hpp" +#include "for.hpp" + +namespace quickbook +{ + // + // The maximum size of a generated part of an id. + // + // Not a strict maximum, sometimes broken because the user + // explicitly uses a longer id, or for backwards compatibility. + + static const std::size_t max_size = 32; + + typedef std::vector<id_placeholder const*> placeholder_index; + placeholder_index index_placeholders( + document_state_impl const&, quickbook::string_view); + + void generate_id_block( + placeholder_index::iterator, + placeholder_index::iterator, + std::vector<std::string>& generated_ids); + + std::vector<std::string> generate_ids( + document_state_impl const& state, quickbook::string_view xml) + { + std::vector<std::string> generated_ids(state.placeholders.size()); + + // Get a list of the placeholders in the order that we wish to + // process them. + placeholder_index placeholders = index_placeholders(state, xml); + + typedef std::vector<id_placeholder const*>::iterator iterator; + iterator it = placeholders.begin(), end = placeholders.end(); + + while (it != end) { + // We process all the ids that have the same number of dots + // together. Note that ids with different parents can clash, e.g. + // because of old fashioned id generation or anchors containing + // multiple dots. + // + // So find the group of placeholders with the same number of dots. + iterator group_begin = it, group_end = it; + while (group_end != end && + (*group_end)->num_dots == (*it)->num_dots) + ++group_end; + + generate_id_block(group_begin, group_end, generated_ids); + it = group_end; + } + + return generated_ids; + } + + // + // index_placeholders + // + // Create a sorted index of the placeholders, in order + // to make numbering duplicates easy. A total order. + // + + struct placeholder_compare + { + std::vector<unsigned>& order; + + placeholder_compare(std::vector<unsigned>& order_) : order(order_) {} + + bool operator()(id_placeholder const* x, id_placeholder const* y) const + { + bool x_explicit = x->category.c >= id_category::explicit_id; + bool y_explicit = y->category.c >= id_category::explicit_id; + + return x->num_dots < y->num_dots + ? true + : x->num_dots > y->num_dots + ? false + : x_explicit > y_explicit + ? true + : x_explicit < y_explicit + ? false + : order[x->index] < order[y->index]; + } + }; + + struct get_placeholder_order_callback : xml_processor::callback + { + document_state_impl const& state; + std::vector<unsigned>& order; + unsigned count; + + get_placeholder_order_callback( + document_state_impl const& state_, std::vector<unsigned>& order_) + : state(state_), order(order_), count(0) + { + } + + void id_value(quickbook::string_view value) + { + set_placeholder_order(state.get_placeholder(value)); + } + + void set_placeholder_order(id_placeholder const* p) + { + if (p && !order[p->index]) { + set_placeholder_order(p->parent); + order[p->index] = ++count; + } + } + }; + + placeholder_index index_placeholders( + document_state_impl const& state, quickbook::string_view xml) + { + // The order that the placeholder appear in the xml source. + std::vector<unsigned> order(state.placeholders.size()); + + xml_processor processor; + get_placeholder_order_callback callback(state, order); + processor.parse(xml, callback); + + placeholder_index sorted_placeholders; + sorted_placeholders.reserve(state.placeholders.size()); + QUICKBOOK_FOR (id_placeholder const& p, state.placeholders) + if (order[p.index]) sorted_placeholders.push_back(&p); + boost::sort(sorted_placeholders, placeholder_compare(order)); + + return sorted_placeholders; + } + + // Resolve and generate ids. + + struct generate_id_block_type + { + // The ids which won't require duplicate handling. + typedef boost::unordered_map<std::string, id_placeholder const*> + chosen_id_map; + chosen_id_map chosen_ids; + std::vector<std::string>& generated_ids; + + explicit generate_id_block_type( + std::vector<std::string>& generated_ids_) + : generated_ids(generated_ids_) + { + } + + void generate( + placeholder_index::iterator begin, placeholder_index::iterator end); + + std::string resolve_id(id_placeholder const*); + std::string generate_id(id_placeholder const*, std::string const&); + }; + + void generate_id_block( + placeholder_index::iterator begin, + placeholder_index::iterator end, + std::vector<std::string>& generated_ids) + { + generate_id_block_type impl(generated_ids); + impl.generate(begin, end); + } + + void generate_id_block_type::generate( + placeholder_index::iterator begin, placeholder_index::iterator end) + { + std::vector<std::string> resolved_ids; + + for (placeholder_index::iterator i = begin; i != end; ++i) + resolved_ids.push_back(resolve_id(*i)); + + unsigned index = 0; + for (placeholder_index::iterator i = begin; i != end; ++i, ++index) { + generated_ids[(**i).index] = generate_id(*i, resolved_ids[index]); + } + } + + std::string generate_id_block_type::resolve_id(id_placeholder const* p) + { + std::string id = + p->parent ? generated_ids[p->parent->index] + "." + p->id : p->id; + + if (p->category.c > id_category::numbered) { + // Reserve the id if it isn't already reserved. + chosen_id_map::iterator pos = chosen_ids.emplace(id, p).first; + + // If it was reserved by a placeholder with a lower category, + // then overwrite it. + if (p->category.c > pos->second->category.c) pos->second = p; + } + + return id; + } + + std::string generate_id_block_type::generate_id( + id_placeholder const* p, std::string const& resolved_id) + { + if (p->category.c > id_category::numbered && + chosen_ids.at(resolved_id) == p) { + return resolved_id; + } + + // Split the id into its parent part and child part. + // + // Note: can't just use the placeholder's parent, as the + // placeholder id might contain dots. + std::size_t child_start = resolved_id.rfind('.'); + std::string parent_id, base_id; + + if (child_start == std::string::npos) { + base_id = normalize_id(resolved_id, max_size - 1); + } + else { + parent_id = resolved_id.substr(0, child_start + 1); + base_id = + normalize_id(resolved_id.substr(child_start + 1), max_size - 1); + } + + // Since we're adding digits, don't want an id that ends in + // a digit. + + std::string::size_type length = base_id.size(); + + if (length > 0 && std::isdigit(base_id[length - 1])) { + if (length < max_size - 1) { + base_id += '_'; + ++length; + } + else { + while (length > 0 && std::isdigit(base_id[length - 1])) + --length; + base_id.erase(length); + } + } + + unsigned count = 0; + + for (;;) { + std::string postfix = boost::lexical_cast<std::string>(count++); + + if ((base_id.size() + postfix.size()) > max_size) { + // The id is now too long, so reduce the length and + // start again. + + // Would need a lot of ids to get this far.... + if (length == 0) throw std::runtime_error("Too many ids"); + + // Trim a character. + --length; + + // Trim any trailing digits. + while (length > 0 && std::isdigit(base_id[length - 1])) + --length; + + base_id.erase(length); + count = 0; + } + else { + // Try to reserve this id. + std::string generated_id = parent_id + base_id + postfix; + + if (chosen_ids.emplace(generated_id, p).second) { + return generated_id; + } + } + } + } + + // + // replace_ids + // + // Return a copy of the xml with all the placeholders replaced by + // generated_ids. + // + + struct replace_ids_callback : xml_processor::callback + { + document_state_impl const& state; + std::vector<std::string> const* ids; + string_iterator source_pos; + std::string result; + + replace_ids_callback( + document_state_impl const& state_, + std::vector<std::string> const* ids_) + : state(state_), ids(ids_), source_pos(), result() + { + } + + void start(quickbook::string_view xml) { source_pos = xml.begin(); } + + void id_value(quickbook::string_view value) + { + if (id_placeholder const* p = state.get_placeholder(value)) { + quickbook::string_view id = + ids ? (*ids)[p->index] : p->unresolved_id; + + result.append(source_pos, value.begin()); + result.append(id.begin(), id.end()); + source_pos = value.end(); + } + } + + void finish(quickbook::string_view xml) + { + result.append(source_pos, xml.end()); + source_pos = xml.end(); + } + }; + + std::string replace_ids( + document_state_impl const& state, + quickbook::string_view xml, + std::vector<std::string> const* ids) + { + xml_processor processor; + replace_ids_callback callback(state, ids); + processor.parse(xml, callback); + return callback.result; + } + + // + // normalize_id + // + // Normalizes generated ids. + // + + std::string normalize_id(quickbook::string_view src_id) + { + return normalize_id(src_id, max_size); + } + + std::string normalize_id(quickbook::string_view src_id, std::size_t size) + { + std::string id(src_id.begin(), src_id.end()); + + std::size_t src = 0; + std::size_t dst = 0; + + while (src < id.length() && id[src] == '_') { + ++src; + } + + if (src == id.length()) { + id = "_"; + } + else { + while (src < id.length() && dst < size) { + if (id[src] == '_') { + do { + ++src; + } while (src < id.length() && id[src] == '_'); + + if (src < id.length()) id[dst++] = '_'; + } + else { + id[dst++] = id[src++]; + } + } + + id.erase(dst); + } + + return id; + } +} diff --git a/src/boost/tools/quickbook/src/id_xml.cpp b/src/boost/tools/quickbook/src/id_xml.cpp new file mode 100644 index 000000000..8209f64ea --- /dev/null +++ b/src/boost/tools/quickbook/src/id_xml.cpp @@ -0,0 +1,183 @@ +/*============================================================================= + Copyright (c) 2011-2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/range/algorithm/find.hpp> +#include <boost/range/algorithm/sort.hpp> +#include "document_state_impl.hpp" +#include "simple_parse.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace + { + char const* id_attributes_[] = {"id", "linkend", "linkends", + "arearefs"}; + } + + xml_processor::xml_processor() + { + static std::size_t const n_id_attributes = + sizeof(id_attributes_) / sizeof(char const*); + for (int i = 0; i != n_id_attributes; ++i) { + id_attributes.push_back(id_attributes_[i]); + } + + boost::sort(id_attributes); + } + + void xml_processor::parse(quickbook::string_view source, callback& c) + { + typedef string_iterator iterator; + + c.start(source); + + iterator it = source.begin(), end = source.end(); + + for (;;) { + read_past(it, end, "<"); + if (it == end) break; + + if (read(it, end, "!--quickbook-escape-prefix-->")) { + read_past(it, end, "<!--quickbook-escape-postfix-->"); + continue; + } + + switch (*it) { + case '?': + ++it; + read_past(it, end, "?>"); + break; + + case '!': + if (read(it, end, "!--")) + read_past(it, end, "-->"); + else + read_past(it, end, ">"); + break; + + default: + if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || + *it == '_' || *it == ':') { + read_to_one_of(it, end, " \t\n\r>"); + + for (;;) { + read_some_of(it, end, " \t\n\r"); + iterator name_start = it; + read_to_one_of(it, end, "= \t\n\r>"); + if (it == end || *it == '>') break; + quickbook::string_view name( + name_start, it - name_start); + ++it; + + read_some_of(it, end, "= \t\n\r"); + if (it == end || (*it != '"' && *it != '\'')) break; + + char delim = *it; + ++it; + + iterator value_start = it; + + it = std::find(it, end, delim); + if (it == end) break; + quickbook::string_view value( + value_start, it - value_start); + ++it; + + if (boost::find(id_attributes, name.to_s()) != + id_attributes.end()) { + c.id_value(value); + } + } + } + else { + read_past(it, end, ">"); + } + } + } + + c.finish(source); + } + + namespace detail + { + std::string linkify( + quickbook::string_view source, quickbook::string_view linkend) + { + typedef string_iterator iterator; + + iterator it = source.begin(), end = source.end(); + + bool contains_link = false; + + for (; !contains_link;) { + read_past(it, end, "<"); + if (it == end) break; + + switch (*it) { + case '?': + ++it; + read_past(it, end, "?>"); + break; + + case '!': + if (read(it, end, "!--")) { + read_past(it, end, "-->"); + } + else { + read_past(it, end, ">"); + } + break; + + default: + if ((*it >= 'a' && *it <= 'z') || + (*it >= 'A' && *it <= 'Z') || *it == '_' || + *it == ':') { + iterator tag_name_start = it; + read_to_one_of(it, end, " \t\n\r>"); + quickbook::string_view tag_name( + tag_name_start, it - tag_name_start); + if (tag_name == "link") { + contains_link = true; + } + + for (;;) { + read_to_one_of(it, end, "\"'\n\r>"); + if (it == end || *it == '>') break; + if (*it == '"' || *it == '\'') { + char delim = *it; + ++it; + it = std::find(it, end, delim); + if (it == end) break; + ++it; + } + } + } + else { + read_past(it, end, ">"); + } + } + } + + std::string result; + + if (!contains_link) { + result += "<link linkend=\""; + result.append(linkend.begin(), linkend.end()); + result += "\">"; + result.append(source.begin(), source.end()); + result += "</link>"; + } + else { + result.append(source.begin(), source.end()); + } + + return result; + } + } +} diff --git a/src/boost/tools/quickbook/src/include_paths.cpp b/src/boost/tools/quickbook/src/include_paths.cpp new file mode 100644 index 000000000..00b3dd4c8 --- /dev/null +++ b/src/boost/tools/quickbook/src/include_paths.cpp @@ -0,0 +1,327 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "include_paths.hpp" +#include <cassert> +#include <boost/filesystem.hpp> +#include <boost/range/algorithm/replace.hpp> +#include "for.hpp" +#include "glob.hpp" +#include "path.hpp" +#include "quickbook.hpp" // For the include_path global (yuck) +#include "state.hpp" +#include "stream.hpp" +#include "utils.hpp" + +namespace quickbook +{ + // + // check_path + // + + path_parameter check_path(value const& path, quickbook::state& state) + { + if (qbk_version_n >= 107u) { + std::string path_text = path.get_encoded(); + if (path_text.empty()) { + detail::outerr(path.get_file(), path.get_position()) + << "Empty path argument" + << "std::endl"; + ++state.error_count; + return path_parameter(path_text, path_parameter::invalid); + } + + try { + if (check_glob(path_text)) { + return path_parameter(path_text, path_parameter::glob); + } + else { + return path_parameter( + glob_unescape(path_text), path_parameter::path); + } + } catch (glob_error& e) { + detail::outerr(path.get_file(), path.get_position()) + << "Invalid path (" << e.what() << "): " << path_text + << std::endl; + ++state.error_count; + return path_parameter(path_text, path_parameter::invalid); + } + } + else { + // Paths are encoded for quickbook 1.6+ and also xmlbase + // values (technically xmlbase is a 1.6 feature, but that + // isn't enforced as it's backwards compatible). + // + // Counter-intuitively: encoded == plain text here. + + std::string path_text = qbk_version_n >= 106u || path.is_encoded() + ? path.get_encoded() + : path.get_quickbook().to_s(); + + if (path_text.empty()) { + detail::outerr(path.get_file(), path.get_position()) + << "Empty path argument" << std::endl; + ++state.error_count; + return path_parameter(path_text, path_parameter::invalid); + } + + // Check for windows paths, an error in quickbook 1.6 + // In quickbook 1.7 backslash is used as an escape character + // for glob characters. + if (path_text.find('\\') != std::string::npos) { + quickbook::detail::ostream* err; + + if (qbk_version_n >= 106u) { + err = &detail::outerr(path.get_file(), path.get_position()); + ++state.error_count; + } + else { + err = + &detail::outwarn(path.get_file(), path.get_position()); + } + + *err << "Path isn't portable: '" << path_text << "'" + << std::endl; + + boost::replace(path_text, '\\', '/'); + } + + return path_parameter(path_text, path_parameter::path); + } + } + + path_parameter check_xinclude_path(value const& p, quickbook::state& state) + { + path_parameter parameter = check_path(p, state); + + if (parameter.type == path_parameter::glob) { + detail::outerr(p.get_file(), p.get_position()) + << "Glob used for xml path." << std::endl; + ++state.error_count; + parameter.type = path_parameter::invalid; + } + + return parameter; + } + + // + // Search include path + // + + void include_search_glob( + std::set<quickbook_path>& result, + quickbook_path const& location, + std::string path, + quickbook::state& state) + { + std::size_t glob_pos = find_glob_char(path); + + if (glob_pos == std::string::npos) { + quickbook_path complete_path = location / glob_unescape(path); + + if (fs::exists(complete_path.file_path)) { + state.dependencies.add_glob_match(complete_path.file_path); + result.insert(complete_path); + } + return; + } + + std::size_t prev = path.rfind('/', glob_pos); + std::size_t next = path.find('/', glob_pos); + + std::size_t glob_begin = prev == std::string::npos ? 0 : prev + 1; + std::size_t glob_end = next == std::string::npos ? path.size() : next; + + quickbook_path new_location = location; + + if (prev != std::string::npos) { + new_location /= glob_unescape(path.substr(0, prev)); + } + + if (next != std::string::npos) ++next; + + quickbook::string_view glob( + path.data() + glob_begin, glob_end - glob_begin); + + fs::path base_dir = new_location.file_path.empty() + ? fs::path(".") + : new_location.file_path; + if (!fs::is_directory(base_dir)) return; + + // Walk through the dir for matches. + for (fs::directory_iterator dir_i(base_dir), dir_e; dir_i != dir_e; + ++dir_i) { + fs::path f = dir_i->path().filename(); + std::string generic_path = detail::path_to_generic(f); + + // Skip if the dir item doesn't match. + if (!quickbook::glob(glob, generic_path)) continue; + + // If it's a file we add it to the results. + if (next == std::string::npos) { + if (fs::is_regular_file(dir_i->status())) { + quickbook_path r = new_location / generic_path; + state.dependencies.add_glob_match(r.file_path); + result.insert(r); + } + } + // If it's a matching dir, we recurse looking for more files. + else { + if (!fs::is_regular_file(dir_i->status())) { + include_search_glob( + result, new_location / generic_path, path.substr(next), + state); + } + } + } + } + + std::set<quickbook_path> include_search( + path_parameter const& parameter, + quickbook::state& state, + string_iterator pos) + { + std::set<quickbook_path> result; + + switch (parameter.type) { + case path_parameter::glob: + // If the path has some glob match characters + // we do a discovery of all the matches.. + { + fs::path current = state.current_file->path.parent_path(); + + // Search for the current dir accumulating to the result. + state.dependencies.add_glob(current / parameter.value); + include_search_glob( + result, state.current_path.parent_path(), parameter.value, + state); + + // Search the include path dirs accumulating to the result. + unsigned count = 0; + QUICKBOOK_FOR (fs::path dir, include_path) { + ++count; + state.dependencies.add_glob(dir / parameter.value); + include_search_glob( + result, quickbook_path(dir, count, fs::path()), + parameter.value, state); + } + + // Done. + return result; + } + + case path_parameter::path: { + fs::path path = detail::generic_to_path(parameter.value); + + // If the path is relative, try and resolve it. + if (!path.has_root_directory() && !path.has_root_name()) { + quickbook_path path2 = + state.current_path.parent_path() / parameter.value; + + // See if it can be found locally first. + if (state.dependencies.add_dependency(path2.file_path)) { + result.insert(path2); + return result; + } + + // Search in each of the include path locations. + unsigned count = 0; + QUICKBOOK_FOR (fs::path full, include_path) { + ++count; + full /= path; + + if (state.dependencies.add_dependency(full)) { + result.insert(quickbook_path(full, count, path)); + return result; + } + } + } + else { + if (state.dependencies.add_dependency(path)) { + result.insert(quickbook_path(path, 0, path)); + return result; + } + } + + detail::outerr(state.current_file, pos) + << "Unable to find file: " << parameter.value << std::endl; + ++state.error_count; + + return result; + } + + case path_parameter::invalid: + return result; + + default: + assert(0); + return result; + } + } + + // + // quickbook_path + // + + void swap(quickbook_path& x, quickbook_path& y) + { + boost::swap(x.file_path, y.file_path); + boost::swap(x.include_path_offset, y.include_path_offset); + boost::swap(x.abstract_file_path, y.abstract_file_path); + } + + bool quickbook_path::operator<(quickbook_path const& other) const + { + return abstract_file_path != other.abstract_file_path + ? abstract_file_path < other.abstract_file_path + : include_path_offset != other.include_path_offset + ? include_path_offset < other.include_path_offset + : file_path < other.file_path; + } + + quickbook_path quickbook_path::operator/(quickbook::string_view x) const + { + return quickbook_path(*this) /= x; + } + + quickbook_path& quickbook_path::operator/=(quickbook::string_view x) + { + fs::path x2 = detail::generic_to_path(x); + file_path /= x2; + abstract_file_path /= x2; + return *this; + } + + quickbook_path quickbook_path::parent_path() const + { + return quickbook_path( + file_path.parent_path(), include_path_offset, + abstract_file_path.parent_path()); + } + + quickbook_path resolve_xinclude_path( + std::string const& x, quickbook::state& state, bool is_file) + { + fs::path path = detail::generic_to_path(x); + fs::path full_path = path; + + // If the path is relative + if (!path.has_root_directory()) { + // Resolve the path from the current file + full_path = state.current_file->path.parent_path() / path; + + // Then calculate relative to the current xinclude_base. + path = path_difference(state.xinclude_base, full_path, is_file); + } + + return quickbook_path(full_path, 0, path); + } +} diff --git a/src/boost/tools/quickbook/src/include_paths.hpp b/src/boost/tools/quickbook/src/include_paths.hpp new file mode 100644 index 000000000..a986ed1e2 --- /dev/null +++ b/src/boost/tools/quickbook/src/include_paths.hpp @@ -0,0 +1,82 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_INCLUDE_PATHS_HPP) +#define BOOST_QUICKBOOK_INCLUDE_PATHS_HPP + +// Classes and functions for dealing with the values from include, import and +// xinclude elements. + +#include <set> +#include <string> +#include <boost/filesystem/path.hpp> +#include "fwd.hpp" +#include "values.hpp" + +namespace quickbook +{ + struct path_parameter + { + // Will possibly add 'url' to this list later: + enum path_type + { + invalid, + path, + glob + }; + + std::string value; + path_type type; + + path_parameter(std::string const& value_, path_type type_) + : value(value_), type(type_) + { + } + }; + + path_parameter check_path(value const& path, quickbook::state& state); + path_parameter check_xinclude_path(value const&, quickbook::state&); + + struct quickbook_path + { + quickbook_path(fs::path const& x, unsigned offset, fs::path const& y) + : file_path(x), include_path_offset(offset), abstract_file_path(y) + { + } + + friend void swap(quickbook_path&, quickbook_path&); + + quickbook_path parent_path() const; + + bool operator<(quickbook_path const& other) const; + quickbook_path operator/(quickbook::string_view) const; + quickbook_path& operator/=(quickbook::string_view); + + // The actual location of the file. + fs::path file_path; + + // The member of the include path that this file is relative to. + // (1-indexed, 0 == original quickbook file) + unsigned include_path_offset; + + // A machine independent representation of the file's + // path - not unique per-file + fs::path abstract_file_path; + }; + + std::set<quickbook_path> include_search( + path_parameter const&, quickbook::state& state, string_iterator pos); + + quickbook_path resolve_xinclude_path( + std::string const&, quickbook::state&, bool is_file = false); +} + +#endif diff --git a/src/boost/tools/quickbook/src/iterator.hpp b/src/boost/tools/quickbook/src/iterator.hpp new file mode 100644 index 000000000..9cdeeb7d2 --- /dev/null +++ b/src/boost/tools/quickbook/src/iterator.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2010 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_ITERATOR_HPP) +#define BOOST_SPIRIT_QUICKBOOK_ITERATOR_HPP + +#include <iterator> +#include <boost/iterator/iterator_traits.hpp> +#include <boost/operators.hpp> +#include <boost/range/iterator_range.hpp> +#include "string_view.hpp" + +namespace quickbook +{ + template <typename Iterator> + struct lookback_iterator + : boost::forward_iterator_helper< + lookback_iterator<Iterator>, + typename boost::iterator_value<Iterator>::type, + typename boost::iterator_difference<Iterator>::type, + typename boost::iterator_pointer<Iterator>::type, + typename boost::iterator_reference<Iterator>::type> + { + lookback_iterator() {} + explicit lookback_iterator(Iterator i) : original_(i), base_(i) {} + + friend bool operator==( + lookback_iterator const& x, lookback_iterator const& y) + { + return x.base_ == y.base_; + } + + lookback_iterator& operator++() + { + ++base_; + return *this; + } + + typename boost::iterator_reference<Iterator>::type operator*() const + { + return *base_; + } + + Iterator base() const { return base_; } + + typedef boost::iterator_range<std::reverse_iterator<Iterator> > + lookback_range; + + lookback_range lookback() const + { + return lookback_range(base_, original_); + } + + private: + Iterator original_; + Iterator base_; + }; + + typedef lookback_iterator<string_iterator> parse_iterator; +} + +#endif diff --git a/src/boost/tools/quickbook/src/main_grammar.cpp b/src/boost/tools/quickbook/src/main_grammar.cpp new file mode 100644 index 000000000..6d9368f3d --- /dev/null +++ b/src/boost/tools/quickbook/src/main_grammar.cpp @@ -0,0 +1,1320 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/spirit/include/classic_attribute.hpp> +#include <boost/spirit/include/classic_chset.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_if.hpp> +#include <boost/spirit/include/classic_lazy.hpp> +#include <boost/spirit/include/classic_loops.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> +#include "actions.hpp" +#include "block_tags.hpp" +#include "grammar_impl.hpp" +#include "parsers.hpp" +#include "phrase_tags.hpp" +#include "scoped.hpp" +#include "state.hpp" +#include "stream.hpp" +#include "template_tags.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + struct list_stack_item + { + // Is this the root of the context + // (e.g. top, template, table cell etc.) + enum list_item_type + { + syntactic_list, // In a list marked up '*' or '#' + top_level, // At the top level of a parse + // (might be a template body) + nested_block // Nested in a block element. + } type; + + unsigned int indent; // Indent of list marker + // (or paragraph if not in a list) + unsigned int indent2; // Indent of paragraph + char mark; // List mark, '\0' if not in a list. + + // Example of inside a list: + // + // |indent + // * List item + // |indent2 + + explicit list_stack_item(list_item_type r) + : type(r), indent(0), indent2(0), mark('\0') + { + } + + explicit list_stack_item( + char mark_, unsigned int indent_, unsigned int indent2_) + : type(syntactic_list) + , indent(indent_) + , indent2(indent2_) + , mark(mark_) + { + } + }; + + struct block_types + { + enum values + { + none, + code, + list, + paragraph + }; + }; + + struct main_grammar_local + { + //////////////////////////////////////////////////////////////////////// + // Local actions + + void start_blocks_impl(parse_iterator first, parse_iterator last); + void start_nested_blocks_impl( + parse_iterator first, parse_iterator last); + void end_blocks_impl(parse_iterator first, parse_iterator last); + void check_indentation_impl(parse_iterator first, parse_iterator last); + void check_code_block_impl(parse_iterator first, parse_iterator last); + void plain_block(string_iterator first, string_iterator last); + void list_block( + string_iterator first, + string_iterator mark_pos, + string_iterator last); + void clear_stack(); + + //////////////////////////////////////////////////////////////////////// + // Local members + + cl::rule<scanner> template_phrase, top_level, indent_check, + paragraph_separator, inside_paragraph, code, code_line, blank_line, + hr, inline_code, skip_inline_code, template_, attribute_template, + template_body, code_block, skip_code_block, macro, template_args, + template_args_1_4, template_arg_1_4, template_inner_arg_1_4, + brackets_1_4, template_args_1_5, template_arg_1_5, + template_arg_1_5_content, template_inner_arg_1_5, brackets_1_5, + template_args_1_6, template_arg_1_6, template_arg_1_6_content, + break_, command_line_macro_identifier, dummy_block, + line_dummy_block, square_brackets, error_brackets, skip_escape; + + struct block_context_closure + : cl::closure<block_context_closure, element_info::context> + { + // Mask used to determine whether or not an element is a block + // element. + member1 is_block_mask; + }; + + cl::rule<scanner> simple_markup, simple_markup_end; + + cl::rule<scanner> paragraph; + cl::rule<scanner> list; + cl::rule<scanner, block_context_closure::context_t> + syntactic_block_item; + cl::rule<scanner> common; + cl::rule<scanner> element; + + // state + std::stack<list_stack_item> list_stack; + unsigned int list_indent; + bool no_eols; + element_info::context context; + char mark; // Simple markup's deliminator + bool still_in_block; // Inside a syntatic block + + // transitory state + block_types::values block_type; + element_info info; + element_info::type_enum element_type; + + // state + quickbook::state& state_; + + //////////////////////////////////////////////////////////////////////// + // Local constructor + + main_grammar_local(quickbook::state& state) + : list_stack() + , list_indent(0) + , no_eols(true) + , context(element_info::in_top_level) + , mark('\0') + , state_(state) + { + } + }; + + struct process_element_impl : scoped_action_base + { + process_element_impl(main_grammar_local& l_) + : l(l_), pushed_source_mode_(false), element_context_error_(false) + { + } + + bool start() + { + // This element doesn't exist in the current language version. + if (qbk_version_n < l.info.qbk_version) return false; + + // The element is not allowed in this context. + if (!(l.info.type & l.context)) { + if (qbk_version_n < 107u) { + return false; + } + else { + element_context_error_ = true; + } + } + + info_ = l.info; + + if (info_.type != element_info::phrase && + info_.type != element_info::maybe_block) { + paragraph_action para(l.state_); + para(); + } + + assert(l.state_.values.builder.empty()); + + if (l.state_.source_mode_next && + info_.type != element_info::maybe_block) { + l.state_.push_tagged_source_mode(l.state_.source_mode_next); + pushed_source_mode_ = true; + l.state_.source_mode_next = 0; + } + + return true; + } + + template <typename ResultT, typename ScannerT> + bool result(ResultT r, ScannerT const& scan) + { + if (element_context_error_) { + error_message_action error( + l.state_, "Element not allowed in this context."); + error(scan.first, scan.first); + return true; + } + else if (r) { + return true; + } + else if ( + qbk_version_n < 107u && info_.type & element_info::in_phrase) { + // Old versions of quickbook had a soft fail + // for unparsed phrase elements. + return false; + } + else { + // Parse error in body. + error_action error(l.state_); + error(scan.first, scan.first); + return true; + } + } + + void success(parse_iterator, parse_iterator) + { + l.element_type = info_.type; + } + void failure() { l.element_type = element_info::nothing; } + + void cleanup() + { + if (pushed_source_mode_) l.state_.pop_tagged_source_mode(); + } + + main_grammar_local& l; + element_info info_; + bool pushed_source_mode_; + bool element_context_error_; + }; + + struct scoped_paragraph : scoped_action_base + { + scoped_paragraph(quickbook::state& state_) + : state(state_), pushed(false) + { + } + + bool start() + { + state.push_tagged_source_mode(state.source_mode_next); + pushed = true; + state.source_mode_next = 0; + return true; + } + + void cleanup() + { + if (pushed) state.pop_tagged_source_mode(); + } + + quickbook::state& state; + bool pushed; + }; + + struct in_list_impl + { + main_grammar_local& l; + + explicit in_list_impl(main_grammar_local& l_) : l(l_) {} + + bool operator()() const + { + return !l.list_stack.empty() && + l.list_stack.top().type == list_stack_item::syntactic_list; + } + }; + + template <typename T, typename M> + struct set_scoped_value_impl : scoped_action_base + { + typedef M T::*member_ptr; + + explicit set_scoped_value_impl(T& l_, member_ptr ptr_) + : l(l_), ptr(ptr_), saved_value() + { + } + + bool start(M const& value) + { + saved_value = l.*ptr; + l.*ptr = value; + + return true; + } + + void cleanup() { l.*ptr = saved_value; } + + T& l; + member_ptr ptr; + M saved_value; + }; + + template <typename T, typename M> + struct set_scoped_value : scoped_parser<set_scoped_value_impl<T, M> > + { + typedef set_scoped_value_impl<T, M> impl; + + set_scoped_value(T& l, typename impl::member_ptr ptr) + : scoped_parser<impl>(impl(l, ptr)) + { + } + }; + + //////////////////////////////////////////////////////////////////////////// + // Local grammar + + void quickbook_grammar::impl::init_main() + { + main_grammar_local& local = cleanup_.add(new main_grammar_local(state)); + + // Global Actions + quickbook::element_action element_action(state); + quickbook::paragraph_action paragraph_action(state); + + phrase_end_action end_phrase(state); + raw_char_action raw_char(state); + plain_char_action plain_char(state); + escape_unicode_action escape_unicode(state); + + simple_phrase_action simple_markup(state); + + break_action break_(state); + do_macro_action do_macro(state); + + error_action error(state); + element_id_warning_action element_id_warning(state); + + scoped_parser<to_value_scoped_action> to_value(state); + scoped_parser<scoped_paragraph> scope_paragraph(state); + + quickbook_strict strict_mode(state); + + // Local Actions + scoped_parser<process_element_impl> process_element(local); + in_list_impl in_list(local); + + set_scoped_value<main_grammar_local, bool> scoped_no_eols( + local, &main_grammar_local::no_eols); + set_scoped_value<main_grammar_local, element_info::context> + scoped_context(local, &main_grammar_local::context); + set_scoped_value<main_grammar_local, bool> scoped_still_in_block( + local, &main_grammar_local::still_in_block); + + member_action<main_grammar_local> check_indentation( + local, &main_grammar_local::check_indentation_impl); + member_action<main_grammar_local> check_code_block( + local, &main_grammar_local::check_code_block_impl); + member_action<main_grammar_local> start_blocks( + local, &main_grammar_local::start_blocks_impl); + member_action<main_grammar_local> start_nested_blocks( + local, &main_grammar_local::start_nested_blocks_impl); + member_action<main_grammar_local> end_blocks( + local, &main_grammar_local::end_blocks_impl); + + // clang-format off + + // phrase/phrase_start is used for an entirely self-contained + // phrase. For example, any remaining anchors are written out + // at the end instead of being saved for any following content. + phrase_start = + inline_phrase [end_phrase] + ; + + // nested_phrase is used for a phrase nested inside square + // brackets. + nested_phrase = + state.values.save() + [ + scoped_context(element_info::in_phrase) + [*(~cl::eps_p(']') >> local.common)] + ] + ; + + // paragraph_phrase is like a nested_phrase but is also terminated + // by a paragraph end. + paragraph_phrase = + state.values.save() + [ + scoped_context(element_info::in_phrase) + [*(~cl::eps_p(phrase_end) >> local.common)] + ] + ; + + // extended_phrase is like a paragraph_phrase but allows some block + // elements. + extended_phrase = + state.values.save() + [ + scoped_context(element_info::in_conditional) + [*(~cl::eps_p(phrase_end) >> local.common)] + ] + ; + + // inline_phrase is used a phrase that isn't nested inside + // brackets, but is not self contained. An example of this + // is expanding a template, which is parsed separately but + // is part of the paragraph that contains it. + inline_phrase = + state.values.save() + [ qbk_ver(107u) + >> local.template_phrase + | qbk_ver(0, 107u) + >> scoped_context(element_info::in_phrase) + [*local.common] + ] + ; + + table_title_phrase = + state.values.save() + [ + scoped_context(element_info::in_phrase) + [ *( ~cl::eps_p(space >> (']' | '[' >> space >> '[')) + >> local.common + ) + ] + ] + ; + + inside_preformatted = + scoped_no_eols(false) + [ paragraph_phrase + ] + ; + + // Phrase templates can contain block tags, but can't contain + // syntatic blocks. + local.template_phrase = + scoped_context(element_info::in_top_level) + [ *( (local.paragraph_separator >> space >> cl::anychar_p) + [error("Paragraph in phrase template.")] + | local.common + ) + ] + ; + + // Top level blocks + block_start = + (*eol) [start_blocks] + >> ( *( local.top_level + >> !( qbk_ver(106u) + >> cl::ch_p(']') + >> cl::eps_p [error("Mismatched close bracket")] + ) + ) + ) [end_blocks] + ; + + // Blocks contains within an element, e.g. a table cell or a footnote. + inside_paragraph = + state.values.save() + [ cl::eps_p [start_nested_blocks] + >> ( qbk_ver(107u) + >> (*eol) + >> (*local.top_level) + | qbk_ver(0, 107u) + >> local.inside_paragraph + ) [end_blocks] + ] + ; + + local.top_level = + cl::eps_p(local.indent_check) + >> ( cl::eps_p(ph::var(local.block_type) == block_types::code) + >> local.code + | cl::eps_p(ph::var(local.block_type) == block_types::list) + >> local.list + | cl::eps_p(ph::var(local.block_type) == block_types::paragraph) + >> ( local.hr + | local.paragraph + ) + ) + >> *eol + ; + + local.indent_check = + ( *cl::blank_p + >> !( (cl::ch_p('*') | '#') + >> *cl::blank_p) + ) [check_indentation] + ; + + local.paragraph = + // Usually superfluous call + // for paragraphs in lists. + cl::eps_p [paragraph_action] + >> scope_paragraph() + [ + scoped_context(element_info::in_top_level) + [ scoped_still_in_block(true) + [ local.syntactic_block_item(element_info::is_contextual_block) + >> *( cl::eps_p(ph::var(local.still_in_block)) + >> local.syntactic_block_item(element_info::is_block) + ) + ] + ] + ] [paragraph_action] + ; + + local.list = + *cl::blank_p + >> (cl::ch_p('*') | '#') + >> (*cl::blank_p) + >> scoped_context(element_info::in_list_block) + [ scoped_still_in_block(true) + [ *( cl::eps_p(ph::var(local.still_in_block)) + >> local.syntactic_block_item(element_info::is_block) + ) + ] + ] + ; + + local.syntactic_block_item = + local.paragraph_separator [ph::var(local.still_in_block) = false] + | (cl::eps_p(~cl::ch_p(']')) | qbk_ver(0, 107u)) + [ph::var(local.element_type) = element_info::nothing] + >> local.common + + // If the element is a block, then a newline will end the + // current syntactic block. + // + // Note that we don't do this for lists in 1.6, as it causes + // the list block to end. The support for nested syntactic + // blocks in 1.7 will fix that. Although it does mean the + // following line will need to be indented. + >> !( cl::eps_p(in_list) >> qbk_ver(106u, 107u) + | cl::eps_p + ( + ph::static_cast_<int>(local.syntactic_block_item.is_block_mask) & + ph::static_cast_<int>(ph::var(local.element_type)) + ) + >> eol [ph::var(local.still_in_block) = false] + ) + ; + + local.paragraph_separator = + cl::eol_p + >> cl::eps_p + ( *cl::blank_p + >> ( cl::eol_p + | cl::end_p + | cl::eps_p(in_list) >> (cl::ch_p('*') | '#') + ) + ) + >> *eol + ; + + // Blocks contains within an element, e.g. a table cell or a footnote. + local.inside_paragraph = + scoped_context(element_info::in_nested_block) + [ *( local.paragraph_separator [paragraph_action] + | ~cl::eps_p(']') + >> local.common + ) + ] [paragraph_action] + ; + + local.hr = + cl::str_p("----") + >> state.values.list(block_tags::hr) + [ ( qbk_ver(106u) + >> *(line_comment | (cl::anychar_p - (cl::eol_p | '[' | ']'))) + | qbk_ver(0, 106u) + >> *(line_comment | (cl::anychar_p - (cl::eol_p | "[/"))) + ) + >> *eol + ] [element_action] + ; + + local.element + = '[' + >> ( cl::eps_p(cl::punct_p) + >> elements [ph::var(local.info) = ph::arg1] + | elements [ph::var(local.info) = ph::arg1] + >> (cl::eps_p - (cl::alnum_p | '_')) + ) + >> process_element() + [ state.values.list(ph::var(local.info.tag)) + [ cl::lazy_p(*ph::var(local.info.rule)) + >> space + >> ']' + ] [element_action] + ] + ; + + local.code = + state.values.list(code_tags::code_block) + [( local.code_line + >> *(*local.blank_line >> local.code_line) + ) [state.values.entry(ph::arg1, ph::arg2)] + ] [element_action] + >> *eol + ; + + local.code_line = + ( *cl::blank_p + >> ~cl::eps_p(cl::eol_p) + ) [check_code_block] + >> cl::eps_p(ph::var(local.block_type) == block_types::code) + >> *(cl::anychar_p - cl::eol_p) + >> (cl::eol_p | cl::end_p) + ; + + local.blank_line = + *cl::blank_p >> cl::eol_p + ; + + local.common = + local.macro + | local.element + | local.template_ + | local.break_ + | local.code_block + | local.inline_code + | local.simple_markup + | escape + | comment + | strict_mode + >> ( local.error_brackets [error("Invalid template/tag (strict mode)")] + | cl::eps_p('[') [error("Mismatched open bracket (strict mode)")] + >> cl::anychar_p + | cl::eps_p(']') [error("Mismatched close bracket (strict mode)")] + >> cl::anychar_p + ) + | qbk_ver(106u) + >> local.square_brackets + | cl::space_p [raw_char] + | cl::anychar_p [plain_char] + ; + + skip_entity = + '[' + // For escaped templates: + >> !(space >> cl::ch_p('`') >> (cl::alpha_p | '_')) + >> *(~cl::eps_p(']') >> skip_entity) + >> !cl::ch_p(']') + | local.skip_code_block + | local.skip_inline_code + | local.skip_escape + | comment + | (cl::anychar_p - '[' - ']') + ; + + local.square_brackets = + ( cl::ch_p('[') [plain_char] + >> paragraph_phrase + >> ( cl::ch_p(']') [plain_char] + | cl::eps_p [error("Missing close bracket")] + ) + | cl::ch_p(']') [plain_char] + >> cl::eps_p [error("Mismatched close bracket")] + ) + ; + + local.error_brackets = + cl::ch_p('[') [plain_char] + >> ( local.error_brackets + | (cl::anychar_p - ']') + ) + >> cl::ch_p(']') + ; + + local.macro = + cl::eps_p + ( ( state.macro + >> ~cl::eps_p(cl::alpha_p | '_') + // must not be followed by alpha or underscore + ) + & macro_identifier // must be a valid macro for the current version + ) + >> state.macro [do_macro] + ; + + local.template_ = + ( '[' + >> space + >> state.values.list(template_tags::template_) + [ local.template_body + >> ']' + ] + ) [element_action] + ; + + local.attribute_template = + ( '[' + >> space + >> state.values.list(template_tags::attribute_template) + [ local.template_body + >> ']' + ] + ) [element_action] + ; + + local.template_body = + ( cl::str_p('`') + >> cl::eps_p(cl::punct_p) + >> state.templates.scope + [state.values.entry(ph::arg1, ph::arg2, template_tags::escape)] + [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)] + >> !( qbk_ver(106u) + [error("Templates with punctuation names can't be escaped in quickbook 1.6+")] + | strict_mode + [error("Templates with punctuation names can't be escaped (strict mode)")] + ) + | cl::str_p('`') + >> state.templates.scope + [state.values.entry(ph::arg1, ph::arg2, template_tags::escape)] + [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)] + + | cl::eps_p(cl::punct_p) + >> state.templates.scope + [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)] + + | state.templates.scope + [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)] + >> cl::eps_p(hard_space) + ) + >> space + >> !local.template_args + ; + + local.template_args = + qbk_ver(106u) >> local.template_args_1_6 + | qbk_ver(105u, 106u) >> local.template_args_1_5 + | qbk_ver(0, 105u) >> local.template_args_1_4 + ; + + local.template_args_1_4 = local.template_arg_1_4 >> *(".." >> local.template_arg_1_4); + + local.template_arg_1_4 = + ( cl::eps_p(*cl::blank_p >> cl::eol_p) + >> local.template_inner_arg_1_4 [state.values.entry(ph::arg1, ph::arg2, template_tags::block)] + | local.template_inner_arg_1_4 [state.values.entry(ph::arg1, ph::arg2, template_tags::phrase)] + ) + ; + + local.template_inner_arg_1_4 = + +(local.brackets_1_4 | (cl::anychar_p - (cl::str_p("..") | ']'))) + ; + + local.brackets_1_4 = + '[' >> local.template_inner_arg_1_4 >> ']' + ; + + local.template_args_1_5 = local.template_arg_1_5 >> *(".." >> local.template_arg_1_5); + + local.template_arg_1_5 = + ( cl::eps_p(*cl::blank_p >> cl::eol_p) + >> local.template_arg_1_5_content [state.values.entry(ph::arg1, ph::arg2, template_tags::block)] + | local.template_arg_1_5_content [state.values.entry(ph::arg1, ph::arg2, template_tags::phrase)] + ) + ; + + local.template_arg_1_5_content = + +(local.brackets_1_5 | ('\\' >> cl::anychar_p) | (cl::anychar_p - (cl::str_p("..") | '[' | ']'))) + ; + + local.template_inner_arg_1_5 = + +(local.brackets_1_5 | ('\\' >> cl::anychar_p) | (cl::anychar_p - (cl::str_p('[') | ']'))) + ; + + local.brackets_1_5 = + '[' >> local.template_inner_arg_1_5 >> ']' + ; + + local.template_args_1_6 = local.template_arg_1_6 >> *(".." >> local.template_arg_1_6); + + local.template_arg_1_6 = + ( cl::eps_p(*cl::blank_p >> cl::eol_p) + >> local.template_arg_1_6_content [state.values.entry(ph::arg1, ph::arg2, template_tags::block)] + | local.template_arg_1_6_content [state.values.entry(ph::arg1, ph::arg2, template_tags::phrase)] + ) + ; + + local.template_arg_1_6_content = + + ( ~cl::eps_p("..") >> skip_entity ) + ; + + local.break_ + = ( '[' + >> space + >> "br" + >> space + >> ']' + ) [break_] + ; + + local.inline_code = + '`' >> state.values.list(code_tags::inline_code) + [( + *(cl::anychar_p - + ( '`' + | (cl::eol_p >> *cl::blank_p >> cl::eol_p) + // Make sure that we don't go + ) // past a single block + ) >> cl::eps_p('`') + ) [state.values.entry(ph::arg1, ph::arg2)] + >> '`' + ] [element_action] + ; + + local.skip_inline_code = + '`' + >> *(cl::anychar_p - + ( '`' + | (cl::eol_p >> *cl::blank_p >> cl::eol_p) + // Make sure that we don't go + ) // past a single block + ) + >> !cl::ch_p('`') + ; + + local.skip_code_block = + "```" + >> ~cl::eps_p("`") + >> ( (!( *(*cl::blank_p >> cl::eol_p) + >> ( *( "````" >> *cl::ch_p('`') + | ( cl::anychar_p + - (*cl::space_p >> "```" >> ~cl::eps_p("`")) + ) + ) + >> !(*cl::blank_p >> cl::eol_p) + ) + >> (*cl::space_p >> "```") + )) + | *cl::anychar_p + ) + | "``" + >> ~cl::eps_p("`") + >> ( ( *(*cl::blank_p >> cl::eol_p) + >> ( *( "```" >> *cl::ch_p('`') + | ( cl::anychar_p + - (*cl::space_p >> "``" >> ~cl::eps_p("`")) + ) + ) + >> !(*cl::blank_p >> cl::eol_p) + ) + >> (*cl::space_p >> "``") + ) + | *cl::anychar_p + ) + ; + + local.code_block = + "```" + >> ~cl::eps_p("`") + >> ( state.values.list(code_tags::inline_code_block) + [ *(*cl::blank_p >> cl::eol_p) + >> ( *( "````" >> *cl::ch_p('`') + | ( cl::anychar_p + - (*cl::space_p >> "```" >> ~cl::eps_p("`")) + ) + ) + >> !(*cl::blank_p >> cl::eol_p) + ) [state.values.entry(ph::arg1, ph::arg2)] + >> (*cl::space_p >> "```") + ] [element_action] + | cl::eps_p [error("Unfinished code block")] + >> *cl::anychar_p + ) + | "``" + >> ~cl::eps_p("`") + >> ( state.values.list(code_tags::inline_code_block) + [ *(*cl::blank_p >> cl::eol_p) + >> ( *( "```" >> *cl::ch_p('`') + | ( cl::anychar_p + - (*cl::space_p >> "``" >> ~cl::eps_p("`")) + ) + ) + >> !(*cl::blank_p >> cl::eol_p) + ) [state.values.entry(ph::arg1, ph::arg2)] + >> (*cl::space_p >> "``") + ] [element_action] + | cl::eps_p [error("Unfinished code block")] + >> *cl::anychar_p + ) + ; + + local.simple_markup = + cl::chset<>("*/_=") [ph::var(local.mark) = ph::arg1] + >> cl::eps_p(cl::graph_p) // graph_p must follow first mark + >> lookback + [ cl::anychar_p // skip back over the markup + >> ~cl::eps_p(cl::ch_p(boost::ref(local.mark))) + // first mark not be preceeded by + // the same character. + >> (cl::space_p | cl::punct_p | cl::end_p) + // first mark must be preceeded + // by space or punctuation or the + // mark character or a the start. + ] + >> state.values.save() + [ + to_value() + [ + cl::eps_p((state.macro & macro_identifier) >> local.simple_markup_end) + >> state.macro [do_macro] + | ~cl::eps_p(cl::ch_p(boost::ref(local.mark))) + >> +( ~cl::eps_p + ( lookback [~cl::ch_p(boost::ref(local.mark))] + >> local.simple_markup_end + ) + >> cl::anychar_p [plain_char] + ) + ] + >> cl::ch_p(boost::ref(local.mark)) + [simple_markup] + ] + ; + + local.simple_markup_end + = ( lookback[cl::graph_p] // final mark must be preceeded by + // graph_p + >> cl::ch_p(boost::ref(local.mark)) + >> ~cl::eps_p(cl::ch_p(boost::ref(local.mark))) + // final mark not be followed by + // the same character. + >> (cl::space_p | cl::punct_p | cl::end_p) + // final mark must be followed by + // space or punctuation + ) + | '[' + | "'''" + | '`' + | phrase_end + ; + + escape = + cl::str_p("\\n") [break_] + | cl::str_p("\\ ") // ignore an escaped space + | '\\' >> cl::punct_p [plain_char] + | "\\u" >> cl::repeat_p(4) [cl::chset<>("0-9a-fA-F")] + [escape_unicode] + | "\\U" >> cl::repeat_p(8) [cl::chset<>("0-9a-fA-F")] + [escape_unicode] + | ("'''" >> !eol) + >> state.values.save() + [ (*(cl::anychar_p - "'''")) [state.values.entry(ph::arg1, ph::arg2, phrase_tags::escape)] + >> ( cl::str_p("'''") + | cl::eps_p [error("Unclosed boostbook escape.")] + ) [element_action] + ] + ; + + local.skip_escape = + cl::str_p("\\n") + | cl::str_p("\\ ") + | '\\' >> cl::punct_p + | "\\u" >> cl::repeat_p(4) [cl::chset<>("0-9a-fA-F")] + | "\\U" >> cl::repeat_p(8) [cl::chset<>("0-9a-fA-F")] + | ("'''" >> !eol) + >> (*(cl::anychar_p - "'''")) + >> ( cl::str_p("'''") + | cl::eps_p + ) + ; + + raw_escape = + cl::str_p("\\n") [error("Newlines invalid here.")] + | cl::str_p("\\ ") // ignore an escaped space + | '\\' >> cl::punct_p [raw_char] + | "\\u" >> cl::repeat_p(4) [cl::chset<>("0-9a-fA-F")] + [escape_unicode] + | "\\U" >> cl::repeat_p(8) [cl::chset<>("0-9a-fA-F")] + [escape_unicode] + | ('\\' >> cl::anychar_p) [error("Invalid escape.")] + [raw_char] + | ("'''" >> !eol) [error("Boostbook escape invalid here.")] + >> (*(cl::anychar_p - "'''")) + >> ( cl::str_p("'''") + | cl::eps_p [error("Unclosed boostbook escape.")] + ) + ; + + attribute_template_body = + space + >> *( ~cl::eps_p(space >> cl::end_p | comment) + >> ( cl::eps_p + ( cl::ch_p('[') + >> space + >> ( cl::eps_p(cl::punct_p) + >> elements + | elements + >> (cl::eps_p - (cl::alnum_p | '_')) + ) + ) [error("Elements not allowed in attribute values.")] + >> local.square_brackets + | local.attribute_template + | cl::eps_p(cl::ch_p('[')) [error("Unmatched template in attribute value.")] + >> local.square_brackets + | raw_escape + | cl::anychar_p [raw_char] + ) + ) + >> space + ; + + attribute_value_1_7 = + state.values.save() [ + +( ~cl::eps_p(']' | cl::space_p | comment) + >> ( cl::eps_p + ( cl::ch_p('[') + >> space + >> ( cl::eps_p(cl::punct_p) + >> elements + | elements + >> (cl::eps_p - (cl::alnum_p | '_')) + ) + ) [error("Elements not allowed in attribute values.")] + >> local.square_brackets + | local.attribute_template + | cl::eps_p(cl::ch_p('['))[error("Unmatched template in attribute value.")] + >> local.square_brackets + | raw_escape + | cl::anychar_p [raw_char] + ) + ) + ] + ; + + // + // Command line + // + + command_line = + state.values.list(block_tags::macro_definition) + [ *cl::space_p + >> local.command_line_macro_identifier + [state.values.entry(ph::arg1, ph::arg2)] + >> *cl::space_p + >> !( '=' + >> *cl::space_p + >> to_value() [ inline_phrase ] + >> *cl::space_p + ) + >> cl::end_p + ] [element_action] + ; + + local.command_line_macro_identifier = + qbk_ver(106u) + >> +(cl::anychar_p - (cl::space_p | '[' | '\\' | ']' | '=')) + | +(cl::anychar_p - (cl::space_p | ']' | '=')) + ; + + // Miscellaneous stuff + + // Follows an alphanumeric identifier - ensures that it doesn't + // match an empty space in the middle of the identifier. + hard_space = + (cl::eps_p - (cl::alnum_p | '_')) >> space + ; + + space = + *(cl::space_p | comment) + ; + + blank = + *(cl::blank_p | comment) + ; + + eol = blank >> cl::eol_p + ; + + phrase_end = + ']' + | cl::eps_p(ph::var(local.no_eols)) + >> cl::eol_p >> *cl::blank_p >> cl::eol_p + ; // Make sure that we don't go + // past a single block, except + // when preformatted. + + comment = + "[/" >> *(local.dummy_block | (cl::anychar_p - ']')) >> ']' + ; + + local.dummy_block = + '[' >> *(local.dummy_block | (cl::anychar_p - ']')) >> ']' + ; + + line_comment = + "[/" >> *(local.line_dummy_block | (cl::anychar_p - (cl::eol_p | ']'))) >> ']' + ; + + local.line_dummy_block = + '[' >> *(local.line_dummy_block | (cl::anychar_p - (cl::eol_p | ']'))) >> ']' + ; + + macro_identifier = + qbk_ver(106u) + >> +(cl::anychar_p - (cl::space_p | '[' | '\\' | ']')) + | qbk_ver(0, 106u) + >> +(cl::anychar_p - (cl::space_p | ']')) + ; + + // clang-format on + } + + //////////////////////////////////////////////////////////////////////////// + // Indentation Handling + + template <typename Iterator> int indent_length(Iterator first, Iterator end) + { + int length = 0; + for (; first != end; ++first) { + if (*first == '\t') { + // hardcoded tab to 4 for now + length = length + 4 - (length % 4); + } + else { + ++length; + } + } + + return length; + } + + void main_grammar_local::start_blocks_impl(parse_iterator, parse_iterator) + { + list_stack.push(list_stack_item(list_stack_item::top_level)); + } + + void main_grammar_local::start_nested_blocks_impl( + parse_iterator, parse_iterator) + { + // If this nested block is part of a list, then tell the + // output state. + state_.in_list = state_.explicit_list; + state_.explicit_list = false; + + list_stack.push(list_stack_item(list_stack_item::nested_block)); + } + + void main_grammar_local::end_blocks_impl(parse_iterator, parse_iterator) + { + clear_stack(); + list_stack.pop(); + } + + void main_grammar_local::check_indentation_impl( + parse_iterator first_, parse_iterator last_) + { + string_iterator first = first_.base(); + string_iterator last = last_.base(); + auto mark_pos = string_view(first, last - first).find_first_of("*#"); + + if (mark_pos == string_view::npos) { + plain_block(first, last); + } + else { + list_block(first, first + mark_pos, last); + } + } + + void main_grammar_local::check_code_block_impl( + parse_iterator first, parse_iterator last) + { + unsigned int new_indent = indent_length(first.base(), last.base()); + + block_type = (new_indent > list_stack.top().indent2) + ? block_types::code + : block_types::none; + } + + void main_grammar_local::plain_block( + string_iterator first, string_iterator last) + { + if (qbk_version_n >= 106u) { + unsigned int new_indent = indent_length(first, last); + + if (new_indent > list_stack.top().indent2) { + if (list_stack.top().type != list_stack_item::nested_block) { + block_type = block_types::code; + } + else { + block_type = block_types::paragraph; + } + } + else { + while (list_stack.top().type == + list_stack_item::syntactic_list && + new_indent < list_stack.top().indent) { + state_.end_list_item(); + state_.end_list(list_stack.top().mark); + list_stack.pop(); + list_indent = list_stack.top().indent; + } + + if (list_stack.top().type == list_stack_item::syntactic_list && + new_indent == list_stack.top().indent) { + // If the paragraph is aligned with the list item's marker, + // then end the current list item if that's aligned (or to + // the left of) the parent's paragraph. + // + // i.e. + // + // * Level 1 + // * Level 2 + // + // Still Level 2 + // + // vs. + // + // * Level 1 + // * Level 2 + // + // Back to Level 1 + + list_stack_item save = list_stack.top(); + list_stack.pop(); + + assert( + list_stack.top().type != list_stack_item::syntactic_list + ? new_indent >= list_stack.top().indent + : new_indent > list_stack.top().indent); + + if (new_indent <= list_stack.top().indent2) { + state_.end_list_item(); + state_.end_list(save.mark); + list_indent = list_stack.top().indent; + } + else { + list_stack.push(save); + } + } + + block_type = block_types::paragraph; + } + + if (qbk_version_n == 106u && + list_stack.top().type == list_stack_item::syntactic_list) { + detail::outerr(state_.current_file, first) + << "Paragraphs in lists aren't supported in quickbook 1.6." + << std::endl; + ++state_.error_count; + } + } + else { + clear_stack(); + + if (list_stack.top().type != list_stack_item::nested_block && + last != first) + block_type = block_types::code; + else + block_type = block_types::paragraph; + } + } + + void main_grammar_local::list_block( + string_iterator first, string_iterator mark_pos, string_iterator last) + { + unsigned int new_indent = indent_length(first, mark_pos); + unsigned int new_indent2 = indent_length(first, last); + char list_mark = *mark_pos; + + if (list_stack.top().type == list_stack_item::top_level && + new_indent > 0) { + block_type = block_types::code; + return; + } + + if (list_stack.top().type != list_stack_item::syntactic_list || + new_indent > list_indent) { + list_stack.push( + list_stack_item(list_mark, new_indent, new_indent2)); + state_.start_list(list_mark); + } + else if (new_indent == list_indent) { + state_.end_list_item(); + } + else { + // This should never reach root, since the first list + // has indentation 0. + while (list_stack.top().type == list_stack_item::syntactic_list && + new_indent < list_stack.top().indent) { + state_.end_list_item(); + state_.end_list(list_stack.top().mark); + list_stack.pop(); + } + + state_.end_list_item(); + } + + list_indent = new_indent; + + if (list_mark != list_stack.top().mark) { + detail::outerr(state_.current_file, first) + << "Illegal change of list style.\n"; + detail::outwarn(state_.current_file, first) + << "Ignoring change of list style." << std::endl; + ++state_.error_count; + } + + state_.start_list_item(); + block_type = block_types::list; + } + + void main_grammar_local::clear_stack() + { + while (list_stack.top().type == list_stack_item::syntactic_list) { + state_.end_list_item(); + state_.end_list(list_stack.top().mark); + list_stack.pop(); + } + } +} diff --git a/src/boost/tools/quickbook/src/markups.cpp b/src/boost/tools/quickbook/src/markups.cpp new file mode 100644 index 000000000..cd13b028b --- /dev/null +++ b/src/boost/tools/quickbook/src/markups.cpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "markups.hpp" +#include <map> +#include <ostream> +#include "block_tags.hpp" +#include "for.hpp" +#include "phrase_tags.hpp" +#include "quickbook.hpp" + +namespace quickbook +{ + namespace detail + { + std::map<value::tag_type, markup> markups; + + void initialise_markups() + { + markup init_markups[] = { + {block_tags::paragraph, "<para>\n", "</para>\n"}, + {block_tags::paragraph_in_list, "<simpara>\n", "</simpara>\n"}, + {block_tags::blurb, "<sidebar role=\"blurb\">\n", + "</sidebar>\n"}, + {block_tags::blockquote, "<blockquote>", "</blockquote>"}, + {block_tags::preformatted, "<programlisting>", + "</programlisting>"}, + {block_tags::warning, "<warning>", "</warning>"}, + {block_tags::caution, "<caution>", "</caution>"}, + {block_tags::important, "<important>", "</important>"}, + {block_tags::note, "<note>", "</note>"}, + {block_tags::tip, "<tip>", "</tip>"}, + {block_tags::block, "", ""}, + {block_tags::ordered_list, "<orderedlist>", "</orderedlist>"}, + {block_tags::itemized_list, "<itemizedlist>", + "</itemizedlist>"}, + {block_tags::hr, "<para/>", 0}, + {phrase_tags::url, "<ulink url=\"", "</ulink>"}, + {phrase_tags::link, "<link linkend=\"", "</link>"}, + {phrase_tags::funcref, "<functionname alt=\"", + "</functionname>"}, + {phrase_tags::classref, "<classname alt=\"", "</classname>"}, + {phrase_tags::memberref, "<methodname alt=\"", "</methodname>"}, + {phrase_tags::enumref, "<enumname alt=\"", "</enumname>"}, + {phrase_tags::macroref, "<macroname alt=\"", "</macroname>"}, + {phrase_tags::headerref, "<headername alt=\"", "</headername>"}, + {phrase_tags::conceptref, "<conceptname alt=\"", + "</conceptname>"}, + {phrase_tags::globalref, "<globalname alt=\"", "</globalname>"}, + {phrase_tags::bold, "<emphasis role=\"bold\">", "</emphasis>"}, + {phrase_tags::italic, "<emphasis>", "</emphasis>"}, + {phrase_tags::underline, "<emphasis role=\"underline\">", + "</emphasis>"}, + {phrase_tags::teletype, "<literal>", "</literal>"}, + {phrase_tags::strikethrough, + "<emphasis role=\"strikethrough\">", "</emphasis>"}, + {phrase_tags::quote, "<quote>", "</quote>"}, + {phrase_tags::replaceable, "<replaceable>", "</replaceable>"}, + {phrase_tags::escape, "<!--quickbook-escape-prefix-->", + "<!--quickbook-escape-postfix-->"}, + {phrase_tags::break_mark, "<sbr/>\n", 0}}; + + QUICKBOOK_FOR (markup m, init_markups) { + markups[m.tag] = m; + } + } + + markup const& get_markup(value::tag_type t) { return markups[t]; } + + std::ostream& operator<<(std::ostream& out, markup const& m) + { + return out << "{" << m.tag << ": \"" << m.pre << "\", \"" << m.post + << "\"}"; + } + } +} diff --git a/src/boost/tools/quickbook/src/markups.hpp b/src/boost/tools/quickbook/src/markups.hpp new file mode 100644 index 000000000..d837974eb --- /dev/null +++ b/src/boost/tools/quickbook/src/markups.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_MARKUPS_HPP) +#define BOOST_SPIRIT_MARKUPS_HPP + +#include <iosfwd> +#include "values.hpp" + +namespace quickbook +{ + namespace detail + { + struct markup + { + value::tag_type tag; + char const* pre; + char const* post; + }; + + markup const& get_markup(value::tag_type); + std::ostream& operator<<(std::ostream&, markup const&); + } +} + +#endif // BOOST_SPIRIT_MARKUPS_HPP diff --git a/src/boost/tools/quickbook/src/native_text.cpp b/src/boost/tools/quickbook/src/native_text.cpp new file mode 100644 index 000000000..42fc0e13b --- /dev/null +++ b/src/boost/tools/quickbook/src/native_text.cpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2009 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "native_text.hpp" +#include <iostream> +#include <boost/program_options.hpp> +#include "utils.hpp" + +#if QUICKBOOK_WIDE_PATHS || QUICKBOOK_WIDE_STREAMS +#include <windows.h> +#include <boost/scoped_array.hpp> +#endif + +namespace quickbook +{ + namespace detail + { +// This is used for converting paths to UTF-8 on cygin. +// Might be better not to use a windows +#if QUICKBOOK_WIDE_PATHS || QUICKBOOK_WIDE_STREAMS + std::string to_utf8(std::wstring const& x) + { + int buffer_count = + WideCharToMultiByte(CP_UTF8, 0, x.c_str(), -1, 0, 0, 0, 0); + + if (!buffer_count) + throw conversion_error( + "Error converting wide string to utf-8."); + + boost::scoped_array<char> buffer(new char[buffer_count]); + + if (!WideCharToMultiByte( + CP_UTF8, 0, x.c_str(), -1, buffer.get(), buffer_count, 0, + 0)) + throw conversion_error( + "Error converting wide string to utf-8."); + + return std::string(buffer.get()); + } + + std::wstring from_utf8(quickbook::string_view text) + { + std::string x(text.begin(), text.end()); + int buffer_count = + MultiByteToWideChar(CP_UTF8, 0, x.c_str(), -1, 0, 0); + + if (!buffer_count) + throw conversion_error( + "Error converting utf-8 to wide string."); + + boost::scoped_array<wchar_t> buffer(new wchar_t[buffer_count]); + + if (!MultiByteToWideChar( + CP_UTF8, 0, x.c_str(), -1, buffer.get(), buffer_count)) + throw conversion_error( + "Error converting utf-8 to wide string."); + + return std::wstring(buffer.get()); + } +#endif + } +} diff --git a/src/boost/tools/quickbook/src/native_text.hpp b/src/boost/tools/quickbook/src/native_text.hpp new file mode 100644 index 000000000..33047e4a2 --- /dev/null +++ b/src/boost/tools/quickbook/src/native_text.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2009 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// For handling native strings and streams. + +#if !defined(BOOST_QUICKBOOK_DETAIL_NATIVE_TEXT_HPP) +#define BOOST_QUICKBOOK_DETAIL_NATIVE_TEXT_HPP + +#include <stdexcept> +#include <string> +#include <boost/config.hpp> +#include "fwd.hpp" +#include "string_view.hpp" + +#if defined(__cygwin__) || defined(__CYGWIN__) +#define QUICKBOOK_CYGWIN_PATHS 1 +#elif defined(_WIN32) +#define QUICKBOOK_WIDE_PATHS 1 +// Wide streams work okay for me with older versions of Visual C++, +// but I've had reports of problems. My guess is that it's an +// incompatibility with later versions of windows. +#if defined(BOOST_MSVC) && BOOST_MSVC >= 1700 +#define QUICKBOOK_WIDE_STREAMS 1 +#endif +#endif + +#if !defined(QUICKBOOK_WIDE_PATHS) +#define QUICKBOOK_WIDE_PATHS 0 +#endif + +#if !defined(QUICKBOOK_WIDE_STREAMS) +#define QUICKBOOK_WIDE_STREAMS 0 +#endif + +#if !defined(QUICKBOOK_CYGWIN_PATHS) +#define QUICKBOOK_CYGWIN_PATHS 0 +#endif + +namespace quickbook +{ + namespace detail + { + struct conversion_error : std::runtime_error + { + conversion_error(char const* m) : std::runtime_error(m) {} + }; + +#if QUICKBOOK_WIDE_STREAMS + typedef std::wstring stream_string; +#else + typedef std::string stream_string; +#endif + +#if QUICKBOOK_WIDE_PATHS || QUICKBOOK_WIDE_STREAMS + std::string to_utf8(std::wstring const& x); + std::wstring from_utf8(string_view x); +#endif + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/parsers.hpp b/src/boost/tools/quickbook/src/parsers.hpp new file mode 100644 index 000000000..ac15d6471 --- /dev/null +++ b/src/boost/tools/quickbook/src/parsers.hpp @@ -0,0 +1,305 @@ +/*============================================================================= + Copyright (c) 2010-2011 Daniel James + Copyright (c) 2003 Martin Wille + http://spirit.sourceforge.net/ + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + =============================================================================*/ + +// Some custom parsers for use in quickbook. + +#ifndef BOOST_QUICKBOOK_PARSERS_HPP +#define BOOST_QUICKBOOK_PARSERS_HPP + +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_nil.hpp> +#include <boost/spirit/include/phoenix1_binders.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> +#include <boost/spirit/include/phoenix1_tuples.hpp> +#include "fwd.hpp" +#include "iterator.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + /////////////////////////////////////////////////////////////////////////// + // + // scoped_parser<Impl> + // + // Impl is a struct with the methods: + // + // void start(); + // void success(parse_iterator, parse_iterator); + // void failure(); + // void cleanup(); + // + /////////////////////////////////////////////////////////////////////////// + + template <typename Impl, typename Arguments, typename ParserT> + struct scoped_parser_impl + : public cl::unary< + ParserT, + cl::parser<scoped_parser_impl<Impl, Arguments, ParserT> > > + { + typedef scoped_parser_impl<Impl, Arguments, ParserT> self_t; + typedef cl::unary< + ParserT, + cl::parser<scoped_parser_impl<Impl, Arguments, ParserT> > > + base_t; + + template <typename ScannerT> struct result + { + typedef cl::match<> type; + }; + + scoped_parser_impl( + Impl const& impl, Arguments const& arguments, ParserT const& p) + : base_t(p), impl_(impl), arguments_(arguments) + { + } + + struct scoped + { + explicit scoped(Impl const& impl) : impl_(impl), in_progress_(false) + { + } + + typedef phoenix::tuple_index<0> t0; + typedef phoenix::tuple_index<1> t1; + + bool start(phoenix::tuple<> const&) + { + in_progress_ = impl_.start(); + return in_progress_; + } + + template <typename Arg1> bool start(phoenix::tuple<Arg1> const& x) + { + in_progress_ = + phoenix::bind(&Impl::start)(phoenix::var(impl_), x[t0()])(); + return in_progress_; + } + + template <typename Arg1, typename Arg2> + bool start(phoenix::tuple<Arg1, Arg2> const& x) + { + in_progress_ = phoenix::bind(&Impl::start)( + phoenix::var(impl_), x[t0()], x[t1()])(); + return in_progress_; + } + + void success(parse_iterator f, parse_iterator l) + { + in_progress_ = false; + impl_.success(f, l); + } + + void failure() + { + in_progress_ = false; + impl_.failure(); + } + + ~scoped() + { + if (in_progress_) impl_.failure(); + impl_.cleanup(); + } + + Impl impl_; + bool in_progress_; + }; + + template <typename ScannerT> + typename result<ScannerT>::type parse(ScannerT const& scan) const + { + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + + scoped scope(impl_); + if (!scope.start(arguments_)) return scan.no_match(); + + typename cl::parser_result<ParserT, ScannerT>::type r = + this->subject().parse(scan); + + bool success = scope.impl_.result(r, scan); + + if (success) { + scope.success(save, scan.first); + + if (r) { + return scan.create_match( + r.length(), cl::nil_t(), save, scan.first); + } + else { + return scan.create_match( + scan.first.base() - save.base(), cl::nil_t(), save, + scan.first); + } + } + else { + scope.failure(); + return scan.no_match(); + } + } + + Impl impl_; + Arguments arguments_; + }; + + template <typename Impl, typename Arguments> struct scoped_parser_gen + { + explicit scoped_parser_gen(Impl impl, Arguments const& arguments) + : impl_(impl), arguments_(arguments) + { + } + + template <typename ParserT> + scoped_parser_impl< + Impl, + Arguments, + typename cl::as_parser<ParserT>::type> + operator[](ParserT const& p) const + { + typedef cl::as_parser<ParserT> as_parser_t; + typedef typename as_parser_t::type parser_t; + + return scoped_parser_impl<Impl, Arguments, parser_t>( + impl_, arguments_, p); + } + + Impl impl_; + Arguments arguments_; + }; + + template <typename Impl> struct scoped_parser + { + scoped_parser(Impl const& impl) : impl_(impl) {} + + scoped_parser_gen<Impl, phoenix::tuple<> > operator()() const + { + typedef phoenix::tuple<> tuple; + return scoped_parser_gen<Impl, tuple>(impl_, tuple()); + } + + template <typename Arg1> + scoped_parser_gen<Impl, phoenix::tuple<Arg1> > operator()(Arg1 x1) const + { + typedef phoenix::tuple<Arg1> tuple; + return scoped_parser_gen<Impl, tuple>(impl_, tuple(x1)); + } + + template <typename Arg1, typename Arg2> + scoped_parser_gen<Impl, phoenix::tuple<Arg1, Arg2> > operator()( + Arg1 x1, Arg2 x2) const + { + typedef phoenix::tuple<Arg1, Arg2> tuple; + return scoped_parser_gen<Impl, tuple>(impl_, tuple(x1, x2)); + } + + Impl impl_; + + private: + scoped_parser& operator=(scoped_parser const&); + }; + + /////////////////////////////////////////////////////////////////////////// + // + // Lookback parser + // + // usage: lookback[body] + // + // Requires that iterator has typedef 'lookback_range' and function + // 'lookback' returning a 'lookback_range'. + // + /////////////////////////////////////////////////////////////////////////// + + template <typename ParserT> + struct lookback_parser + : public cl::unary<ParserT, cl::parser<lookback_parser<ParserT> > > + { + typedef lookback_parser<ParserT> self_t; + typedef cl::unary<ParserT, cl::parser<lookback_parser<ParserT> > > + base_t; + + template <typename ScannerT> struct result + { + typedef typename cl::parser_result<ParserT, ScannerT>::type type; + }; + + lookback_parser(ParserT const& p) : base_t(p) {} + + template <typename ScannerT> + typename result<ScannerT>::type parse(ScannerT const& scan) const + { + typedef typename ScannerT::iterator_t::lookback_range::iterator + iterator_t; + typedef cl::scanner<iterator_t, typename ScannerT::policies_t> + scanner_t; + + iterator_t begin = scan.first.lookback().begin(); + scanner_t lookback_scan(begin, scan.first.lookback().end(), scan); + + if (this->subject().parse(lookback_scan)) + return scan.empty_match(); + else + return scan.no_match(); + } + }; + + struct lookback_gen + { + template <typename ParserT> + lookback_parser<ParserT> operator[](ParserT const& p) const + { + return lookback_parser<ParserT>(p); + } + }; + + lookback_gen const lookback = lookback_gen(); + + /////////////////////////////////////////////////////////////////////////// + // + // UTF-8 code point + // + // Very crude, it doesn't check that the code point is in any way valid. + // Just looks for the beginning of the next character. This is just for + // implementing some crude fixes, rather than full unicode support. I'm + // sure experts would be appalled. + // + /////////////////////////////////////////////////////////////////////////// + + struct u8_codepoint_parser : public cl::parser<u8_codepoint_parser> + { + typedef u8_codepoint_parser self_t; + + template <typename Scanner> struct result + { + typedef cl::match<> type; + }; + + template <typename Scanner> + typename result<Scanner>::type parse(Scanner const& scan) const + { + typedef typename Scanner::iterator_t iterator_t; + + if (scan.at_end()) return scan.no_match(); + + iterator_t save(scan.first); + + do { + ++scan.first; + } while (!scan.at_end() && + ((unsigned char)*scan.first & 0xc0) == 0x80); + + return scan.create_match( + scan.first.base() - save.base(), cl::nil_t(), save, scan.first); + } + }; + + u8_codepoint_parser const u8_codepoint_p = u8_codepoint_parser(); +} + +#endif // BOOST_QUICKBOOK_SCOPED_BLOCK_HPP diff --git a/src/boost/tools/quickbook/src/path.cpp b/src/boost/tools/quickbook/src/path.cpp new file mode 100644 index 000000000..66c27ba31 --- /dev/null +++ b/src/boost/tools/quickbook/src/path.cpp @@ -0,0 +1,450 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + Copyright (c) 2013, 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "path.hpp" +#include <cassert> +#include <boost/filesystem/operations.hpp> +#include <boost/range/algorithm/replace.hpp> +#include "for.hpp" +#include "glob.hpp" +#include "include_paths.hpp" +#include "state.hpp" +#include "utils.hpp" + +#if QUICKBOOK_CYGWIN_PATHS +#include <sys/cygwin.h> +#include <boost/scoped_array.hpp> +#endif + +namespace quickbook +{ + // Not a general purpose normalization function, just + // from paths from the root directory. It strips the excess + // ".." parts from a path like: "x/../../y", leaving "y". + std::vector<fs::path> remove_dots_from_path(fs::path const& path) + { + assert(!path.has_root_directory() && !path.has_root_name()); + + std::vector<fs::path> parts; + + QUICKBOOK_FOR (fs::path const& part, path) { + if (part.empty() || part == ".") { + } + else if (part == "..") { + if (!parts.empty()) parts.pop_back(); + } + else { + parts.push_back(part); + } + } + + return parts; + } + + // The relative path from base to path + fs::path path_difference( + fs::path const& base, fs::path const& path, bool is_file) + { + fs::path absolute_base = fs::absolute(base), + absolute_path = fs::absolute(path); + + // Remove '.', '..' and empty parts from the remaining path + std::vector<fs::path> base_parts = remove_dots_from_path( + absolute_base.relative_path()), + path_parts = remove_dots_from_path( + absolute_path.relative_path()); + + std::vector<fs::path>::iterator base_it = base_parts.begin(), + base_end = base_parts.end(), + path_it = path_parts.begin(), + path_end = path_parts.end(); + + // Build up the two paths in these variables, checking for the first + // difference. + fs::path base_tmp = absolute_base.root_path(), + path_tmp = absolute_path.root_path(); + + fs::path result; + + // If they have different roots then there's no relative path so + // just build an absolute path. + if (!fs::equivalent(base_tmp, path_tmp)) { + result = path_tmp; + } + else { + // Find the point at which the paths differ + for (; base_it != base_end && path_it != path_end; + ++base_it, ++path_it) { + base_tmp /= *base_it; + path_tmp /= *path_it; + if (*base_it != *path_it) { + if (!fs::exists(base_tmp) || !fs::exists(path_tmp) || + !fs::equivalent(base_tmp, path_tmp)) { + break; + } + } + } + + if (is_file && path_it == path_end && + path_it != path_parts.begin()) { + --path_it; + result = ".."; + } + else if (base_it == base_end && path_it == path_end) { + result = "."; + } + + // Build a relative path to that point + for (; base_it != base_end; ++base_it) + result /= ".."; + } + + // Build the rest of our path + for (; path_it != path_end; ++path_it) + result /= *path_it; + + return result; + } + + // Convert a Boost.Filesystem path to a URL. + // + // I'm really not sure about this, as the meaning of root_name and + // root_directory are only clear for windows. + // + // Some info on file URLs at: + // https://en.wikipedia.org/wiki/File_URI_scheme + std::string file_path_to_url_impl(fs::path const& x, bool is_dir) + { + fs::path::const_iterator it = x.begin(), end = x.end(); + if (it == end) { + return is_dir ? "./" : ""; + } + + std::string result; + bool sep = false; + std::string part; + if (x.has_root_name()) { + // Handle network address (e.g. \\example.com) + part = detail::path_to_generic(*it); + if (part.size() >= 2 && part[0] == '/' && part[1] == '/') { + result = "file:" + detail::escape_uri(part); + sep = true; + ++it; + if (it != end && *it == "/") { + result += "/"; + sep = false; + ++it; + } + } + else { + result = "file:///"; + } + + // Handle windows root (e.g. c:) + if (it != end) { + part = detail::path_to_generic(*it); + if (part.size() >= 2 && part[part.size() - 1] == ':') { + result += + detail::escape_uri(part.substr(0, part.size() - 1)); + result += ':'; + sep = false; + ++it; + } + } + } + else if (x.has_root_directory()) { + result = "file://"; + sep = true; + } + else if (*it == ".") { + result = "."; + sep = true; + ++it; + } + + for (; it != end; ++it) { + part = detail::path_to_generic(*it); + if (part == "/") { + result += "/"; + sep = false; + } + else if (part == ".") { + // If the path has a trailing slash, write it out, + // even if is_dir is false. + if (sep) { + result += "/"; + sep = false; + } + } + else { + if (sep) { + result += "/"; + } + result += detail::escape_uri(detail::path_to_generic(*it)); + sep = true; + } + } + + if (is_dir && sep) { + result += "/"; + } + + return result; + } + + std::string file_path_to_url(fs::path const& x) + { + return file_path_to_url_impl(x, false); + } + + std::string dir_path_to_url(fs::path const& x) + { + return file_path_to_url_impl(x, true); + } + + namespace detail + { +#if QUICKBOOK_WIDE_PATHS + std::string command_line_to_utf8(command_line_string const& x) + { + return to_utf8(x); + } +#else + std::string command_line_to_utf8(command_line_string const& x) + { + return x; + } +#endif + +#if QUICKBOOK_WIDE_PATHS + fs::path generic_to_path(quickbook::string_view x) + { + return fs::path(from_utf8(x)); + } + + std::string path_to_generic(fs::path const& x) + { + return to_utf8(x.generic_wstring()); + } +#else + fs::path generic_to_path(quickbook::string_view x) + { + return fs::path(x.begin(), x.end()); + } + + std::string path_to_generic(fs::path const& x) + { + return x.generic_string(); + } +#endif + +#if QUICKBOOK_CYGWIN_PATHS + fs::path command_line_to_path(command_line_string const& path) + { + cygwin_conv_path_t flags = CCP_POSIX_TO_WIN_W | CCP_RELATIVE; + + ssize_t size = cygwin_conv_path(flags, path.c_str(), NULL, 0); + + if (size < 0) + throw conversion_error( + "Error converting cygwin path to windows."); + + boost::scoped_array<char> result(new char[size]); + void* ptr = result.get(); + + if (cygwin_conv_path(flags, path.c_str(), ptr, size)) + throw conversion_error( + "Error converting cygwin path to windows."); + + return fs::path(static_cast<wchar_t*>(ptr)); + } + + stream_string path_to_stream(fs::path const& path) + { + cygwin_conv_path_t flags = CCP_WIN_W_TO_POSIX | CCP_RELATIVE; + + ssize_t size = + cygwin_conv_path(flags, path.native().c_str(), NULL, 0); + + if (size < 0) + throw conversion_error( + "Error converting windows path to cygwin."); + + boost::scoped_array<char> result(new char[size]); + + if (cygwin_conv_path( + flags, path.native().c_str(), result.get(), size)) + throw conversion_error( + "Error converting windows path to cygwin."); + + return std::string(result.get()); + } +#else + fs::path command_line_to_path(command_line_string const& path) + { + return fs::path(path); + } + +#if QUICKBOOK_WIDE_PATHS && !QUICKBOOK_WIDE_STREAMS + stream_string path_to_stream(fs::path const& path) + { + return path.string(); + } +#else + stream_string path_to_stream(fs::path const& path) + { + return path.native(); + } +#endif + +#endif // QUICKBOOK_CYGWIN_PATHS + + enum path_or_url_type + { + path_or_url_empty = 0, + path_or_url_path, + path_or_url_url + }; + + path_or_url::path_or_url() : type_(path_or_url_empty) {} + + path_or_url::path_or_url(path_or_url const& x) + : type_(x.type_), path_(x.path_), url_(x.url_) + { + } + + path_or_url::path_or_url(command_line_string const& x) + { + auto rep = command_line_to_utf8(x); + auto it = rep.begin(), end = rep.end(); + std::size_t count = 0; + while (it != end && + ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || + *it == '+' || *it == '-' || *it == '.')) { + ++it; + ++count; + } + + if (it != end && *it == ':' && count > 1) { + type_ = path_or_url_url; + } + else { + type_ = path_or_url_path; + } + + switch (type_) { + case path_or_url_empty: + break; + case path_or_url_path: + path_ = command_line_to_path(x); + break; + case path_or_url_url: + url_ = rep; + break; + default: + assert(false); + } + } + + path_or_url& path_or_url::operator=(path_or_url const& x) + { + type_ = x.type_; + path_ = x.path_; + url_ = x.url_; + return *this; + } + + path_or_url& path_or_url::operator=(command_line_string const& x) + { + path_or_url tmp(x); + swap(tmp); + return *this; + } + + void path_or_url::swap(path_or_url& x) + { + std::swap(type_, x.type_); + std::swap(path_, x.path_); + std::swap(url_, x.url_); + } + + path_or_url path_or_url::url(string_view x) + { + path_or_url r; + r.type_ = path_or_url_url; + r.url_.assign(x.begin(), x.end()); + return r; + } + + path_or_url path_or_url::path(boost::filesystem::path const& x) + { + path_or_url r; + r.type_ = path_or_url_path; + r.path_ = x; + return r; + } + + path_or_url::operator bool() const + { + return type_ != path_or_url_empty; + } + + bool path_or_url::is_path() const { return type_ == path_or_url_path; } + + bool path_or_url::is_url() const { return type_ == path_or_url_url; } + + boost::filesystem::path const& path_or_url::get_path() const + { + assert(is_path()); + return path_; + } + + std::string const& path_or_url::get_url() const + { + assert(is_url()); + return url_; + } + + path_or_url path_or_url::operator/(string_view x) const + { + path_or_url r; + r.type_ = type_; + + switch (type_) { + case path_or_url_empty: + assert(false); + break; + case path_or_url_path: + r.path_ = path_ / x.to_s(); + break; + case path_or_url_url: { + r.url_ = url_; + auto pos = r.url_.rfind('/'); + if (pos == std::string::npos) { + pos = r.url_.rfind(':'); + } + if (pos != std::string::npos) { + r.url_.resize(pos + 1); + } + else { + // Error? Empty string? + r.url_ = "/"; + } + r.url_ += x; + break; + } + default: + assert(false); + } + return r; + } + } +} diff --git a/src/boost/tools/quickbook/src/path.hpp b/src/boost/tools/quickbook/src/path.hpp new file mode 100644 index 000000000..f66251c9d --- /dev/null +++ b/src/boost/tools/quickbook/src/path.hpp @@ -0,0 +1,116 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + Copyright (c) 2013, 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_DETAIL_PATH_HPP) +#define BOOST_QUICKBOOK_DETAIL_PATH_HPP + +#include <boost/filesystem/path.hpp> +#include "native_text.hpp" + +namespace quickbook +{ + namespace fs = boost::filesystem; + + // The relative path from base to path + fs::path path_difference( + fs::path const& base, fs::path const& path, bool is_file = false); + + // Convert a Boost.Filesystem path to a URL. + std::string file_path_to_url(fs::path const&); + std::string dir_path_to_url(fs::path const&); + + namespace detail + { +// 'generic': Paths in quickbook source and the generated boostbook. +// Always UTF-8. +// 'command_line': +// Paths (or other parameters) from the command line and +// possibly other sources in the future. Wide strings on +// normal windows, UTF-8 for cygwin and other platforms +// (hopefully). +// 'path': Stored as a boost::filesystem::path. Since +// Boost.Filesystem doesn't support cygwin, this +// is always wide on windows. UTF-8 on other +// platforms (again, hopefully). + +#if QUICKBOOK_WIDE_PATHS + typedef std::wstring command_line_string; +#else + typedef std::string command_line_string; +#endif + + std::string command_line_to_utf8(command_line_string const&); + fs::path command_line_to_path(command_line_string const&); + + std::string path_to_generic(fs::path const&); + fs::path generic_to_path(quickbook::string_view); + + stream_string path_to_stream(fs::path const& path); + + // Command line parameters that might be a path, a url, or empty. + // Not very efficient, but won't be used much. + class path_or_url + { + int type_; + boost::filesystem::path path_; + std::string url_; + + public: + // Creates an empty path_or_url. + path_or_url(); + + path_or_url(path_or_url const&); + + // Stores a parameter as either a path or a URL depending + // on whether it looks like an absolute URL (i.e. starts with + // 'scheme:') + explicit path_or_url(command_line_string const&); + + path_or_url& operator=(path_or_url const&); + + path_or_url& operator=(command_line_string const&); + + void swap(path_or_url&); + + // Explicity create a URL + static path_or_url url(string_view); + + // Explicitly create a path + static path_or_url path(boost::filesystem::path const&); + + // Returns true if this isn't empty. + operator bool() const; + + // Returns true if contains a path. + bool is_path() const; + + // Returns true is contains a URL. + bool is_url() const; + + // Returns the stored path. + // pre: is_path() + boost::filesystem::path const& get_path() const; + + // Returns the stored URL. + // pre: is_url() + std::string const& get_url() const; + + // Appends the value, either by path concatenation or URL + // concatenation. + // Note: a URL will strip text after the last '/', a path won't. + // Maybe should only work when the path is known to be a + // directory? + path_or_url operator/(string_view) const; + }; + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/phrase_element_grammar.cpp b/src/boost/tools/quickbook/src/phrase_element_grammar.cpp new file mode 100644 index 000000000..ed33e3000 --- /dev/null +++ b/src/boost/tools/quickbook/src/phrase_element_grammar.cpp @@ -0,0 +1,211 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/spirit/include/classic_assign_actor.hpp> +#include <boost/spirit/include/classic_clear_actor.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_if.hpp> +#include <boost/spirit/include/phoenix1_casts.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> +#include "actions.hpp" +#include "for.hpp" +#include "grammar_impl.hpp" +#include "phrase_tags.hpp" +#include "state.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + struct phrase_element_grammar_local + { + cl::rule<scanner> image, anchor, link, empty, cond_phrase, inner_phrase, + role, source_mode; + }; + + void quickbook_grammar::impl::init_phrase_elements() + { + phrase_element_grammar_local& local = + cleanup_.add(new phrase_element_grammar_local); + + error_action error(state); + raw_char_action raw_char(state); + scoped_parser<cond_phrase_push> scoped_cond_phrase(state); + scoped_parser<to_value_scoped_action> to_value(state); + + // clang-format off + + elements.add + ("?", element_info(element_info::phrase, &local.cond_phrase)) + ; + + local.cond_phrase = + ( !(qbk_ver(107u) >> "!") ) [state.values.entry(ph::arg1, ph::arg2)] + >> blank + >> macro_identifier [state.values.entry(ph::arg1, ph::arg2)] + >> scoped_cond_phrase() [extended_phrase] + ; + + elements.add + ("$", element_info(element_info::phrase, &local.image, phrase_tags::image)) + ; + + // Note that the attribute values here are encoded in plain text not + // boostbook. + local.image = + qbk_ver(105u) + >> blank + >> ( qbk_ver(0, 106u) + >> (+( + *cl::space_p + >> +(cl::anychar_p - (cl::space_p | phrase_end | '[')) + )) [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(106u) + >> to_value() + [ +( raw_escape + | (+cl::space_p >> ~cl::eps_p(phrase_end | '[')) + [raw_char] + | (cl::anychar_p - (cl::space_p | phrase_end | '[')) + [raw_char] + ) + ] + ) + >> hard_space + >> *state.values.list() + [ '[' + >> (*(cl::alnum_p | '_')) + [state.values.entry(ph::arg1, ph::arg2)] + >> space + >> ( qbk_ver(0, 106u) + >> (*(cl::anychar_p - (phrase_end | '['))) + [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(106u) + >> to_value() + [ *( raw_escape + | (cl::anychar_p - (phrase_end | '[')) + [raw_char] + ) + ] + ) + >> ']' + >> space + ] + >> cl::eps_p(']') + | qbk_ver(0, 105u) + >> blank + >> (*(cl::anychar_p - phrase_end)) [state.values.entry(ph::arg1, ph::arg2)] + >> cl::eps_p(']') + ; + + elements.add + ("@", element_info(element_info::phrase, &local.link, phrase_tags::url)) + ("link", element_info(element_info::phrase, &local.link, phrase_tags::link)) + ("funcref", element_info(element_info::phrase, &local.link, phrase_tags::funcref)) + ("classref", element_info(element_info::phrase, &local.link, phrase_tags::classref)) + ("memberref", element_info(element_info::phrase, &local.link, phrase_tags::memberref)) + ("enumref", element_info(element_info::phrase, &local.link, phrase_tags::enumref)) + ("macroref", element_info(element_info::phrase, &local.link, phrase_tags::macroref)) + ("headerref", element_info(element_info::phrase, &local.link, phrase_tags::headerref)) + ("conceptref", element_info(element_info::phrase, &local.link, phrase_tags::conceptref)) + ("globalref", element_info(element_info::phrase, &local.link, phrase_tags::globalref)) + ; + + local.link = + space + >> ( qbk_ver(0, 106u) + >> (*(cl::anychar_p - (']' | space))) + [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(106u, 107u) + >> to_value() + [ *( raw_escape + | (cl::anychar_p - (cl::ch_p('[') | ']' | space)) + [raw_char] + ) + ] + >> !( ~cl::eps_p(comment) + >> cl::eps_p('[') [error("Open bracket in link value.")] + ) + | qbk_ver(107u) + >> to_value() [attribute_value_1_7] + ) + >> hard_space + >> local.inner_phrase + ; + + elements.add + ("#", element_info(element_info::maybe_block, &local.anchor, phrase_tags::anchor)) + ; + + local.anchor = + blank + >> ( qbk_ver(0, 106u) + >> (*(cl::anychar_p - phrase_end)) [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(106u, 107u) + >> to_value() + [ *( raw_escape + | (cl::anychar_p - phrase_end) + [raw_char] + ) + ] + | qbk_ver(107u) + >> to_value() [attribute_value_1_7] + ) + ; + + elements.add + ("*", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::bold)) + ("'", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::italic)) + ("_", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::underline)) + ("^", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::teletype)) + ("-", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::strikethrough)) + ("\"", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::quote)) + ("~", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::replaceable)) + ("footnote", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::footnote)) + ; + + elements.add("!", element_info(element_info::maybe_block, &local.source_mode, code_tags::next_source_mode, 107u)) + ; + + local.source_mode = + cl::eps_p [state.values.entry(ph::arg1, ph::arg2)] + >> source_modes [state.values.entry(ph::arg1)]; + + QUICKBOOK_FOR(int tag, source_mode_tags::tags()) { + source_modes.add(source_mode_tags::name(tag), tag); + elements.add(source_mode_tags::name(tag), + element_info(element_info::phrase, &local.empty, tag)); + } + + elements.add + ("role", element_info(element_info::phrase, &local.role, phrase_tags::role, 106u)) + ; + + local.role + = space + >> ( qbk_ver(0, 107u) + >> (+(cl::alnum_p | '_')) [state.values.entry(ph::arg1, ph::arg2)] + | qbk_ver(107u) + >> to_value() [attribute_value_1_7] + ) + >> hard_space + >> local.inner_phrase + ; + + local.empty = cl::eps_p; + + local.inner_phrase = + blank + >> to_value() [ paragraph_phrase ] + ; + + // clang-format on + } +} diff --git a/src/boost/tools/quickbook/src/phrase_tags.hpp b/src/boost/tools/quickbook/src/phrase_tags.hpp new file mode 100644 index 000000000..e94c0935c --- /dev/null +++ b/src/boost/tools/quickbook/src/phrase_tags.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_PHRASE_TAGS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_PHRASE_TAGS_HPP + +#include "value_tags.hpp" + +namespace quickbook +{ + // clang-format off + + QUICKBOOK_VALUE_TAGS(phrase_tags, 0x500, + (image) + (url)(link)(anchor) + (funcref)(classref)(memberref)(enumref) + (macroref)(headerref)(conceptref)(globalref) + (bold)(italic)(underline)(teletype)(strikethrough)(quote)(replaceable) + (footnote) + (escape) + (break_mark) + (role) + ) + + QUICKBOOK_VALUE_NAMED_TAGS(source_mode_tags, 0x550, + ((cpp)("c++")) + ((python)("python")) + ((teletype)("teletype")) + ) + + QUICKBOOK_VALUE_TAGS(code_tags, 0x560, + (code_block) + (inline_code) + (inline_code_block) + (next_source_mode) + ) + + // clang-format on +} + +#endif diff --git a/src/boost/tools/quickbook/src/post_process.cpp b/src/boost/tools/quickbook/src/post_process.cpp new file mode 100644 index 000000000..1ee02bc4c --- /dev/null +++ b/src/boost/tools/quickbook/src/post_process.cpp @@ -0,0 +1,454 @@ +/*============================================================================= + Copyright (c) 2005 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "post_process.hpp" +#include <cctype> +#include <set> +#include <stack> +#include <boost/bind/bind.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/phoenix1_operators.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> + +using namespace boost::placeholders; + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + namespace ph = phoenix; + typedef std::string::const_iterator iter_type; + + struct pretty_printer + { + pretty_printer(std::string& out_, int& current_indent_, int linewidth_) + : prev(0) + , out(out_) + , current_indent(current_indent_) + , column(0) + , in_string(false) + , linewidth(linewidth_) + { + } + + void indent() + { + BOOST_ASSERT(current_indent >= 0); // this should not happen! + for (int i = 0; i < current_indent; ++i) + out += ' '; + column = current_indent; + } + + void trim_spaces() + { + out.erase(out.find_last_not_of(' ') + 1); // trim trailing spaces + } + + void break_line() + { + trim_spaces(); + out += '\n'; + indent(); + } + + bool line_is_empty() const + { + for (iter_type i = out.end() - (column - current_indent); + i != out.end(); ++i) { + if (*i != ' ') return false; + } + return true; + } + + void align_indent() + { + // make sure we are at the proper indent position + if (column != current_indent) { + if (column > current_indent) { + if (line_is_empty()) { + // trim just enough trailing spaces down to + // current_indent position + out.erase( + out.end() - (column - current_indent), out.end()); + column = current_indent; + } + else { + // nope, line is not empty. do a hard CR + break_line(); + } + } + else { + // will this happen? (i.e. column <= current_indent) + while (column != current_indent) { + out += ' '; + ++column; + } + } + } + } + + void print(char ch) + { + // Print a char. Attempt to break the line if we are exceeding + // the target linewidth. The linewidth is not an absolute limit. + // There are many cases where a line will exceed the linewidth + // and there is no way to properly break the line. Preformatted + // code that exceeds the linewidth are examples. We cannot break + // preformatted code. We shall not attempt to be very strict with + // line breaking. What's more important is to have a reproducable + // output (i.e. processing two logically equivalent xml files + // results in two lexically equivalent xml files). *** pretty + // formatting is a secondary goal *** + + // Strings will occur only in tag attributes. Normal content + // will have " instead. We shall deal only with tag + // attributes here. + if (ch == '"') in_string = !in_string; // don't break strings! + + if (!in_string && std::isspace(static_cast<unsigned char>(ch))) { + // we can break spaces if they are not inside strings + if (!std::isspace(static_cast<unsigned char>(prev))) { + if (column >= linewidth) { + break_line(); + if (column == 0 && ch == ' ') { + ++column; + out += ' '; + } + } + else { + ++column; + out += ' '; + } + } + } + else { + // we can break tag boundaries and stuff after + // delimiters if they are not inside strings + // and *only-if* the preceding char is a space + if (!in_string && column >= linewidth && + (ch == '<' && + std::isspace(static_cast<unsigned char>(prev)))) + break_line(); + out += ch; + ++column; + } + + prev = ch; + } + + void print(iter_type f, iter_type l) + { + for (iter_type i = f; i != l; ++i) + print(*i); + } + + void print_tag(iter_type f, iter_type l, bool is_flow_tag) + { + if (is_flow_tag) { + print(f, l); + } + else { + // This is not a flow tag, so, we're going to do a + // carriage return anyway. Let us remove extra right + // spaces. + std::string str(f, l); + BOOST_ASSERT(f != l); // this should not happen + iter_type i = str.end(); + while (i != str.begin() && + std::isspace(static_cast<unsigned char>(*(i - 1)))) + --i; + print(str.begin(), i); + } + } + + char prev; + std::string& out; + int& current_indent; + int column; + bool in_string; + int linewidth; + + private: + pretty_printer& operator=(pretty_printer const&); + }; + + char const* html_block_tags_[] = { + "div", "p", "blockquote", "address", "h1", "h2", "h3", + "h4", "h5", "h6", "ul", "ol", "li", "dl", + "dt", "dd", "table", "tr", "th", "td", "tbody", + "thead", "form", "fieldset", "hr", "noscript", "html", "body"}; + + char const* block_tags_[] = { + "author", "blockquote", "bridgehead", "callout", + "calloutlist", "caution", "copyright", "entry", + "important", "informaltable", "itemizedlist", "legalnotice", + "listitem", "note", "orderedlist", "para", + "row", "section", "simpara", "table", + "tbody", "textobject", "tgroup", "thead", + "tip", "variablelist", "varlistentry", "warning", + "xml", "xi:include"}; + + char const* doc_types_[] = {"book", "article", "library", "chapter", + "part", "appendix", "preface", "qandadiv", + "qandaset", "reference", "set"}; + + struct tidy_compiler + { + tidy_compiler(std::string& out_, int linewidth_, bool is_html) + : out(out_) + , current_indent(0) + , printer(out_, current_indent, linewidth_) + { + if (is_html) { + static std::size_t const n_block_tags = + sizeof(html_block_tags_) / sizeof(char const*); + for (std::size_t i = 0; i != n_block_tags; ++i) { + block_tags.insert(html_block_tags_[i]); + } + } + else { + static std::size_t const n_block_tags = + sizeof(block_tags_) / sizeof(char const*); + for (std::size_t i = 0; i != n_block_tags; ++i) { + block_tags.insert(block_tags_[i]); + } + + static std::size_t const n_doc_types = + sizeof(doc_types_) / sizeof(char const*); + for (std::size_t i = 0; i != n_doc_types; ++i) { + block_tags.insert(doc_types_[i]); + block_tags.insert(doc_types_[i] + std::string("info")); + block_tags.insert(doc_types_[i] + std::string("purpose")); + } + } + } + + bool is_flow_tag(std::string const& tag) + { + return block_tags.find(tag) == block_tags.end(); + } + + std::set<std::string> block_tags; + std::stack<std::string> tags; + std::string& out; + int current_indent; + pretty_printer printer; + std::string current_tag; + + private: + tidy_compiler& operator=(tidy_compiler const&); + }; + + struct tidy_grammar : cl::grammar<tidy_grammar> + { + tidy_grammar(tidy_compiler& state_, int indent_, bool is_html_) + : state(state_), indent(indent_), is_html(is_html_) + { + } + + template <typename Scanner> struct definition + { + definition(tidy_grammar const& self) + { + // clang-format off + + tag = (cl::lexeme_d[+(cl::alnum_p | '_' | ':')]) [boost::bind(&tidy_grammar::do_tag, &self, _1, _2)]; + + code = cl::eps_p(ph::var(self.is_html)) + >> "<" + >> cl::lexeme_d[cl::str_p("pre")] + >> *(cl::anychar_p - '>') + >> ">" + >> *(cl::anychar_p - "</pre>") + >> "</pre" + >> cl::lexeme_d[">" >> *cl::space_p] + | cl::eps_p(!ph::var(self.is_html)) + >> "<programlisting>" + >> *(cl::anychar_p - "</programlisting>") + >> "</programlisting" + >> cl::lexeme_d[">" >> *cl::space_p] + ; + + // What's the business of cl::lexeme_d['>' >> *cl::space_p]; ? + // It is there to preserve the space after the tag that is + // otherwise consumed by the cl::space_p skipper. + + escape = + cl::str_p("<!--quickbook-escape-prefix-->") >> + (*(cl::anychar_p - cl::str_p("<!--quickbook-escape-postfix-->"))) + [ + boost::bind(&tidy_grammar::do_escape, &self, _1, _2) + ] + >> cl::lexeme_d + [ + cl::str_p("<!--quickbook-escape-postfix-->") >> + (*cl::space_p) + [ + boost::bind(&tidy_grammar::do_escape_post, &self, _1, _2) + ] + ] + ; + + start_tag = '<' >> tag >> *(cl::anychar_p - '>') >> cl::lexeme_d['>' >> *cl::space_p]; + start_end_tag = + '<' >> tag >> *(cl::anychar_p - ("/>" | cl::ch_p('>'))) >> cl::lexeme_d["/>" >> *cl::space_p] + | "<?" >> tag >> *(cl::anychar_p - '?') >> cl::lexeme_d["?>" >> *cl::space_p] + | "<!--" >> *(cl::anychar_p - "-->") >> cl::lexeme_d["-->" >> *cl::space_p] + | "<!" >> tag >> *(cl::anychar_p - '>') >> cl::lexeme_d['>' >> *cl::space_p] + ; + content = cl::lexeme_d[ +(cl::anychar_p - '<') ]; + end_tag = "</" >> +(cl::anychar_p - '>') >> cl::lexeme_d['>' >> *cl::space_p]; + + markup = + escape + | code [boost::bind(&tidy_grammar::do_code, &self, _1, _2)] + | start_end_tag [boost::bind(&tidy_grammar::do_start_end_tag, &self, _1, _2)] + | start_tag [boost::bind(&tidy_grammar::do_start_tag, &self, _1, _2)] + | end_tag [boost::bind(&tidy_grammar::do_end_tag, &self, _1, _2)] + | content [boost::bind(&tidy_grammar::do_content, &self, _1, _2)] + ; + + tidy = *markup; + + // clang-format on + } + + cl::rule<Scanner> const& start() { return tidy; } + + cl::rule<Scanner> tidy, tag, start_tag, start_end_tag, content, + end_tag, markup, code, escape; + }; + + void do_escape_post(iter_type f, iter_type l) const + { + for (iter_type i = f; i != l; ++i) + state.out += *i; + } + + void do_escape(iter_type f, iter_type l) const + { + while (f != l && std::isspace(*f)) { + ++f; + } + while (f != l && std::isspace(*(l - 1))) { + --l; + } + for (iter_type i = f; i != l; ++i) { + state.out += *i; + } + } + + void do_code(iter_type f, iter_type l) const + { + state.printer.trim_spaces(); + if (state.out[state.out.size() - 1] != '\n') state.out += '\n'; + + // trim trailing space from after closing tag + while (f != l && std::isspace(*(l - 1))) { + --l; + } + + // print the string taking care of line + // ending CR/LF platform issues + for (iter_type i = f; i != l;) { + if (*i == '\n') { + state.printer.trim_spaces(); + state.out += '\n'; + ++i; + if (i != l && *i == '\r') { + ++i; + } + } + else if (*i == '\r') { + state.printer.trim_spaces(); + state.out += '\n'; + ++i; + if (i != l && *i == '\n') { + ++i; + } + } + else { + state.out += *i; + ++i; + } + } + state.out += '\n'; + state.printer.indent(); + } + + void do_tag(iter_type f, iter_type l) const + { + state.current_tag = std::string(f, l); + } + + void do_start_end_tag(iter_type f, iter_type l) const + { + bool is_flow_tag = state.is_flow_tag(state.current_tag); + if (!is_flow_tag) state.printer.align_indent(); + state.printer.print_tag(f, l, is_flow_tag); + if (!is_flow_tag) state.printer.break_line(); + } + + void do_start_tag(iter_type f, iter_type l) const + { + state.tags.push(state.current_tag); + bool is_flow_tag = state.is_flow_tag(state.current_tag); + if (!is_flow_tag) state.printer.align_indent(); + state.printer.print_tag(f, l, is_flow_tag); + if (!is_flow_tag) { + state.current_indent += indent; + state.printer.break_line(); + } + } + + void do_content(iter_type f, iter_type l) const + { + state.printer.print(f, l); + } + + void do_end_tag(iter_type f, iter_type l) const + { + if (state.tags.empty()) + throw quickbook::post_process_failure("Mismatched tags."); + + bool is_flow_tag = state.is_flow_tag(state.tags.top()); + if (!is_flow_tag) { + state.current_indent -= indent; + state.printer.align_indent(); + } + state.printer.print_tag(f, l, is_flow_tag); + if (!is_flow_tag) state.printer.break_line(); + state.tags.pop(); + } + + tidy_compiler& state; + int indent; + bool is_html; + + private: + tidy_grammar& operator=(tidy_grammar const&); + }; + + std::string post_process( + std::string const& in, int indent, int linewidth, bool is_html) + { + if (indent == -1) indent = 2; // set default to 2 + if (linewidth == -1) linewidth = 80; // set default to 80 + + std::string tidy; + tidy_compiler state(tidy, linewidth, is_html); + tidy_grammar g(state, indent, is_html); + cl::parse_info<iter_type> r = + parse(in.begin(), in.end(), g, cl::space_p); + if (r.full) { + return tidy; + } + else { + throw quickbook::post_process_failure("Post Processing Failed."); + } + } +} diff --git a/src/boost/tools/quickbook/src/post_process.hpp b/src/boost/tools/quickbook/src/post_process.hpp new file mode 100644 index 000000000..7c4324b43 --- /dev/null +++ b/src/boost/tools/quickbook/src/post_process.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2005 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_POST_PROCESS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_POST_PROCESS_HPP + +#include <stdexcept> +#include <string> + +namespace quickbook +{ + std::string post_process( + std::string const& in, + int indent = -1, + int linewidth = -1, + bool is_html = false); + + struct post_process_failure : public std::runtime_error + { + public: + explicit post_process_failure(std::string const& error) + : std::runtime_error(error) + { + } + }; +} + +#endif // BOOST_SPIRIT_QUICKBOOK_POST_PROCESS_HPP diff --git a/src/boost/tools/quickbook/src/quickbook.cpp b/src/boost/tools/quickbook/src/quickbook.cpp new file mode 100644 index 000000000..cc8fe0dcb --- /dev/null +++ b/src/boost/tools/quickbook/src/quickbook.cpp @@ -0,0 +1,782 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "quickbook.hpp" +#include <boost/algorithm/string/classification.hpp> +#include <boost/algorithm/string/split.hpp> +#include <boost/filesystem/fstream.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/program_options.hpp> +#include <boost/range/algorithm/replace.hpp> +#include <boost/range/algorithm/transform.hpp> +#include <boost/ref.hpp> +#include <boost/version.hpp> +#include "actions.hpp" +#include "bb2html.hpp" +#include "document_state.hpp" +#include "files.hpp" +#include "for.hpp" +#include "grammar.hpp" +#include "path.hpp" +#include "post_process.hpp" +#include "state.hpp" +#include "stream.hpp" +#include "utils.hpp" + +#include <iterator> +#include <stdexcept> +#include <vector> + +#if defined(_WIN32) +#include <windows.h> +#include <shellapi.h> +#endif + +#if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310)) +#pragma warning(disable : 4355) +#endif + +#define QUICKBOOK_VERSION "Quickbook Version 1.7.2" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + namespace fs = boost::filesystem; + + tm* current_time; // the current time + tm* current_gm_time; // the current UTC time + bool debug_mode; // for quickbook developers only + bool self_linked_headers; + std::vector<fs::path> include_path; + std::vector<std::string> preset_defines; + fs::path image_location; + + static void set_macros(quickbook::state& state) + { + QUICKBOOK_FOR (quickbook::string_view val, preset_defines) { + parse_iterator first(val.begin()); + parse_iterator last(val.end()); + + cl::parse_info<parse_iterator> info = + cl::parse(first, last, state.grammar().command_line_macro); + + if (!info.full) { + detail::outerr() << "Error parsing command line definition: '" + << val << "'" << std::endl; + ++state.error_count; + } + } + } + + /////////////////////////////////////////////////////////////////////////// + // + // Parse a file + // + /////////////////////////////////////////////////////////////////////////// + void parse_file( + quickbook::state& state, value include_doc_id, bool nested_file) + { + parse_iterator first(state.current_file->source().begin()); + parse_iterator last(state.current_file->source().end()); + + cl::parse_info<parse_iterator> info = + cl::parse(first, last, state.grammar().doc_info); + assert(info.hit); + + if (!state.error_count) { + std::string doc_type = + pre(state, info.stop, include_doc_id, nested_file); + + info = cl::parse( + info.hit ? info.stop : first, last, + state.grammar().block_start); + + post(state, doc_type); + + if (!info.full) { + file_position const& pos = + state.current_file->position_of(info.stop.base()); + detail::outerr(state.current_file->path, pos.line) + << "Syntax Error near column " << pos.column << ".\n"; + ++state.error_count; + } + } + } + + struct parse_document_options + { + enum output_format + { + boostbook, + html + }; + enum output_style + { + output_none = 0, + output_file, + output_chunked + }; + + parse_document_options() + : format(boostbook) + , style(output_file) + , output_path() + , indent(-1) + , linewidth(-1) + , pretty_print(true) + , strict_mode(false) + , deps_out_flags(quickbook::dependency_tracker::default_) + { + } + + output_format format; + output_style style; + fs::path output_path; + int indent; + int linewidth; + bool pretty_print; + bool strict_mode; + fs::path deps_out; + quickbook::dependency_tracker::flags deps_out_flags; + fs::path locations_out; + fs::path xinclude_base; + quickbook::detail::html_options html_ops; + }; + + static int parse_document( + fs::path const& filein_, parse_document_options const& options_) + { + string_stream buffer; + document_state output; + + int result = 0; + + try { + quickbook::state state( + filein_, options_.xinclude_base, buffer, output); + state.strict_mode = options_.strict_mode; + set_macros(state); + + if (state.error_count == 0) { + state.dependencies.add_dependency(filein_); + state.current_file = load(filein_); // Throws load_error + + parse_file(state); + + if (state.error_count) { + detail::outerr() + << "Error count: " << state.error_count << ".\n"; + } + } + + result = state.error_count ? 1 : 0; + + if (!options_.deps_out.empty()) { + state.dependencies.write_dependencies( + options_.deps_out, options_.deps_out_flags); + } + + if (!options_.locations_out.empty()) { + fs::ofstream out(options_.locations_out); + state.dependencies.write_dependencies( + options_.locations_out, dependency_tracker::checked); + } + } catch (load_error& e) { + detail::outerr(filein_) << e.what() << std::endl; + result = 1; + } catch (std::runtime_error& e) { + detail::outerr() << e.what() << std::endl; + result = 1; + } + + if (result) { + return result; + } + + if (options_.style) { + std::string stage2 = output.replace_placeholders(buffer.str()); + + if (options_.pretty_print) { + try { + stage2 = post_process( + stage2, options_.indent, options_.linewidth); + } catch (quickbook::post_process_failure&) { + ::quickbook::detail::outerr() + << "Post Processing Failed." << std::endl; + if (options_.format == parse_document_options::boostbook) { + // Can still write out a boostbook file, but return an + // error code. + result = 1; + } + else { + return 1; + } + } + } + + if (options_.format == parse_document_options::html) { + if (result) { + return result; + } + return quickbook::detail::boostbook_to_html( + stage2, options_.html_ops); + } + else { + fs::ofstream fileout(options_.output_path); + + if (fileout.fail()) { + ::quickbook::detail::outerr() + << "Error opening output file " << options_.output_path + << std::endl; + + return 1; + } + + fileout << stage2; + + if (fileout.fail()) { + ::quickbook::detail::outerr() + << "Error writing to output file " + << options_.output_path << std::endl; + + return 1; + } + } + } + + return result; + } +} + +/////////////////////////////////////////////////////////////////////////// +// +// Main program +// +/////////////////////////////////////////////////////////////////////////// +int main(int argc, char* argv[]) +{ + try { + namespace fs = boost::filesystem; + namespace po = boost::program_options; + + using boost::program_options::options_description; + using boost::program_options::variables_map; + using boost::program_options::store; + using boost::program_options::parse_command_line; + using boost::program_options::wcommand_line_parser; + using boost::program_options::command_line_parser; + using boost::program_options::notify; + using boost::program_options::positional_options_description; + + using namespace quickbook; + using quickbook::detail::command_line_string; + + // First thing, the filesystem should record the current working + // directory. + fs::initial_path<fs::path>(); + + // Various initialisation methods + quickbook::detail::initialise_output(); + quickbook::detail::initialise_markups(); + + // Declare the program options + + options_description desc("Allowed options"); + options_description html_desc("HTML options"); + options_description hidden("Hidden options"); + options_description all("All options"); + +#if QUICKBOOK_WIDE_PATHS +#define PO_VALUE po::wvalue +#else +#define PO_VALUE po::value +#endif + + // clang-format off + + desc.add_options() + ("help", "produce help message") + ("version", "print version string") + ("no-pretty-print", "disable XML pretty printing") + ("strict", "strict mode") + ("no-self-linked-headers", "stop headers linking to themselves") + ("indent", PO_VALUE<int>(), "indent spaces") + ("linewidth", PO_VALUE<int>(), "line width") + ("input-file", PO_VALUE<command_line_string>(), "input file") + ("output-format", PO_VALUE<command_line_string>(), "boostbook, html, onehtml") + ("output-file", PO_VALUE<command_line_string>(), "output file (for boostbook or onehtml)") + ("output-dir", PO_VALUE<command_line_string>(), "output directory (for html)") + ("no-output", "don't write out the result") + ("output-deps", PO_VALUE<command_line_string>(), "output dependency file") + ("ms-errors", "use Microsoft Visual Studio style error & warn message format") + ("include-path,I", PO_VALUE< std::vector<command_line_string> >(), "include path") + ("define,D", PO_VALUE< std::vector<command_line_string> >(), "define macro") + ("image-location", PO_VALUE<command_line_string>(), "image location") + ; + + html_desc.add_options() + ("boost-root-path", PO_VALUE<command_line_string>(), "boost root (file path or absolute URL)") + ("css-path", PO_VALUE<command_line_string>(), "css file (file path or absolute URL)") + ("graphics-path", PO_VALUE<command_line_string>(), "graphics directory (file path or absolute URL)"); + desc.add(html_desc); + + hidden.add_options() + ("debug", "debug mode") + ("expect-errors", + "Succeed if the input file contains a correctly handled " + "error, fail otherwise.") + ("xinclude-base", PO_VALUE<command_line_string>(), + "Generate xincludes as if generating for this target " + "directory.") + ("output-deps-format", PO_VALUE<command_line_string>(), + "Comma separated list of formatting options for output-deps, " + "options are: escaped, checked") + ("output-checked-locations", PO_VALUE<command_line_string>(), + "Writes a file listing all the file locations that were " + "checked, starting with '+' if they were found, or '-' " + "if they weren't.\n" + "This is deprecated, use 'output-deps-format=checked' to " + "write the deps file in this format.") + ; + + // clang-format on + + all.add(desc).add(hidden); + + positional_options_description p; + p.add("input-file", -1); + + // Read option from the command line + + variables_map vm; + +#if QUICKBOOK_WIDE_PATHS + quickbook::ignore_variable(&argc); + quickbook::ignore_variable(&argv); + + int wide_argc; + LPWSTR* wide_argv = CommandLineToArgvW(GetCommandLineW(), &wide_argc); + if (!wide_argv) { + quickbook::detail::outerr() + << "Error getting argument values." << std::endl; + return 1; + } + + store( + wcommand_line_parser(wide_argc, wide_argv) + .options(all) + .positional(p) + .run(), + vm); + + LocalFree(wide_argv); +#else + store( + command_line_parser(argc, argv).options(all).positional(p).run(), + vm); +#endif + + notify(vm); + + // Process the command line options + + parse_document_options options; + bool expect_errors = vm.count("expect-errors"); + int error_count = 0; + bool output_specified = false; + bool alt_output_specified = false; + + if (vm.count("help")) { + std::ostringstream description_text; + description_text << desc; + + quickbook::detail::out() << description_text.str() << "\n"; + + return 0; + } + + if (vm.count("version")) { + std::string boost_version = BOOST_LIB_VERSION; + boost::replace(boost_version, '_', '.'); + + quickbook::detail::out() << QUICKBOOK_VERSION << " (Boost " + << boost_version << ")" << std::endl; + return 0; + } + + quickbook::detail::set_ms_errors(vm.count("ms-errors")); + + if (vm.count("no-pretty-print")) options.pretty_print = false; + + options.strict_mode = !!vm.count("strict"); + + if (vm.count("indent")) options.indent = vm["indent"].as<int>(); + + if (vm.count("linewidth")) + options.linewidth = vm["linewidth"].as<int>(); + + if (vm.count("output-format")) { + output_specified = true; + std::string format = quickbook::detail::command_line_to_utf8( + vm["output-format"].as<command_line_string>()); + if (format == "html") { + options.format = quickbook::parse_document_options::html; + options.style = + quickbook::parse_document_options::output_chunked; + } + else if (format == "onehtml") { + options.format = quickbook::parse_document_options::html; + options.style = quickbook::parse_document_options::output_file; + } + else if (format == "boostbook") { + options.format = quickbook::parse_document_options::boostbook; + options.style = quickbook::parse_document_options::output_file; + } + else { + quickbook::detail::outerr() + << "Unknown output format: " << format << std::endl; + + ++error_count; + } + } + + quickbook::self_linked_headers = + options.format != parse_document_options::html && + !vm.count("no-self-linked-headers"); + + if (vm.count("debug")) { + static tm timeinfo; + timeinfo.tm_year = 2000 - 1900; + timeinfo.tm_mon = 12 - 1; + timeinfo.tm_mday = 20; + timeinfo.tm_hour = 12; + timeinfo.tm_min = 0; + timeinfo.tm_sec = 0; + timeinfo.tm_isdst = -1; + mktime(&timeinfo); + quickbook::current_time = &timeinfo; + quickbook::current_gm_time = &timeinfo; + quickbook::debug_mode = true; + } + else { + time_t t = std::time(0); + static tm lt = *localtime(&t); + static tm gmt = *gmtime(&t); + quickbook::current_time = < + quickbook::current_gm_time = &gmt; + quickbook::debug_mode = false; + } + + quickbook::include_path.clear(); + if (vm.count("include-path")) { + boost::transform( + vm["include-path"].as<std::vector<command_line_string> >(), + std::back_inserter(quickbook::include_path), + quickbook::detail::command_line_to_path); + } + + quickbook::preset_defines.clear(); + if (vm.count("define")) { + boost::transform( + vm["define"].as<std::vector<command_line_string> >(), + std::back_inserter(quickbook::preset_defines), + quickbook::detail::command_line_to_utf8); + } + + if (vm.count("input-file")) { + fs::path filein = quickbook::detail::command_line_to_path( + vm["input-file"].as<command_line_string>()); + + if (!fs::exists(filein)) { + quickbook::detail::outerr() + << "file not found: " << filein << std::endl; + ++error_count; + } + + if (vm.count("output-deps")) { + alt_output_specified = true; + options.deps_out = quickbook::detail::command_line_to_path( + vm["output-deps"].as<command_line_string>()); + } + + if (vm.count("output-deps-format")) { + std::string format_flags = + quickbook::detail::command_line_to_utf8( + vm["output-deps-format"].as<command_line_string>()); + + std::vector<std::string> flag_names; + boost::algorithm::split( + flag_names, format_flags, boost::algorithm::is_any_of(", "), + boost::algorithm::token_compress_on); + + unsigned flags = 0; + + QUICKBOOK_FOR (std::string const& flag, flag_names) { + if (flag == "checked") { + flags |= quickbook::dependency_tracker::checked; + } + else if (flag == "escaped") { + flags |= quickbook::dependency_tracker::escaped; + } + else if (!flag.empty()) { + quickbook::detail::outerr() + << "Unknown dependency format flag: " << flag + << std::endl; + + ++error_count; + } + } + + options.deps_out_flags = + quickbook::dependency_tracker::flags(flags); + } + + if (vm.count("output-checked-locations")) { + alt_output_specified = true; + options.locations_out = quickbook::detail::command_line_to_path( + vm["output-checked-locations"].as<command_line_string>()); + } + + if (vm.count("boost-root-path")) { + // TODO: Check that it's a directory? + options.html_ops.boost_root_path = + vm["boost-root-path"].as<command_line_string>(); + } + // Could possibly default it: + // 'boost:' links will use this anyway, but setting a default + // would also result in default css and graphics paths. + // + // else { + // options.html_ops.boost_root_path = + // quickbook::detail::path_or_url::url( + // "http://www.boost.org/doc/libs/release/"); + //} + + if (vm.count("css-path")) { + options.html_ops.css_path = + vm["css-path"].as<command_line_string>(); + } + else if (options.html_ops.boost_root_path) { + options.html_ops.css_path = + options.html_ops.boost_root_path / "doc/src/boostbook.css"; + } + + if (vm.count("graphics-path")) { + options.html_ops.graphics_path = + vm["graphics-path"].as<command_line_string>(); + } + else if (options.html_ops.boost_root_path) { + options.html_ops.graphics_path = + options.html_ops.boost_root_path / "doc/src/images"; + } + + if (vm.count("output-file")) { + output_specified = true; + switch (options.style) { + case quickbook::parse_document_options::output_file: { + options.output_path = + quickbook::detail::command_line_to_path( + vm["output-file"].as<command_line_string>()); + + fs::path parent = options.output_path.parent_path(); + if (!parent.empty() && !fs::is_directory(parent)) { + quickbook::detail::outerr() + << "parent directory not found for output file" + << std::endl; + ++error_count; + } + break; + } + case quickbook::parse_document_options::output_chunked: + quickbook::detail::outerr() + << "output-file give for chunked output" << std::endl; + ++error_count; + break; + case quickbook::parse_document_options::output_none: + quickbook::detail::outerr() + << "output-file given for no output" << std::endl; + ++error_count; + break; + default: + assert(false); + } + } + + if (vm.count("output-dir")) { + output_specified = true; + switch (options.style) { + case quickbook::parse_document_options::output_chunked: { + options.output_path = + quickbook::detail::command_line_to_path( + vm["output-dir"].as<command_line_string>()); + + if (!fs::is_directory(options.output_path.parent_path())) { + quickbook::detail::outerr() + << "parent directory not found for output directory" + << std::endl; + ++error_count; + } + } + case quickbook::parse_document_options::output_file: + quickbook::detail::outerr() + << "output-dir give for file output" << std::endl; + ++error_count; + break; + case quickbook::parse_document_options::output_none: + quickbook::detail::outerr() + << "output-dir given for no output" << std::endl; + ++error_count; + break; + default: + assert(false); + } + } + + if (!vm.count("output-file") && !vm.count("output-dir")) { + if (!output_specified && alt_output_specified) { + options.style = + quickbook::parse_document_options::output_none; + } + else { + fs::path path = filein; + switch (options.style) { + case quickbook::parse_document_options::output_chunked: + path = path.parent_path() / "html"; + options.style = + quickbook::parse_document_options::output_chunked; + options.output_path = path; + break; + case quickbook::parse_document_options::output_file: + switch (options.format) { + case quickbook::parse_document_options::html: + path.replace_extension(".html"); + break; + case quickbook::parse_document_options::boostbook: + path.replace_extension(".xml"); + break; + default: + assert(false); + path.replace_extension(".xml"); + } + options.output_path = path; + break; + default: + assert(false); + options.style = + quickbook::parse_document_options::output_none; + } + } + } + + if (vm.count("xinclude-base")) { + options.xinclude_base = quickbook::detail::command_line_to_path( + vm["xinclude-base"].as<command_line_string>()); + + // I'm not sure if this error check is necessary. + // There might be valid reasons to use a path that doesn't + // exist yet, or a path that just generates valid relative + // paths. + if (!fs::is_directory(options.xinclude_base)) { + quickbook::detail::outerr() + << "xinclude-base is not a directory" << std::endl; + ++error_count; + } + } + else { + options.xinclude_base = + options.style == parse_document_options::output_chunked + ? options.output_path + : options.output_path.parent_path(); + if (options.xinclude_base.empty()) { + options.xinclude_base = "."; + } + + // If output_path was implicitly created from filein, then it + // should be in filein's directory. + // If output_path was explicitly specified, then it's already + // been checked. + assert(error_count || fs::is_directory(options.xinclude_base)); + } + + if (vm.count("image-location")) { + quickbook::image_location = + quickbook::detail::command_line_to_path( + vm["image-location"].as<command_line_string>()); + } + else { + quickbook::image_location = filein.parent_path() / "html"; + } + + // Set duplicated html_options. + // TODO: Clean this up? + if (options.style == parse_document_options::output_chunked) { + options.html_ops.home_path = options.output_path / "index.html"; + options.html_ops.chunked_output = true; + } + else { + options.html_ops.home_path = options.output_path; + options.html_ops.chunked_output = false; + } + options.html_ops.pretty_print = options.pretty_print; + + if (!error_count) { + switch (options.style) { + case parse_document_options::output_file: + quickbook::detail::out() + << "Generating output file: " << options.output_path + << std::endl; + break; + case parse_document_options::output_chunked: + quickbook::detail::out() + << "Generating output path: " << options.output_path + << std::endl; + break; + case parse_document_options::output_none: + break; + default: + assert(false); + } + + error_count += quickbook::parse_document(filein, options); + } + + if (expect_errors) { + if (!error_count) + quickbook::detail::outerr() + << "No errors detected for --expect-errors." + << std::endl; + return !error_count; + } + else { + return error_count; + } + } + else { + std::ostringstream description_text; + description_text << desc; + + quickbook::detail::outerr() << "No filename given\n\n" + << description_text.str() << std::endl; + return 1; + } + } + + catch (std::exception& e) { + quickbook::detail::outerr() << e.what() << "\n"; + return 1; + } + + catch (...) { + quickbook::detail::outerr() << "Exception of unknown type caught\n"; + return 1; + } + + return 0; +} diff --git a/src/boost/tools/quickbook/src/quickbook.hpp b/src/boost/tools/quickbook/src/quickbook.hpp new file mode 100644 index 000000000..584f81e99 --- /dev/null +++ b/src/boost/tools/quickbook/src/quickbook.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2009 Daniel James + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_QUICKBOOK_HPP) +#define BOOST_SPIRIT_QUICKBOOK_QUICKBOOK_HPP + +#include <string> +#include <time.h> +#include <vector> +#include <boost/filesystem/path.hpp> +#include "fwd.hpp" +#include "values.hpp" + +namespace quickbook +{ + namespace fs = boost::filesystem; + + extern tm* current_time; // the current time + extern tm* current_gm_time; // the current UTC time + extern bool debug_mode; + extern bool self_linked_headers; + extern std::vector<fs::path> include_path; + extern std::vector<std::string> preset_defines; + extern fs::path image_location; + + void parse_file( + quickbook::state& state, + value include_doc_id = value(), + bool nested_file = false); + // Some initialisation methods + // + // Declared here to avoid including other headers + namespace detail + { + void initialise_markups(); + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/scoped.hpp b/src/boost/tools/quickbook/src/scoped.hpp new file mode 100644 index 000000000..483b05f48 --- /dev/null +++ b/src/boost/tools/quickbook/src/scoped.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_SCOPED_HPP) +#define BOOST_QUICKBOOK_SCOPED_HPP + +#include <cassert> + +namespace quickbook +{ + + struct scoped_action_base + { + bool start() { return true; } + template <typename Iterator> void success(Iterator, Iterator) {} + void failure() {} + void cleanup() {} + + template <typename ResultT, typename ScannerT> + bool result(ResultT r, ScannerT const&) + { + return r; + } + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/simple_parse.hpp b/src/boost/tools/quickbook/src/simple_parse.hpp new file mode 100644 index 000000000..efe222c3c --- /dev/null +++ b/src/boost/tools/quickbook/src/simple_parse.hpp @@ -0,0 +1,63 @@ +/*============================================================================= +Copyright (c) 2011-2013, 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +namespace quickbook +{ + template <typename Iterator> + bool read(Iterator& it, Iterator end, char const* text) + { + for (Iterator it2 = it;; ++it2, ++text) { + if (!*text) { + it = it2; + return true; + } + + if (it2 == end || *it2 != *text) return false; + } + } + + template <typename Iterator> + bool read_past(Iterator& it, Iterator end, char const* text) + { + while (it != end) { + if (read(it, end, text)) { + return true; + } + ++it; + } + return false; + } + + inline bool find_char(char const* text, char c) + { + for (; *text; ++text) + if (c == *text) return true; + return false; + } + + template <typename Iterator> + void read_some_of(Iterator& it, Iterator end, char const* text) + { + while (it != end && find_char(text, *it)) + ++it; + } + + template <typename Iterator> + void read_to_one_of(Iterator& it, Iterator end, char const* text) + { + while (it != end && !find_char(text, *it)) + ++it; + } + + template <typename Iterator> + void read_to(Iterator& it, Iterator end, char c) + { + while (it != end && *it != c) + ++it; + } +} diff --git a/src/boost/tools/quickbook/src/state.cpp b/src/boost/tools/quickbook/src/state.cpp new file mode 100644 index 000000000..af57b248b --- /dev/null +++ b/src/boost/tools/quickbook/src/state.cpp @@ -0,0 +1,187 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2005 Thomas Guest + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "state.hpp" +#include "document_state.hpp" +#include "for.hpp" +#include "grammar.hpp" +#include "path.hpp" +#include "phrase_tags.hpp" +#include "quickbook.hpp" +#include "state_save.hpp" +#include "utils.hpp" + +#if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310)) +#pragma warning(disable : 4355) +#endif + +namespace quickbook +{ + char const* quickbook_get_date = "__quickbook_get_date__"; + char const* quickbook_get_time = "__quickbook_get_time__"; + + unsigned qbk_version_n = 0; // qbk_major_version * 100 + qbk_minor_version + + state::state( + fs::path const& filein_, + fs::path const& xinclude_base_, + string_stream& out_, + document_state& document_) + : grammar_() + + , order_pos(0) + , xinclude_base(xinclude_base_) + + , templates() + , error_count(0) + , anchors() + , warned_about_breaks(false) + , conditional(true) + , document(document_) + , callouts() + , callout_depth(0) + , dependencies() + , explicit_list(false) + , strict_mode(false) + + , imported(false) + , macro() + , source_mode() + , source_mode_next() + , source_mode_next_pos() + , current_file(0) + , current_path(filein_, 0, filein_.filename()) + + , template_depth(0) + , min_section_level(1) + + , in_list(false) + , in_list_save() + , out(out_) + , phrase() + + , values(¤t_file) + { + // add the predefined macros + macro.add("__DATE__", std::string(quickbook_get_date))( + "__TIME__", + std::string(quickbook_get_time))("__FILENAME__", std::string()); + update_filename_macro(); + + boost::scoped_ptr<quickbook_grammar> g(new quickbook_grammar(*this)); + grammar_.swap(g); + } + + quickbook_grammar& state::grammar() const { return *grammar_; } + + void state::update_filename_macro() + { + *boost::spirit::classic::find(macro, "__FILENAME__") = + detail::encode_string( + detail::path_to_generic(current_path.abstract_file_path)); + } + + unsigned state::get_new_order_pos() { return ++order_pos; } + + void state::push_output() + { + out.push(); + phrase.push(); + in_list_save.push(in_list); + } + + void state::pop_output() + { + phrase.pop(); + out.pop(); + in_list = in_list_save.top(); + in_list_save.pop(); + } + + source_mode_info state::tagged_source_mode() const + { + source_mode_info result; + + QUICKBOOK_FOR (source_mode_info const& s, tagged_source_mode_stack) { + result.update(s); + } + + return result; + } + + source_mode_info state::current_source_mode() const + { + source_mode_info result = source_mode; + + result.update(document.section_source_mode()); + + QUICKBOOK_FOR (source_mode_info const& s, tagged_source_mode_stack) { + result.update(s); + } + + return result; + } + + void state::change_source_mode(source_mode_type s) + { + source_mode = source_mode_info(s, get_new_order_pos()); + } + + void state::push_tagged_source_mode(source_mode_type s) + { + tagged_source_mode_stack.push_back( + source_mode_info(s, s ? get_new_order_pos() : 0)); + } + + void state::pop_tagged_source_mode() + { + assert(!tagged_source_mode_stack.empty()); + tagged_source_mode_stack.pop_back(); + } + + state_save::state_save(quickbook::state& state_, scope_flags scope_) + : state(state_) + , scope(scope_) + , qbk_version(qbk_version_n) + , imported(state.imported) + , current_file(state.current_file) + , current_path(state.current_path) + , xinclude_base(state.xinclude_base) + , source_mode(state.source_mode) + , macro() + , template_depth(state.template_depth) + , min_section_level(state.min_section_level) + { + if (scope & scope_macros) macro = state.macro; + if (scope & scope_templates) state.templates.push(); + if (scope & scope_output) { + state.push_output(); + } + state.values.builder.save(); + } + + state_save::~state_save() + { + state.values.builder.restore(); + boost::swap(qbk_version_n, qbk_version); + boost::swap(state.imported, imported); + boost::swap(state.current_file, current_file); + boost::swap(state.current_path, current_path); + boost::swap(state.xinclude_base, xinclude_base); + boost::swap(state.source_mode, source_mode); + if (scope & scope_output) { + state.pop_output(); + } + if (scope & scope_templates) state.templates.pop(); + if (scope & scope_macros) state.macro = macro; + boost::swap(state.template_depth, template_depth); + boost::swap(state.min_section_level, min_section_level); + } +} diff --git a/src/boost/tools/quickbook/src/state.hpp b/src/boost/tools/quickbook/src/state.hpp new file mode 100644 index 000000000..022d262d7 --- /dev/null +++ b/src/boost/tools/quickbook/src/state.hpp @@ -0,0 +1,122 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_ACTIONS_CLASS_HPP) +#define BOOST_SPIRIT_ACTIONS_CLASS_HPP + +#include <map> +#include <boost/scoped_ptr.hpp> +#include "collector.hpp" +#include "dependency_tracker.hpp" +#include "include_paths.hpp" +#include "parsers.hpp" +#include "symbols.hpp" +#include "syntax_highlight.hpp" +#include "template_stack.hpp" +#include "values_parse.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + namespace fs = boost::filesystem; + + struct state + { + state( + fs::path const& filein_, + fs::path const& xinclude_base, + string_stream& out_, + document_state&); + + private: + boost::scoped_ptr<quickbook_grammar> grammar_; + + public: + /////////////////////////////////////////////////////////////////////////// + // State + /////////////////////////////////////////////////////////////////////////// + + typedef std::vector<std::string> string_list; + + static int const max_template_depth = 100; + + // global state + unsigned order_pos; + fs::path xinclude_base; + template_stack templates; + int error_count; + string_list anchors; + bool warned_about_breaks; + bool conditional; + document_state& document; + value_builder callouts; // callouts are global as + int callout_depth; // they don't nest. + dependency_tracker dependencies; + bool explicit_list; // set when using a list + bool strict_mode; + + // state saved for files and templates. + bool imported; + string_symbols macro; + source_mode_info source_mode; + source_mode_type source_mode_next; + value source_mode_next_pos; + std::vector<source_mode_info> tagged_source_mode_stack; + file_ptr current_file; + quickbook_path current_path; + + // state saved for templates. + int template_depth; + int min_section_level; + + // output state - scoped by templates and grammar + bool in_list; // generating a list + std::stack<bool> in_list_save; // save the in_list state + collector out; // main output stream + collector phrase; // phrase output stream + + // values state - scoped by everything. + value_parser values; // parsed values + + quickbook_grammar& grammar() const; + + /////////////////////////////////////////////////////////////////////////// + // actions + /////////////////////////////////////////////////////////////////////////// + + void update_filename_macro(); + + unsigned get_new_order_pos(); + + void push_output(); + void pop_output(); + + void start_list(char mark); + void end_list(char mark); + void start_list_item(); + void end_list_item(); + + void start_callouts(); + std::string add_callout(value); + std::string end_callouts(); + + source_mode_info current_source_mode() const; + source_mode_info tagged_source_mode() const; + void change_source_mode(source_mode_type); + void push_tagged_source_mode(source_mode_type); + void pop_tagged_source_mode(); + }; + + extern unsigned + qbk_version_n; // qbk_major_version * 100 + qbk_minor_version + extern char const* quickbook_get_date; + extern char const* quickbook_get_time; +} + +#endif // BOOST_SPIRIT_ACTIONS_CLASS_HPP diff --git a/src/boost/tools/quickbook/src/state_save.hpp b/src/boost/tools/quickbook/src/state_save.hpp new file mode 100644 index 000000000..8f76badde --- /dev/null +++ b/src/boost/tools/quickbook/src/state_save.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_ACTIONS_STATE_HPP) +#define BOOST_SPIRIT_ACTIONS_STATE_HPP + +#include "state.hpp" + +namespace quickbook +{ + // State savers + // + // Defined in state.cpp + + struct state_save + { + enum scope_flags + { + scope_none = 0, + scope_macros = 1, + scope_templates = 2, + scope_output = 4, + scope_callables = scope_macros + scope_templates, + scope_all = scope_callables + scope_output + }; + + explicit state_save(quickbook::state&, scope_flags); + ~state_save(); + + quickbook::state& state; + scope_flags scope; + unsigned qbk_version; + bool imported; + std::string doc_type; + file_ptr current_file; + quickbook_path current_path; + fs::path xinclude_base; + source_mode_info source_mode; + string_symbols macro; + int template_depth; + int min_section_level; + + private: + state_save(state_save const&); + state_save& operator=(state_save const&); + }; +} + +#endif // BOOST_SPIRIT_ACTIONS_STATE_HPP diff --git a/src/boost/tools/quickbook/src/stream.cpp b/src/boost/tools/quickbook/src/stream.cpp new file mode 100644 index 000000000..9aab9c872 --- /dev/null +++ b/src/boost/tools/quickbook/src/stream.cpp @@ -0,0 +1,214 @@ +/*============================================================================= + Copyright (c) 2009 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "stream.hpp" +#include "files.hpp" +#include "path.hpp" + +#if QUICKBOOK_WIDE_PATHS || QUICKBOOK_WIDE_STREAMS +#include <fcntl.h> +#include <io.h> +#endif + +namespace quickbook +{ + namespace detail + { + namespace + { + bool ms_errors = false; + } + + void set_ms_errors(bool x) { ms_errors = x; } + +#if QUICKBOOK_WIDE_STREAMS + + void initialise_output() + { + if (_isatty(_fileno(stdout))) _setmode(_fileno(stdout), _O_U16TEXT); + if (_isatty(_fileno(stderr))) _setmode(_fileno(stderr), _O_U16TEXT); + } + + void write_utf8(ostream::base_ostream& out, quickbook::string_view x) + { + out << from_utf8(x); + } + + ostream& out() + { + static ostream x(std::wcout); + return x; + } + + namespace + { + inline ostream& error_stream() + { + static ostream x(std::wcerr); + return x; + } + } + +#else + + void initialise_output() {} + + void write_utf8(ostream::base_ostream& out, quickbook::string_view x) + { + out << x; + } + + ostream& out() + { + static ostream x(std::cout); + return x; + } + + namespace + { + inline ostream& error_stream() + { + static ostream x(std::clog); + return x; + } + } + +#endif + + ostream& outerr() { return error_stream() << "Error: "; } + + ostream& outerr(fs::path const& file, std::ptrdiff_t line) + { + if (line >= 0) { + if (ms_errors) + return error_stream() << path_to_stream(file) << "(" << line + << "): error: "; + else + return error_stream() << path_to_stream(file) << ":" << line + << ": error: "; + } + else { + return error_stream() << path_to_stream(file) << ": error: "; + } + } + + ostream& outerr(file_ptr const& f, string_iterator pos) + { + return outerr(f->path, f->position_of(pos).line); + } + + ostream& outwarn(fs::path const& file, std::ptrdiff_t line) + { + if (line >= 0) { + if (ms_errors) + return error_stream() << path_to_stream(file) << "(" << line + << "): warning: "; + else + return error_stream() << path_to_stream(file) << ":" << line + << ": warning: "; + } + else { + return error_stream() << path_to_stream(file) << ": warning: "; + } + } + + ostream& outwarn(file_ptr const& f, string_iterator pos) + { + return outwarn(f->path, f->position_of(pos).line); + } + + ostream& ostream::operator<<(char c) + { + assert(c && !(c & 0x80)); + base << c; + return *this; + } + + inline bool check_ascii(char const* x) + { + for (; *x; ++x) + if (*x & 0x80) return false; + return true; + } + + ostream& ostream::operator<<(char const* x) + { + assert(check_ascii(x)); + base << x; + return *this; + } + + ostream& ostream::operator<<(std::string const& x) + { + write_utf8(base, x); + return *this; + } + + ostream& ostream::operator<<(quickbook::string_view x) + { + write_utf8(base, x); + return *this; + } + + ostream& ostream::operator<<(int x) + { + base << x; + return *this; + } + + ostream& ostream::operator<<(unsigned int x) + { + base << x; + return *this; + } + + ostream& ostream::operator<<(long x) + { + base << x; + return *this; + } + + ostream& ostream::operator<<(unsigned long x) + { + base << x; + return *this; + } + +#if !defined(BOOST_NO_LONG_LONG) + ostream& ostream::operator<<(boost::long_long_type x) + { + base << x; + return *this; + } + + ostream& ostream::operator<<(boost::ulong_long_type x) + { + base << x; + return *this; + } +#endif + + ostream& ostream::operator<<(fs::path const& x) + { + base << path_to_stream(x); + return *this; + } + + ostream& ostream::operator<<(base_ostream& (*x)(base_ostream&)) + { + base << x; + return *this; + } + + ostream& ostream::operator<<(base_ios& (*x)(base_ios&)) + { + base << x; + return *this; + } + } +} diff --git a/src/boost/tools/quickbook/src/stream.hpp b/src/boost/tools/quickbook/src/stream.hpp new file mode 100644 index 000000000..48d789710 --- /dev/null +++ b/src/boost/tools/quickbook/src/stream.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + Copyright (c) 2009 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// For handling native strings and streams. + +#if !defined(BOOST_QUICKBOOK_DETAIL_STREAM_HPP) +#define BOOST_QUICKBOOK_DETAIL_STREAM_HPP + +#include <iostream> +#include <boost/filesystem/path.hpp> +#include "native_text.hpp" + +namespace quickbook +{ + namespace fs = boost::filesystem; + + namespace detail + { + // A light wrapper around C++'s streams that gets things right + // in the quickbook context. + // + // This is far from perfect but it fixes some issues. + struct ostream + { + typedef stream_string string; +#if QUICKBOOK_WIDE_STREAMS + typedef std::wostream base_ostream; + typedef std::wios base_ios; +#else + typedef std::ostream base_ostream; + typedef std::ios base_ios; +#endif + base_ostream& base; + + explicit ostream(base_ostream& x) : base(x) {} + + // C strings should always be ascii. + ostream& operator<<(char); + ostream& operator<<(char const*); + + // std::string should be UTF-8 (what a mess!) + ostream& operator<<(std::string const&); + ostream& operator<<(quickbook::string_view); + + // Other value types. + ostream& operator<<(int x); + ostream& operator<<(unsigned int x); + ostream& operator<<(long x); + ostream& operator<<(unsigned long x); + +#if !defined(BOOST_NO_LONG_LONG) + ostream& operator<<(boost::long_long_type x); + ostream& operator<<(boost::ulong_long_type x); +#endif + + ostream& operator<<(fs::path const&); + + // Modifiers + ostream& operator<<(base_ostream& (*)(base_ostream&)); + ostream& operator<<(base_ios& (*)(base_ios&)); + }; + + void initialise_output(); + + ostream& out(); + + // Preformats an error/warning message so that it can be parsed by + // common IDEs. Set 'ms_errors' to determine if VS format + // or GCC format. Returns the stream to continue ouput of the verbose + // error message. + void set_ms_errors(bool); + ostream& outerr(); + ostream& outerr(fs::path const& file, std::ptrdiff_t line = -1); + ostream& outwarn(fs::path const& file, std::ptrdiff_t line = -1); + ostream& outerr(file_ptr const&, string_iterator); + ostream& outwarn(file_ptr const&, string_iterator); + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/string_view.hpp b/src/boost/tools/quickbook/src/string_view.hpp new file mode 100644 index 000000000..71788c04f --- /dev/null +++ b/src/boost/tools/quickbook/src/string_view.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2017 Daniel James + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP) +#define BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP + +#include <boost/functional/hash/hash_fwd.hpp> +#include <boost/utility/string_view.hpp> + +namespace quickbook +{ + // boost::string_view now can't be constructed from an rvalue std::string, + // which is something that quickbook does in several places, so this wraps + // it to allow that. + + struct string_view : boost::string_view + { + typedef boost::string_view base; + + string_view() : base() {} + string_view(string_view const& x) : base(x) {} + string_view(std::string const& x) : base(x) {} + string_view(const char* x) : base(x) {} + string_view(const char* x, base::size_type len) : base(x, len) {} + + std::string to_s() const { return std::string(begin(), end()); } + }; + + typedef quickbook::string_view::const_iterator string_iterator; + + inline std::size_t hash_value(string_view const& x) + { + return boost::hash_range(x.begin(), x.end()); + } + + inline std::string& operator+=(std::string& x, string_view const& y) + { + return x.append(y.begin(), y.end()); + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/symbols.hpp b/src/boost/tools/quickbook/src/symbols.hpp new file mode 100644 index 000000000..1d16c35cf --- /dev/null +++ b/src/boost/tools/quickbook/src/symbols.hpp @@ -0,0 +1,202 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2011 Daniel James + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef QUICKBOOK_SYMBOLS_IPP +#define QUICKBOOK_SYMBOLS_IPP + +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/intrusive_ptr.hpp> +#include <boost/scoped_ptr.hpp> +#include <boost/spirit/home/classic/symbols.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace quickbook +{ + + /////////////////////////////////////////////////////////////////////////////// + // + // tst class + // + // This it the Ternary Search Tree from + // <boost/spirit/home/classic/symbols/impl/tst.ipp> adapted to be cheap + // to copy. + // + // Ternary Search Tree implementation. The data structure is faster + // than + // hashing for many typical search problems especially when the search + // interface is iterator based. Searching for a string of length k in a + // ternary search tree with n strings will require at most O(log n+k) + // character comparisons. TSTs are many times faster than hash tables + // for unsuccessful searches since mismatches are discovered earlier + // after examining only a few characters. Hash tables always examine an + // entire key when searching. + // + // For details see http://www.cs.princeton.edu/~rs/strings/. + // + // *** This is a low level class and is + // not meant for public consumption *** + // + /////////////////////////////////////////////////////////////////////////////// + + template <typename T, typename CharT> struct tst_node + { + tst_node(CharT value_) + : reference_count(0) + , left() + , middle() + , right() + , data() + , value(value_) + { + } + + tst_node(tst_node const& other) + : reference_count(0) + , left(other.left) + , middle(other.middle) + , right(other.right) + , data(other.data ? new T(*other.data) : 0) + , value(other.value) + { + } + + // If you fancy a slight improvement in memory use, + // reference_count + value could probably be packed + // in the space for a single int. + int reference_count; + boost::intrusive_ptr<tst_node> left; + boost::intrusive_ptr<tst_node> middle; + boost::intrusive_ptr<tst_node> right; + boost::scoped_ptr<T> data; + CharT value; + + private: + tst_node& operator=(tst_node const&); + }; + + template <typename T, typename CharT> + void intrusive_ptr_add_ref(tst_node<T, CharT>* ptr) + { + ++ptr->reference_count; + } + + template <typename T, typename CharT> + void intrusive_ptr_release(tst_node<T, CharT>* ptr) + { + if (--ptr->reference_count == 0) delete ptr; + } + + /////////////////////////////////////////////////////////////////////////// + template <typename T, typename CharT> class tst + { + typedef tst_node<T, CharT> node_t; + typedef boost::intrusive_ptr<node_t> node_ptr; + node_ptr root; + + public: + struct search_info + { + T* data; + std::size_t length; + }; + + void swap(tst& other) { root.swap(other.root); } + + // Adds symbol to ternary search tree. + // If it already exists, then replace it with new value. + // + // pre: first != last + template <typename IteratorT> + T* add(IteratorT first, IteratorT const& last, T const& data) + { + assert(first != last); + + node_ptr* np = &root; + CharT ch = *first; + + for (;;) { + if (!*np) { + *np = new node_t(ch); + } + else if ((*np)->reference_count > 1) { + *np = new node_t(**np); + } + + if (ch < (*np)->value) { + np = &(*np)->left; + } + else if (ch == (*np)->value) { + ++first; + if (first == last) break; + ch = *first; + np = &(*np)->middle; + } + else { + np = &(*np)->right; + } + } + + boost::scoped_ptr<T> new_data(new T(data)); + boost::swap((*np)->data, new_data); + return (*np)->data.get(); + } + + template <typename ScannerT> + search_info find(ScannerT const& scan) const + { + search_info result = {0, 0}; + if (scan.at_end()) { + return result; + } + + typedef typename ScannerT::iterator_t iterator_t; + node_ptr np = root; + CharT ch = *scan; + iterator_t latest = scan.first; + std::size_t length = 0; + + while (np) { + if (ch < np->value) // => go left! + { + np = np->left; + } + else if (ch == np->value) // => go middle! + { + ++scan; + ++length; + + // Found a potential match. + if (np->data.get()) { + result.data = np->data.get(); + result.length = length; + latest = scan.first; + } + + if (scan.at_end()) break; + ch = *scan; + np = np->middle; + } + else // (ch > np->value) => go right! + { + np = np->right; + } + } + + scan.first = latest; + return result; + } + }; + + typedef boost::spirit::classic:: + symbols<std::string, char, quickbook::tst<std::string, char> > + string_symbols; +} // namespace quickbook + +#endif diff --git a/src/boost/tools/quickbook/src/syntax_highlight.cpp b/src/boost/tools/quickbook/src/syntax_highlight.cpp new file mode 100644 index 000000000..f6a6d3e82 --- /dev/null +++ b/src/boost/tools/quickbook/src/syntax_highlight.cpp @@ -0,0 +1,633 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "syntax_highlight.hpp" +#include <boost/spirit/include/classic_chset.hpp> +#include <boost/spirit/include/classic_confix.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_loops.hpp> +#include <boost/spirit/include/classic_symbols.hpp> +#include "actions.hpp" +#include "files.hpp" +#include "grammar.hpp" +#include "phrase_tags.hpp" +#include "state.hpp" +#include "stream.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace cl = boost::spirit::classic; + + // Syntax Highlight Actions + + struct syntax_highlight_actions + { + quickbook::state& state; + do_macro_action do_macro_impl; + + // State + bool support_callouts; + quickbook::string_view marked_text; + + syntax_highlight_actions(quickbook::state& state_, bool is_block_) + : state(state_) + , do_macro_impl(state_) + , support_callouts( + is_block_ && (qbk_version_n >= 107u || + state.current_file->is_code_snippets)) + , marked_text() + { + } + + void span(parse_iterator, parse_iterator, char const*); + void span_start(parse_iterator, parse_iterator, char const*); + void span_end(parse_iterator, parse_iterator); + void unexpected_char(parse_iterator, parse_iterator); + void plain_char(parse_iterator, parse_iterator); + void pre_escape_back(parse_iterator, parse_iterator); + void post_escape_back(parse_iterator, parse_iterator); + void do_macro(std::string const&); + + void mark_text(parse_iterator, parse_iterator); + void callout(parse_iterator, parse_iterator); + }; + + void syntax_highlight_actions::span( + parse_iterator first, parse_iterator last, char const* name) + { + state.phrase << "<phrase role=\"" << name << "\">"; + while (first != last) + detail::print_char(*first++, state.phrase.get()); + state.phrase << "</phrase>"; + } + + void syntax_highlight_actions::span_start( + parse_iterator first, parse_iterator last, char const* name) + { + state.phrase << "<phrase role=\"" << name << "\">"; + while (first != last) + detail::print_char(*first++, state.phrase.get()); + } + + void syntax_highlight_actions::span_end( + parse_iterator first, parse_iterator last) + { + while (first != last) + detail::print_char(*first++, state.phrase.get()); + state.phrase << "</phrase>"; + } + + void syntax_highlight_actions::unexpected_char( + parse_iterator first, parse_iterator last) + { + file_position const pos = state.current_file->position_of(first.base()); + + detail::outwarn(state.current_file->path, pos.line) + << "in column:" << pos.column << ", unexpected character: " + << std::string(first.base(), last.base()) << "\n"; + + // print out an unexpected character + state.phrase << "<phrase role=\"error\">"; + while (first != last) + detail::print_char(*first++, state.phrase.get()); + state.phrase << "</phrase>"; + } + + void syntax_highlight_actions::plain_char( + parse_iterator first, parse_iterator last) + { + while (first != last) + detail::print_char(*first++, state.phrase.get()); + } + + void syntax_highlight_actions::pre_escape_back( + parse_iterator, parse_iterator) + { + state.push_output(); // save the stream + } + + void syntax_highlight_actions::post_escape_back( + parse_iterator, parse_iterator) + { + std::string tmp; + state.phrase.swap(tmp); + state.pop_output(); // restore the stream + state.phrase << tmp; + } + + void syntax_highlight_actions::do_macro(std::string const& v) + { + do_macro_impl(v); + } + + void syntax_highlight_actions::mark_text( + parse_iterator first, parse_iterator last) + { + marked_text = + quickbook::string_view(first.base(), last.base() - first.base()); + } + + void syntax_highlight_actions::callout(parse_iterator, parse_iterator) + { + state.phrase << state.add_callout(qbk_value( + state.current_file, marked_text.begin(), marked_text.end())); + marked_text.clear(); + } + + // Syntax + + struct keywords_holder + { + cl::symbols<> cpp, python; + + keywords_holder() + { + // clang-format off + + cpp + = "alignas", "alignof", "and_eq", "and", "asm", "auto", + "bitand", "bitor", "bool", "break", "case", "catch", + "char", "char16_t", "char32_t", "class", "compl", + "const", "const_cast", "constexpr", "continue", + "decltype", "default", "delete", "do", "double", + "dynamic_cast", "else", "enum", "explicit", "export", + "extern", "false", "float", "for", "friend", "goto", + "if", "inline", "int", "long", "mutable", "namespace", + "new", "noexcept", "not_eq", "not", "nullptr", + "operator", "or_eq", "or", "private", "protected", + "public", "register", "reinterpret_cast", "return", + "short", "signed", "sizeof", "static", "static_assert", + "static_cast", "struct", "switch", "template", "this", + "thread_local", "throw", "true", "try", "typedef", + "typeid", "typename", "union", "unsigned", "using", + "virtual", "void", "volatile", "wchar_t", "while", + "xor_eq", "xor" + ; + + python + = + "and", "del", "for", "is", "raise", + "assert", "elif", "from", "lambda", "return", + "break", "else", "global", "not", "try", + "class", "except", "if", "or", "while", + "continue", "exec", "import", "pass", "yield", + "def", "finally", "in", "print", + + // Technically "as" and "None" are not yet keywords (at Python + // 2.4). They are destined to become keywords, and we treat them + // as such for syntax highlighting purposes. + + "as", "None" + ; + + // clang-format on + } + }; + + namespace + { + keywords_holder keywords; + } + + // Grammar for C++ highlighting + struct cpp_highlight : public cl::grammar<cpp_highlight> + { + explicit cpp_highlight(syntax_highlight_actions& actions_) + : actions(actions_) + { + } + + template <typename Scanner> struct definition + { + definition(cpp_highlight const& self) + : g(self.actions.state.grammar()) + { + // clang-format off + + member_action1<syntax_highlight_actions, char const*> + span(self.actions, &syntax_highlight_actions::span), + span_start(self.actions, &syntax_highlight_actions::span_start); + member_action<syntax_highlight_actions> + span_end(self.actions, &syntax_highlight_actions::span_end), + unexpected_char(self.actions, &syntax_highlight_actions::unexpected_char), + plain_char(self.actions, &syntax_highlight_actions::plain_char), + pre_escape_back(self.actions, &syntax_highlight_actions::pre_escape_back), + post_escape_back(self.actions, &syntax_highlight_actions::post_escape_back), + mark_text(self.actions, &syntax_highlight_actions::mark_text), + callout(self.actions, &syntax_highlight_actions::callout); + member_action_value<syntax_highlight_actions, std::string const&> + do_macro(self.actions, &syntax_highlight_actions::do_macro); + error_action error(self.actions.state); + + program = + *( (*cl::space_p) [plain_char] + >> (line_start | rest_of_line) + >> *rest_of_line + ) + ; + + line_start = + preprocessor [span("preprocessor")] + ; + + rest_of_line = + (+cl::blank_p) [plain_char] + | macro + | escape + | cl::eps_p(ph::var(self.actions.support_callouts)) + >> ( line_callout [callout] + | inline_callout [callout] + ) + | comment + | keyword [span("keyword")] + | identifier [span("identifier")] + | special [span("special")] + | string_ [span("string")] + | char_ [span("char")] + | number [span("number")] + | ~cl::eps_p(cl::eol_p) + >> u8_codepoint_p [unexpected_char] + ; + + macro = + // must not be followed by alpha or underscore + cl::eps_p(self.actions.state.macro + >> (cl::eps_p - (cl::alpha_p | '_'))) + >> self.actions.state.macro + [do_macro] + ; + + escape = + cl::str_p("``") [pre_escape_back] + >> + ( + ( + ( + (+(cl::anychar_p - "``") >> cl::eps_p("``")) + & g.phrase_start + ) + >> cl::str_p("``") + ) + | + ( + cl::eps_p [error] + >> *cl::anychar_p + ) + ) [post_escape_back] + ; + + preprocessor + = '#' >> *cl::space_p >> ((cl::alpha_p | '_') >> *(cl::alnum_p | '_')) + ; + + inline_callout + = cl::confix_p( + "/*<" >> *cl::space_p, + (*cl::anychar_p) [mark_text], + ">*/" + ) + ; + + line_callout + = cl::confix_p( + "/*<<" >> *cl::space_p, + (*cl::anychar_p) [mark_text], + ">>*/" + ) + >> *cl::space_p + ; + + comment + = cl::str_p("//") [span_start("comment")] + >> *( escape + | (+(cl::anychar_p - (cl::eol_p | "``"))) + [plain_char] + ) + >> cl::eps_p [span_end] + | cl::str_p("/*") [span_start("comment")] + >> *( escape + | (+(cl::anychar_p - (cl::str_p("*/") | "``"))) + [plain_char] + ) + >> (!cl::str_p("*/")) [span_end] + ; + + keyword + = keywords.cpp >> (cl::eps_p - (cl::alnum_p | '_')) + ; // make sure we recognize whole words only + + special + = +cl::chset_p("~!%^&*()+={[}]:;,<.>?/|\\#-") + ; + + string_char = ('\\' >> u8_codepoint_p) | (cl::anychar_p - '\\'); + + string_ + = !cl::as_lower_d['l'] >> cl::confix_p('"', *string_char, '"') + ; + + char_ + = !cl::as_lower_d['l'] >> cl::confix_p('\'', *string_char, '\'') + ; + + number + = ( + cl::as_lower_d["0x"] >> cl::hex_p + | '0' >> cl::oct_p + | cl::real_p + ) + >> *cl::as_lower_d[cl::chset_p("ldfu")] + ; + + identifier + = (cl::alpha_p | '_') >> *(cl::alnum_p | '_') + ; + + // clang-format on + } + + cl::rule<Scanner> program, line_start, rest_of_line, macro, + preprocessor, inline_callout, line_callout, comment, special, + string_, char_, number, identifier, keyword, escape, + string_char; + + quickbook_grammar& g; + + cl::rule<Scanner> const& start() const { return program; } + }; + + syntax_highlight_actions& actions; + }; + + // Grammar for Python highlighting + // See also: The Python Reference Manual + // http://docs.python.org/ref/ref.html + struct python_highlight : public cl::grammar<python_highlight> + { + explicit python_highlight(syntax_highlight_actions& actions_) + : actions(actions_) + { + } + + template <typename Scanner> struct definition + { + definition(python_highlight const& self) + : g(self.actions.state.grammar()) + { + // clang-format off + + member_action1<syntax_highlight_actions, char const*> + span(self.actions, &syntax_highlight_actions::span), + span_start(self.actions, &syntax_highlight_actions::span_start); + member_action<syntax_highlight_actions> + span_end(self.actions, &syntax_highlight_actions::span_end), + unexpected_char(self.actions, &syntax_highlight_actions::unexpected_char), + plain_char(self.actions, &syntax_highlight_actions::plain_char), + pre_escape_back(self.actions, &syntax_highlight_actions::pre_escape_back), + post_escape_back(self.actions, &syntax_highlight_actions::post_escape_back), + mark_text(self.actions, &syntax_highlight_actions::mark_text), + callout(self.actions, &syntax_highlight_actions::callout); + member_action_value<syntax_highlight_actions, std::string const&> + do_macro(self.actions, &syntax_highlight_actions::do_macro); + error_action error(self.actions.state); + + program + = + *( (+cl::space_p) [plain_char] + | macro + | escape + | cl::eps_p(ph::var(self.actions.support_callouts)) + >> ( line_callout [callout] + | inline_callout [callout] + ) + | comment + | keyword [span("keyword")] + | identifier [span("identifier")] + | special [span("special")] + | string_ [span("string")] + | number [span("number")] + | u8_codepoint_p [unexpected_char] + ) + ; + + macro = + // must not be followed by alpha or underscore + cl::eps_p(self.actions.state.macro + >> (cl::eps_p - (cl::alpha_p | '_'))) + >> self.actions.state.macro + [do_macro] + ; + + escape = + cl::str_p("``") [pre_escape_back] + >> + ( + ( + ( + (+(cl::anychar_p - "``") >> cl::eps_p("``")) + & g.phrase_start + ) + >> cl::str_p("``") + ) + | + ( + cl::eps_p [error] + >> *cl::anychar_p + ) + ) [post_escape_back] + ; + + inline_callout + = "#<" >> *cl::space_p >> + (*(cl::anychar_p - cl::eol_p)) [mark_text] + ; + + line_callout + = cl::confix_p( + "#<<" >> *cl::space_p, + (*cl::anychar_p) [mark_text], + (cl::eol_p | cl::end_p) + ) + ; + + comment + = cl::str_p("#") [span_start("comment")] + >> *( escape + | (+(cl::anychar_p - (cl::eol_p | "``"))) + [plain_char] + ) + >> cl::eps_p [span_end] + ; + + keyword + = keywords.python >> (cl::eps_p - (cl::alnum_p | '_')) + ; // make sure we recognize whole words only + + special + = +cl::chset_p("~!%^&*()+={[}]:;,<.>/|\\-") + ; + + string_prefix + = cl::as_lower_d[cl::str_p("u") >> ! cl::str_p("r")] + ; + + string_ + = ! string_prefix >> (long_string | short_string) + ; + + string_char = ('\\' >> u8_codepoint_p) | (cl::anychar_p - '\\'); + + short_string + = cl::confix_p('\'', * string_char, '\'') | + cl::confix_p('"', * string_char, '"') + ; + + long_string + // Note: the "cl::str_p" on the next two lines work around + // an INTERNAL COMPILER ERROR when using VC7.1 + = cl::confix_p(cl::str_p("'''"), * string_char, "'''") | + cl::confix_p(cl::str_p("\"\"\""), * string_char, "\"\"\"") + ; + + number + = ( + cl::as_lower_d["0x"] >> cl::hex_p + | '0' >> cl::oct_p + | cl::real_p + ) + >> *cl::as_lower_d[cl::chset_p("lj")] + ; + + identifier + = (cl::alpha_p | '_') >> *(cl::alnum_p | '_') + ; + + // clang-format on + } + + cl::rule<Scanner> program, macro, inline_callout, line_callout, + comment, special, string_, string_prefix, short_string, + long_string, number, identifier, keyword, escape, string_char; + + quickbook_grammar& g; + + cl::rule<Scanner> const& start() const { return program; } + }; + + syntax_highlight_actions& actions; + }; + + // Grammar for plain text (no actual highlighting) + struct teletype_highlight : public cl::grammar<teletype_highlight> + { + teletype_highlight(syntax_highlight_actions& actions_) + : actions(actions_) + { + } + + template <typename Scanner> struct definition + { + definition(teletype_highlight const& self) + : g(self.actions.state.grammar()) + { + member_action<syntax_highlight_actions> plain_char( + self.actions, &syntax_highlight_actions::plain_char), + pre_escape_back( + self.actions, + &syntax_highlight_actions::pre_escape_back), + post_escape_back( + self.actions, + &syntax_highlight_actions::post_escape_back); + member_action_value< + syntax_highlight_actions, std::string const&> + do_macro(self.actions, &syntax_highlight_actions::do_macro); + error_action error(self.actions.state); + + // clang-format off + + program + = + *( macro + | escape + | u8_codepoint_p [plain_char] + ) + ; + + macro = + // must not be followed by alpha or underscore + cl::eps_p(self.actions.state.macro + >> (cl::eps_p - (cl::alpha_p | '_'))) + >> self.actions.state.macro + [do_macro] + ; + + escape = + cl::str_p("``") [pre_escape_back] + >> + ( + ( + ( + (+(cl::anychar_p - "``") >> cl::eps_p("``")) + & g.phrase_start + ) + >> cl::str_p("``") + ) + | + ( + cl::eps_p [error] + >> *cl::anychar_p + ) + ) [post_escape_back] + ; + + // clang-format on + } + + cl::rule<Scanner> program, macro, escape; + + quickbook_grammar& g; + + cl::rule<Scanner> const& start() const { return program; } + }; + + syntax_highlight_actions& actions; + }; + + void syntax_highlight( + parse_iterator first, + parse_iterator last, + quickbook::state& state, + source_mode_type source_mode, + bool is_block) + { + syntax_highlight_actions syn_actions(state, is_block); + + // print the code with syntax coloring + switch (source_mode) { + case source_mode_tags::cpp: { + cpp_highlight cpp_p(syn_actions); + boost::spirit::classic::parse(first, last, cpp_p); + break; + } + case source_mode_tags::python: { + python_highlight python_p(syn_actions); + boost::spirit::classic::parse(first, last, python_p); + break; + } + case source_mode_tags::teletype: { + teletype_highlight teletype_p(syn_actions); + boost::spirit::classic::parse(first, last, teletype_p); + break; + } + default: + BOOST_ASSERT(0); + } + } +} diff --git a/src/boost/tools/quickbook/src/syntax_highlight.hpp b/src/boost/tools/quickbook/src/syntax_highlight.hpp new file mode 100644 index 000000000..74e1ab7e8 --- /dev/null +++ b/src/boost/tools/quickbook/src/syntax_highlight.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2011,2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP) +#define BOOST_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP + +#include <boost/swap.hpp> +#include "fwd.hpp" +#include "iterator.hpp" +#include "phrase_tags.hpp" + +namespace quickbook +{ + // + // source_mode_info + // + // The source mode is stored in a few places, so the order needs to also be + // stored to work out which is the current source mode. + + struct source_mode_info + { + source_mode_type source_mode; + unsigned order; + + source_mode_info() : source_mode(source_mode_tags::cpp), order(0) {} + + source_mode_info(source_mode_type source_mode_, unsigned order_) + : source_mode(source_mode_), order(order_) + { + } + + void update(source_mode_info const& x) + { + if (x.order > order) { + source_mode = x.source_mode; + order = x.order; + } + } + + void swap(source_mode_info& x) + { + boost::swap(source_mode, x.source_mode); + boost::swap(order, x.order); + } + }; + + inline void swap(source_mode_info& x, source_mode_info& y) { x.swap(y); } + + void syntax_highlight( + parse_iterator first, + parse_iterator last, + quickbook::state& state, + source_mode_type source_mode, + bool is_block); +} + +#endif diff --git a/src/boost/tools/quickbook/src/template_stack.cpp b/src/boost/tools/quickbook/src/template_stack.cpp new file mode 100644 index 000000000..404780974 --- /dev/null +++ b/src/boost/tools/quickbook/src/template_stack.cpp @@ -0,0 +1,117 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "template_stack.hpp" +#include <cassert> +#include "files.hpp" + +#ifdef BOOST_MSVC +#pragma warning(disable : 4355) +#endif + +namespace quickbook +{ + template_symbol::template_symbol( + std::string const& identifier_, + std::vector<std::string> const& params_, + value const& content_, + template_scope const* lexical_parent_) + : identifier(identifier_) + , params(params_) + , content(content_) + , lexical_parent(lexical_parent_) + { + assert( + content.get_tag() == template_tags::block || + content.get_tag() == template_tags::phrase || + content.get_tag() == template_tags::snippet); + } + + template_stack::template_stack() + : scope(template_stack::parser(*this)), scopes(), parent_1_4(0) + { + scopes.push_front(template_scope()); + parent_1_4 = &scopes.front(); + } + + template_symbol* template_stack::find(std::string const& symbol) const + { + for (template_scope const* i = &*scopes.begin(); i; + i = i->parent_scope) { + if (template_symbol* ts = + boost::spirit::classic::find(i->symbols, symbol.c_str())) + return ts; + } + return 0; + } + + template_symbol* template_stack::find_top_scope( + std::string const& symbol) const + { + return boost::spirit::classic::find( + scopes.front().symbols, symbol.c_str()); + } + + template_symbols const& template_stack::top() const + { + BOOST_ASSERT(!scopes.empty()); + return scopes.front().symbols; + } + + template_scope const& template_stack::top_scope() const + { + BOOST_ASSERT(!scopes.empty()); + return scopes.front(); + } + + bool template_stack::add(template_symbol const& ts) + { + BOOST_ASSERT(!scopes.empty()); + BOOST_ASSERT(ts.lexical_parent); + + if (this->find_top_scope(ts.identifier)) { + return false; + } + + boost::spirit::classic::add( + scopes.front().symbols, ts.identifier.c_str(), ts); + + return true; + } + + void template_stack::push() + { + template_scope const& old_front = scopes.front(); + scopes.push_front(template_scope()); + scopes.front().parent_1_4 = parent_1_4; + scopes.front().parent_scope = &old_front; + parent_1_4 = &scopes.front(); + } + + void template_stack::pop() + { + parent_1_4 = scopes.front().parent_1_4; + scopes.pop_front(); + } + + void template_stack::start_template(template_symbol const* symbol) + { + // Quickbook 1.4-: When expanding the template continue to use the + // current scope (the dynamic scope). + // Quickbook 1.5+: Use the scope the template was defined in + // (the static scope). + if (symbol->content.get_file()->version() >= 105u) { + parent_1_4 = scopes.front().parent_1_4; + scopes.front().parent_scope = symbol->lexical_parent; + } + else { + scopes.front().parent_scope = scopes.front().parent_1_4; + } + } +} diff --git a/src/boost/tools/quickbook/src/template_stack.hpp b/src/boost/tools/quickbook/src/template_stack.hpp new file mode 100644 index 000000000..9ad2251ca --- /dev/null +++ b/src/boost/tools/quickbook/src/template_stack.hpp @@ -0,0 +1,126 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_TEMPLATE_STACK_HPP) +#define BOOST_SPIRIT_QUICKBOOK_TEMPLATE_STACK_HPP + +#include <cassert> +#include <deque> +#include <string> +#include <vector> +#include <boost/assert.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/next_prior.hpp> +#include <boost/spirit/include/classic_functor_parser.hpp> +#include <boost/spirit/include/classic_symbols.hpp> +#include <boost/tuple/tuple.hpp> +#include "fwd.hpp" +#include "template_tags.hpp" +#include "values.hpp" + +namespace quickbook +{ + namespace fs = boost::filesystem; + + struct template_scope; + + struct template_symbol + { + template_symbol( + std::string const& identifier, + std::vector<std::string> const& params, + value const& content, + template_scope const* parent = 0); + + std::string identifier; + std::vector<std::string> params; + value content; + + template_scope const* lexical_parent; + }; + + typedef boost::spirit::classic::symbols<template_symbol> template_symbols; + + // template scope + // + // 1.4-: parent_scope is the previous scope on the dynamic + // lookup chain. This moves up the stack skipping + // 1.5 templates (but not 1.5 included files). + // 1.5+: parent_scope is the template's lexical parent. + // + // This means that a search along the parent_scope chain will follow the + // correct lookup chain for that version of quickboook. + // + // symbols contains the templates defined in this scope. + + struct template_scope + { + template_scope() : parent_scope(), parent_1_4() {} + template_scope const* parent_scope; + template_scope const* parent_1_4; + template_symbols symbols; + }; + + struct template_stack + { + typedef std::deque<template_scope> deque; + + struct parser + { + typedef boost::spirit::classic::nil_t result_t; + + parser(template_stack& ts_) : ts(ts_) {} + + template <typename Scanner> + std::ptrdiff_t operator()(Scanner const& scan, result_t) const + { + // search all scopes for the longest matching symbol. + typename Scanner::iterator_t f = scan.first; + std::ptrdiff_t len = -1; + for (template_scope const* i = &*ts.scopes.begin(); i; + i = i->parent_scope) { + boost::spirit::classic::match<> m = i->symbols.parse(scan); + if (m.length() > len) len = m.length(); + scan.first = f; + } + if (len >= 0) scan.first = boost::next(f, len); + return len; + } + + template_stack& ts; + + private: + parser& operator=(parser const&); + }; + + template_stack(); + template_symbol* find(std::string const& symbol) const; + template_symbol* find_top_scope(std::string const& symbol) const; + template_symbols const& top() const; + template_scope const& top_scope() const; + // Add the given template symbol to the current scope. + // If it doesn't have a scope, sets the symbol's scope to the current + // scope. + bool add(template_symbol const&); + void push(); + void pop(); + + void start_template(template_symbol const*); + + boost::spirit::classic::functor_parser<parser> scope; + + private: + friend struct parser; + deque scopes; + template_scope const* parent_1_4; + + template_stack& operator=(template_stack const&); + }; +} + +#endif // BOOST_SPIRIT_QUICKBOOK_TEMPLATE_STACK_HPP diff --git a/src/boost/tools/quickbook/src/template_tags.hpp b/src/boost/tools/quickbook/src/template_tags.hpp new file mode 100644 index 000000000..006200cbd --- /dev/null +++ b/src/boost/tools/quickbook/src/template_tags.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_TEMPLATE_TAGS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_TEMPLATE_TAGS_HPP + +#include "value_tags.hpp" + +namespace quickbook +{ + // clang-format off + + QUICKBOOK_VALUE_TAGS(template_tags, 0x100, + (template_) + (attribute_template) + (escape) + (identifier) + (block) + (phrase) + (snippet) + ) + + // clang-format on +} + +#endif diff --git a/src/boost/tools/quickbook/src/tree.cpp b/src/boost/tools/quickbook/src/tree.cpp new file mode 100644 index 000000000..1f16b9320 --- /dev/null +++ b/src/boost/tools/quickbook/src/tree.cpp @@ -0,0 +1,205 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "tree.hpp" +#include <cassert> + +namespace quickbook +{ + namespace detail + { + void tree_node_base::add_before(tree_base* t) + { + assert( + t->root_ && !t->root_->parent_ && !t->root_->prev_ && + !t->root_->next_); + t->root_->parent_ = this->parent_; + t->root_->next_ = this; + if (this->prev_) { + t->root_->prev_ = this->prev_; + this->prev_->next_ = t->root_; + } + else { + this->parent_->children_ = t->root_; + } + this->prev_ = t->root_; + t->root_ = 0; + } + + void tree_node_base::add_after(tree_base* t) + { + assert( + t->root_ && !t->root_->parent_ && !t->root_->prev_ && + !t->root_->next_); + t->root_->parent_ = this->parent_; + t->root_->prev_ = this; + t->root_->next_ = this->next_; + if (this->next_) this->next_->prev_ = t->root_; + this->next_ = t->root_; + t->root_ = 0; + } + + void tree_node_base::add_first_child(tree_base* t) + { + assert( + t->root_ && !t->root_->parent_ && !t->root_->prev_ && + !t->root_->next_); + t->root_->parent_ = this; + t->root_->next_ = this->children_; + if (this->children_) { + this->children_->prev_ = t->root_; + } + this->children_ = t->root_; + t->root_ = 0; + } + + void tree_node_base::add_last_child(tree_base* t) + { + assert( + t->root_ && !t->root_->parent_ && !t->root_->prev_ && + !t->root_->next_); + t->root_->parent_ = this; + if (!this->children_) { + this->children_ = t->root_; + } + else { + auto it = this->children_; + while (it->next_) { + it = it->next_; + } + t->root_->prev_ = it; + it->next_ = t->root_; + } + t->root_ = 0; + } + + tree_base::tree_base() : root_(0) {} + tree_base::tree_base(tree_node_base* r) : root_(r) {} + tree_base::~tree_base() {} + + tree_base::tree_base(tree_base&& x) : root_(x.root_) { x.root_ = 0; } + + tree_base& tree_base::operator=(tree_base&& x) + { + root_ = x.root_; + x.root_ = 0; + return *this; + } + + tree_node_base* tree_base::extract(tree_node_base* x) + { + if (!x->prev_) { + if (x->parent_) { + x->parent_->children_ = x->next_; + } + else { + assert(x == root_); + root_ = x->next_; + } + } + else { + x->prev_->next_ = x->next_; + } + if (x->next_) { + x->next_->prev_ = x->prev_; + } + x->parent_ = 0; + x->next_ = 0; + x->prev_ = 0; + return x; + } + + tree_builder_base::tree_builder_base() + : tree_base(), current_(0), parent_(0) + { + } + + tree_builder_base::tree_builder_base(tree_builder_base&& x) + : tree_base(std::move(x)), current_(x.current_), parent_(x.parent_) + { + x.current_ = 0; + x.parent_ = 0; + } + + tree_builder_base& tree_builder_base::operator=(tree_builder_base&& x) + { + root_ = x.root_; + current_ = x.current_; + parent_ = x.parent_; + x.root_ = 0; + x.current_ = 0; + x.parent_ = 0; + return *this; + } + + // Nodes are deleted in the subclass, which knows their type. + tree_builder_base::~tree_builder_base() {} + + tree_node_base* tree_builder_base::extract(tree_node_base* x) + { + if (!x->prev_) { + if (x->parent_) { + x->parent_->children_ = x->next_; + } + else { + assert(x == root_); + root_ = x->next_; + parent_ = 0; + current_ = root_; + } + } + else { + x->prev_->next_ = x->next_; + } + if (x->next_) { + x->next_->prev_ = x->prev_; + } + x->parent_ = 0; + x->next_ = 0; + x->prev_ = 0; + return x; + } + + tree_node_base* tree_builder_base::release() + { + tree_node_base* n = root_; + root_ = 0; + current_ = 0; + parent_ = 0; + return n; + } + + void tree_builder_base::add_element(tree_node_base* n) + { + n->parent_ = parent_; + n->prev_ = current_; + if (current_) { + current_->next_ = n; + } + else if (parent_) { + parent_->children_ = n; + } + else { + root_ = n; + } + current_ = n; + } + + void tree_builder_base::start_children() + { + parent_ = current_; + current_ = 0; + } + + void tree_builder_base::end_children() + { + current_ = parent_; + parent_ = current_->parent_; + } + } +} diff --git a/src/boost/tools/quickbook/src/tree.hpp b/src/boost/tools/quickbook/src/tree.hpp new file mode 100644 index 000000000..7503b7080 --- /dev/null +++ b/src/boost/tools/quickbook/src/tree.hpp @@ -0,0 +1,167 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_TREE_HPP) +#define BOOST_QUICKBOOK_TREE_HPP + +#include <utility> + +namespace quickbook +{ + namespace detail + { + struct tree_node_base; + template <typename T> struct tree_node; + struct tree_base; + template <typename T> struct tree; + struct tree_builder_base; + template <typename T> struct tree_builder; + + struct tree_node_base + { + friend struct tree_base; + friend struct tree_builder_base; + + protected: + tree_node_base* parent_; + tree_node_base* children_; + tree_node_base* next_; + tree_node_base* prev_; + + public: + tree_node_base() : parent_(), children_(), next_(), prev_() {} + + protected: + void add_before(tree_base*); + void add_after(tree_base*); + void add_first_child(tree_base*); + void add_last_child(tree_base*); + }; + + template <typename T> struct tree_node : tree_node_base + { + T* parent() const { return static_cast<T*>(parent_); } + T* children() const { return static_cast<T*>(children_); } + T* next() const { return static_cast<T*>(next_); } + T* prev() const { return static_cast<T*>(prev_); } + + void add_before(tree<T>&& x) { tree_node_base::add_before(&x); } + void add_after(tree<T>&& x) { tree_node_base::add_after(&x); } + void add_first_child(tree<T>&& x) + { + tree_node_base::add_first_child(&x); + } + void add_last_child(tree<T>&& x) + { + tree_node_base::add_last_child(&x); + } + }; + + template <typename Node> void delete_nodes(Node* n) + { + while (n) { + Node* to_delete = n; + n = n->next(); + delete_nodes(to_delete->children()); + delete (to_delete); + } + } + + struct tree_base + { + friend struct tree_node_base; + + private: + tree_base(tree_base const&); + tree_base& operator=(tree_base const&); + + protected: + tree_node_base* root_; + + tree_base(); + explicit tree_base(tree_node_base*); + tree_base(tree_base&&); + tree_base& operator=(tree_base&&); + ~tree_base(); + + tree_node_base* extract(tree_node_base*); + }; + + template <typename T> struct tree : tree_base + { + tree() {} + explicit tree(T* r) : tree_base(r) {} + tree(tree<T>&& x) : tree_base(std::move(x)) {} + ~tree() { delete_nodes(root()); } + tree& operator=(tree<T>&& x) + { + tree_base::operator=(std::move(x)); + return *this; + } + + tree extract(T* n) + { + return tree(static_cast<T*>(tree_base::extract(n))); + } + T* root() const { return static_cast<T*>(root_); } + }; + + struct tree_builder_base : tree_base + { + private: + tree_builder_base(tree_builder_base const&); + tree_builder_base& operator=(tree_builder_base const&); + + protected: + tree_node_base* current_; + tree_node_base* parent_; + + tree_builder_base(); + tree_builder_base(tree_builder_base&&); + tree_builder_base& operator=(tree_builder_base&& x); + ~tree_builder_base(); + + tree_node_base* extract(tree_node_base*); + tree_node_base* release(); + void add_element(tree_node_base* n); + + public: + void start_children(); + void end_children(); + }; + + template <typename T> struct tree_builder : tree_builder_base + { + public: + tree_builder() : tree_builder_base() {} + tree_builder(tree_builder<T>&& x) : tree_builder_base(std::move(x)) + { + } + ~tree_builder() { delete_nodes(root()); } + tree_builder& operator=(tree_builder&& x) + { + return tree_builder_base::operator=(std::move(x)); + } + + T* parent() const { return static_cast<T*>(parent_); } + T* current() const { return static_cast<T*>(current_); } + T* root() const { return static_cast<T*>(root_); } + tree<T> extract(T* x) + { + return tree<T>(static_cast<T*>(tree_builder_base::extract(x))); + } + tree<T> release() + { + return tree<T>(static_cast<T*>(tree_builder_base::release())); + } + void add_element(T* n) { tree_builder_base::add_element(n); } + }; + } +} + +#endif diff --git a/src/boost/tools/quickbook/src/utils.cpp b/src/boost/tools/quickbook/src/utils.cpp new file mode 100644 index 000000000..3a6b05803 --- /dev/null +++ b/src/boost/tools/quickbook/src/utils.cpp @@ -0,0 +1,221 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include "utils.hpp" + +#include <cctype> +#include <cstring> +#include <map> +#include <boost/spirit/include/classic_chset.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_numerics.hpp> +#include <boost/spirit/include/phoenix1_binders.hpp> +#include <boost/spirit/include/phoenix1_primitives.hpp> + +namespace quickbook +{ + namespace detail + { + namespace cl = boost::spirit::classic; + namespace ph = phoenix; + + struct xml_decode_grammar : cl::grammar<xml_decode_grammar> + { + std::string& result; + xml_decode_grammar(std::string& result_) : result(result_) {} + + void append_char(char c) const { result += c; } + + void append_escaped_char(unsigned int c) const + { + if (c < 0x80) { + result += static_cast<char>(c); + } + else if (c < 0x800) { + char e[] = {static_cast<char>(0xc0 + (c >> 6)), + static_cast<char>(0x80 + (c & 0x3f)), '\0'}; + result += e; + } + else if (c < 0x10000) { + char e[] = {static_cast<char>(0xe0 + (c >> 12)), + static_cast<char>(0x80 + ((c >> 6) & 0x3f)), + static_cast<char>(0x80 + (c & 0x3f)), '\0'}; + result += e; + } + else if (c < 0x110000) { + char e[] = {static_cast<char>(0xf0 + (c >> 18)), + static_cast<char>(0x80 + ((c >> 12) & 0x3f)), + static_cast<char>(0x80 + ((c >> 6) & 0x3f)), + static_cast<char>(0x80 + (c & 0x3f)), '\0'}; + result += e; + } + else { + result += "\xEF\xBF\xBD"; + } + } + + template <typename Scanner> struct definition + { + definition(xml_decode_grammar const& self) + { + // clang-format off + + auto append_escaped_char = ph::bind(&xml_decode_grammar::append_escaped_char); + auto append_char = ph::bind(&xml_decode_grammar::append_char); + auto encoded = + cl::ch_p('&') + >> ( "#x" + >> cl::hex_p [append_escaped_char(self, ph::arg1)] + >> !cl::ch_p(';') + | '#' + >> cl::uint_p [append_escaped_char(self, ph::arg1)] + >> !cl::ch_p(';') + | cl::str_p("amp;") [append_char(self, '&')] + | cl::str_p("apos;") [append_char(self, '\'')] + | cl::str_p("gt;") [append_char(self, '>')] + | cl::str_p("lt;") [append_char(self, '<')] + | cl::str_p("quot;") [append_char(self, '"')] + ); + auto character = cl::anychar_p [append_char(self, ph::arg1)]; + xml_encoded = *(encoded | character); + + // clang-format on + } + + cl::rule<Scanner> const& start() { return xml_encoded; } + cl::rule<Scanner> xml_encoded; + }; + + private: + xml_decode_grammar& operator=(xml_decode_grammar const&); + }; + + std::string decode_string(quickbook::string_view str) + { + std::string result; + xml_decode_grammar xml_decode(result); + boost::spirit::classic::parse(str.begin(), str.end(), xml_decode); + return result; + } + + std::string encode_string(quickbook::string_view str) + { + std::string result; + result.reserve(str.size()); + + for (string_iterator it = str.begin(); it != str.end(); ++it) { + switch (*it) { + case '<': + result += "<"; + break; + case '>': + result += ">"; + break; + case '&': + result += "&"; + break; + case '"': + result += """; + break; + default: + result += *it; + break; + } + } + + return result; + } + + void print_char(char ch, std::ostream& out) + { + switch (ch) { + case '<': + out << "<"; + break; + case '>': + out << ">"; + break; + case '&': + out << "&"; + break; + case '"': + out << """; + break; + default: + out << ch; + break; + // note ' is not included. see the curse of apos: + // http://fishbowl.pastiche.org/2003/07/01/the_curse_of_apos + } + } + + void print_string(quickbook::string_view str, std::ostream& out) + { + for (string_iterator cur = str.begin(); cur != str.end(); ++cur) { + print_char(*cur, out); + } + } + + std::string make_identifier(quickbook::string_view text) + { + std::string id(text.begin(), text.end()); + for (std::string::iterator i = id.begin(); i != id.end(); ++i) { + if (!std::isalnum(static_cast<unsigned char>(*i))) { + *i = '_'; + } + else { + *i = static_cast<char>( + std::tolower(static_cast<unsigned char>(*i))); + } + } + + return id; + } + + static std::string escape_uri_impl( + quickbook::string_view uri_param, char const* mark) + { + // Extra capital characters for validating percent escapes. + static char const hex[] = "0123456789abcdefABCDEF"; + + std::string uri; + uri.reserve(uri_param.size()); + + for (std::string::size_type n = 0; n < uri_param.size(); ++n) { + if (static_cast<unsigned char>(uri_param[n]) > 127 || + (!std::isalnum(static_cast<unsigned char>(uri_param[n])) && + !std::strchr(mark, uri_param[n])) || + (uri_param[n] == '%' && + !(n + 2 < uri_param.size() && + std::strchr(hex, uri_param[n + 1]) && + std::strchr(hex, uri_param[n + 2])))) { + char escape[] = {'%', hex[uri_param[n] / 16], + hex[uri_param[n] % 16], '\0'}; + uri += escape; + } + else { + uri += uri_param[n]; + } + } + + return uri; + } + + std::string escape_uri(quickbook::string_view uri_param) + { + std::string uri(uri_param.begin(), uri_param.end()); + return escape_uri_impl(uri_param, "-_.!~*'()?\\/"); + } + + std::string partially_escape_uri(quickbook::string_view uri_param) + { + return escape_uri_impl(uri_param, "-_.!~*'()?\\/:&=#%+"); + } + } +} diff --git a/src/boost/tools/quickbook/src/utils.hpp b/src/boost/tools/quickbook/src/utils.hpp new file mode 100644 index 000000000..fd616bc53 --- /dev/null +++ b/src/boost/tools/quickbook/src/utils.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2002 2004 2006 Joel de Guzman + Copyright (c) 2004 Eric Niebler + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_QUICKBOOK_UTILS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_UTILS_HPP + +#include <ostream> +#include <string> +#include "string_view.hpp" + +namespace quickbook +{ + namespace detail + { + std::string decode_string(quickbook::string_view); + std::string encode_string(quickbook::string_view); + void print_char(char ch, std::ostream& out); + void print_string(quickbook::string_view str, std::ostream& out); + std::string make_identifier(quickbook::string_view); + + // URI escape string + std::string escape_uri(quickbook::string_view); + + // URI escape string, leaving characters generally used in URIs. + std::string partially_escape_uri(quickbook::string_view); + + // Defined in id_xml.cpp. Just because. + std::string linkify( + quickbook::string_view source, quickbook::string_view linkend); + } +} + +#endif // BOOST_SPIRIT_QUICKBOOK_UTILS_HPP diff --git a/src/boost/tools/quickbook/src/value_tags.hpp b/src/boost/tools/quickbook/src/value_tags.hpp new file mode 100644 index 000000000..69f90f08b --- /dev/null +++ b/src/boost/tools/quickbook/src/value_tags.hpp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_VALUES_TAGS_HPP) +#define BOOST_SPIRIT_QUICKBOOK_VALUES_TAGS_HPP + +#include <cassert> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/enum.hpp> +#include <boost/preprocessor/seq/for_each.hpp> +#include <boost/preprocessor/stringize.hpp> +#include <boost/range/irange.hpp> + +#define QUICKBOOK_VALUE_TAGS(tags_name, start_index, values) \ + struct tags_name \ + { \ + enum tags_name##_enum{previous_index = start_index - 1, \ + BOOST_PP_SEQ_ENUM(values), end_index}; \ + \ + static char const* name(int value) \ + { \ + switch (value) { \ + case 0: \ + return "null"; \ + BOOST_PP_SEQ_FOR_EACH(QUICKBOOK_VALUE_CASE, _, values) \ + default: \ + assert(false); \ + return ""; \ + }; \ + } \ + \ + typedef boost::integer_range<int> range_type; \ + static range_type tags() \ + { \ + return boost::irange(start_index, (int)end_index); \ + } \ + static bool is_tag(int value) \ + { \ + return value >= start_index && value < (int)end_index; \ + } \ + }; + +#define QUICKBOOK_VALUE_CASE(r, _, value) \ + case value: \ + return BOOST_PP_STRINGIZE(value); + +#define QUICKBOOK_VALUE_NAMED_TAGS(tags_name, start_index, values) \ + struct tags_name \ + { \ + enum tags_name##_enum{previous_index = \ + start_index - \ + 1 BOOST_PP_SEQ_FOR_EACH( \ + QUICKBOOK_VALUE_NAMED_ENUM, _, values), \ + end_index}; \ + \ + static char const* name(int value) \ + { \ + switch (value) { \ + case 0: \ + return "null"; \ + BOOST_PP_SEQ_FOR_EACH(QUICKBOOK_VALUE_NAMED_CASE, _, values) \ + default: \ + assert(false); \ + return ""; \ + }; \ + } \ + \ + typedef boost::integer_range<int> range_type; \ + static range_type tags() \ + { \ + return boost::irange(start_index, (int)end_index); \ + } \ + static bool is_tag(int value) \ + { \ + return value >= start_index && value < (int)end_index; \ + } \ + }; + +#define QUICKBOOK_VALUE_NAMED_ENUM(r, _, value) , BOOST_PP_SEQ_ELEM(0, value) + +#define QUICKBOOK_VALUE_NAMED_CASE(r, _, value) \ + case BOOST_PP_SEQ_ELEM(0, value): \ + return BOOST_PP_SEQ_ELEM(1, value); + +#endif diff --git a/src/boost/tools/quickbook/src/values.cpp b/src/boost/tools/quickbook/src/values.cpp new file mode 100644 index 000000000..6e2c3ec91 --- /dev/null +++ b/src/boost/tools/quickbook/src/values.cpp @@ -0,0 +1,829 @@ +/*============================================================================= + Copyright (c) 2010-2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "values.hpp" +#include <boost/current_function.hpp> +#include <boost/lexical_cast.hpp> +#include "files.hpp" + +#define UNDEFINED_ERROR() \ + throw value_undefined_method( \ + std::string(BOOST_CURRENT_FUNCTION) + " not defined for " + \ + this->type_name() + " values."); + +namespace quickbook +{ + //////////////////////////////////////////////////////////////////////////// + // Value Error + + struct value_undefined_method : value_error + { + value_undefined_method(std::string const&); + }; + + value_error::value_error(std::string const& x) : std::logic_error(x) {} + + value_undefined_method::value_undefined_method(std::string const& x) + : value_error(x) + { + } + + //////////////////////////////////////////////////////////////////////////// + // Node + + namespace detail + { + value_node::value_node(tag_type t) : ref_count_(0), tag_(t), next_() {} + + value_node::~value_node() {} + + file_ptr value_node::get_file() const { UNDEFINED_ERROR(); } + string_iterator value_node::get_position() const { UNDEFINED_ERROR(); } + int value_node::get_int() const { UNDEFINED_ERROR(); } + quickbook::string_view value_node::get_quickbook() const + { + UNDEFINED_ERROR(); + } + std::string value_node::get_encoded() const { UNDEFINED_ERROR(); } + value_node* value_node::get_list() const { UNDEFINED_ERROR(); } + + bool value_node::empty() const { return false; } + bool value_node::check() const { return true; } + bool value_node::is_list() const { return false; } + bool value_node::is_encoded() const { return false; } + bool value_node::equals(value_node*) const { UNDEFINED_ERROR(); } + } + + //////////////////////////////////////////////////////////////////////////// + // List end value + // + // A special value for marking the end of lists. + + namespace detail + { + struct value_list_end_impl : public value_node + { + static value_list_end_impl instance; + + private: + value_list_end_impl() : value_node(value::default_tag) + { + intrusive_ptr_add_ref(&instance); + next_ = this; + } + + virtual char const* type_name() const { return "list end"; } + virtual value_node* clone() const { UNDEFINED_ERROR(); } + + virtual bool equals(value_node* other) const + { + return this == other; + } + + bool empty() const { UNDEFINED_ERROR(); } + bool check() const { UNDEFINED_ERROR(); } + bool is_list() const { UNDEFINED_ERROR(); } + bool is_encoded() const { UNDEFINED_ERROR(); } + }; + + value_list_end_impl value_list_end_impl::instance; + } + + //////////////////////////////////////////////////////////////////////////// + // Empty/nil values + // + // (nil is just a special case of empty, don't be mislead by the name + // the type is not important). + + namespace detail + { + struct empty_value_impl : public value_node + { + static value_node* new_(value::tag_type t); + + protected: + explicit empty_value_impl(value::tag_type t) : value_node(t) {} + + private: + char const* type_name() const { return "empty"; } + + virtual value_node* clone() const + { + return new empty_value_impl(tag_); + } + + virtual bool empty() const { return true; } + + virtual bool check() const { return false; } + + virtual bool equals(value_node* other) const + { + return !other->check(); + } + + friend value quickbook::empty_value(value::tag_type); + }; + + struct value_nil_impl : public empty_value_impl + { + static value_nil_impl instance; + + private: + value_nil_impl() : empty_value_impl(value::default_tag) + { + intrusive_ptr_add_ref(&instance); + next_ = &value_list_end_impl::instance; + } + }; + + value_nil_impl value_nil_impl::instance; + + value_node* empty_value_impl::new_(value::tag_type t) + { + // The return value from this function is always placed in an + // intrusive_ptr which will manage the memory correctly. + // Note that value_nil_impl increments its reference count + // in its constructor, so that it will never be deleted by the + // intrusive pointer. + + if (t == value::default_tag) + return &value_nil_impl::instance; + else + return new empty_value_impl(t); + } + } + + value empty_value(value::tag_type t) + { + return value(detail::empty_value_impl::new_(t)); + } + + //////////////////////////////////////////////////////////////////////////// + // value_counted + + namespace detail + { + value_counted::value_counted() : value_base(&value_nil_impl::instance) + { + // Even though empty is not on the heap, its reference + // counter needs to be incremented so that the destructor + // doesn't try to delete it. + + intrusive_ptr_add_ref(value_); + } + + value_counted::value_counted(value_counted const& x) : value_base(x) + { + intrusive_ptr_add_ref(value_); + } + + value_counted::value_counted(value_base const& x) : value_base(x) + { + intrusive_ptr_add_ref(value_); + } + + value_counted::value_counted(value_node* x) : value_base(x) + { + intrusive_ptr_add_ref(value_); + } + + value_counted::~value_counted() { intrusive_ptr_release(value_); } + } + + //////////////////////////////////////////////////////////////////////////// + // value + + value::value() : detail::value_counted() {} + + value::value(value const& x) : detail::value_counted(x) {} + + value::value(detail::value_base const& x) : detail::value_counted(x) {} + + value::value(detail::value_node* x) : detail::value_counted(x) {} + + value& value::operator=(value x) + { + swap(x); + return *this; + } + + //////////////////////////////////////////////////////////////////////////// + // Integers + + namespace detail + { + struct int_value_impl : public value_node + { + public: + explicit int_value_impl(int, value::tag_type); + + private: + char const* type_name() const { return "integer"; } + virtual value_node* clone() const; + virtual int get_int() const; + virtual std::string get_encoded() const; + virtual bool empty() const; + virtual bool is_encoded() const; + virtual bool equals(value_node*) const; + + int value_; + }; + + int_value_impl::int_value_impl(int v, value::tag_type t) + : value_node(t), value_(v) + { + } + + value_node* int_value_impl::clone() const + { + return new int_value_impl(value_, tag_); + } + + int int_value_impl::get_int() const { return value_; } + + std::string int_value_impl::get_encoded() const + { + return boost::lexical_cast<std::string>(value_); + } + + bool int_value_impl::empty() const { return false; } + + bool int_value_impl::is_encoded() const { return true; } + + bool int_value_impl::equals(value_node* other) const + { + try { + return value_ == other->get_int(); + } catch (value_undefined_method&) { + return false; + } + } + } + + value int_value(int v, value::tag_type t) + { + return value(new detail::int_value_impl(v, t)); + } + + //////////////////////////////////////////////////////////////////////////// + // Strings + + namespace detail + { + struct encoded_value_impl : public value_node + { + public: + explicit encoded_value_impl(std::string const&, value::tag_type); + + private: + char const* type_name() const { return "encoded text"; } + + virtual ~encoded_value_impl(); + virtual value_node* clone() const; + virtual std::string get_encoded() const; + virtual bool empty() const; + virtual bool is_encoded() const; + virtual bool equals(value_node*) const; + + std::string value_; + }; + + struct qbk_value_impl : public value_node + { + public: + explicit qbk_value_impl( + file_ptr const&, + string_iterator begin, + string_iterator end, + value::tag_type); + + private: + char const* type_name() const { return "quickbook"; } + + virtual ~qbk_value_impl(); + virtual value_node* clone() const; + virtual file_ptr get_file() const; + virtual string_iterator get_position() const; + virtual quickbook::string_view get_quickbook() const; + virtual bool empty() const; + virtual bool equals(value_node*) const; + + file_ptr file_; + string_iterator begin_; + string_iterator end_; + }; + + struct encoded_qbk_value_impl : public value_node + { + private: + char const* type_name() const + { + return "encoded text with quickbook reference"; + } + + encoded_qbk_value_impl( + file_ptr const&, + string_iterator, + string_iterator, + std::string const&, + value::tag_type); + + virtual ~encoded_qbk_value_impl(); + virtual value_node* clone() const; + virtual file_ptr get_file() const; + virtual string_iterator get_position() const; + virtual quickbook::string_view get_quickbook() const; + virtual std::string get_encoded() const; + virtual bool empty() const; + virtual bool is_encoded() const; + virtual bool equals(value_node*) const; + + file_ptr file_; + string_iterator begin_; + string_iterator end_; + std::string encoded_value_; + + friend quickbook::value quickbook::encoded_qbk_value( + file_ptr const&, + string_iterator, + string_iterator, + std::string const&, + quickbook::value::tag_type); + }; + + // encoded_value_impl + + encoded_value_impl::encoded_value_impl( + std::string const& val, value::tag_type tag) + : value_node(tag), value_(val) + { + } + + encoded_value_impl::~encoded_value_impl() {} + + value_node* encoded_value_impl::clone() const + { + return new encoded_value_impl(value_, tag_); + } + + std::string encoded_value_impl::get_encoded() const { return value_; } + + bool encoded_value_impl::empty() const { return value_.empty(); } + + bool encoded_value_impl::is_encoded() const { return true; } + + bool encoded_value_impl::equals(value_node* other) const + { + try { + return value_ == other->get_encoded(); + } catch (value_undefined_method&) { + return false; + } + } + + // qbk_value_impl + + qbk_value_impl::qbk_value_impl( + file_ptr const& f, + string_iterator begin, + string_iterator end, + value::tag_type tag) + : value_node(tag), file_(f), begin_(begin), end_(end) + { + } + + qbk_value_impl::~qbk_value_impl() {} + + value_node* qbk_value_impl::clone() const + { + return new qbk_value_impl(file_, begin_, end_, tag_); + } + + file_ptr qbk_value_impl::get_file() const { return file_; } + + string_iterator qbk_value_impl::get_position() const { return begin_; } + + quickbook::string_view qbk_value_impl::get_quickbook() const + { + return quickbook::string_view(begin_, end_ - begin_); + } + + bool qbk_value_impl::empty() const { return begin_ == end_; } + + bool qbk_value_impl::equals(value_node* other) const + { + try { + return this->get_quickbook() == other->get_quickbook(); + } catch (value_undefined_method&) { + return false; + } + } + + // encoded_qbk_value_impl + + encoded_qbk_value_impl::encoded_qbk_value_impl( + file_ptr const& f, + string_iterator begin, + string_iterator end, + std::string const& encoded, + value::tag_type tag) + : value_node(tag) + , file_(f) + , begin_(begin) + , end_(end) + , encoded_value_(encoded) + + { + } + + encoded_qbk_value_impl::~encoded_qbk_value_impl() {} + + value_node* encoded_qbk_value_impl::clone() const + { + return new encoded_qbk_value_impl( + file_, begin_, end_, encoded_value_, tag_); + } + + file_ptr encoded_qbk_value_impl::get_file() const { return file_; } + + string_iterator encoded_qbk_value_impl::get_position() const + { + return begin_; + } + + quickbook::string_view encoded_qbk_value_impl::get_quickbook() const + { + return quickbook::string_view(begin_, end_ - begin_); + } + + std::string encoded_qbk_value_impl::get_encoded() const + { + return encoded_value_; + } + + // Should this test the quickbook, the boostbook or both? + bool encoded_qbk_value_impl::empty() const + { + return encoded_value_.empty(); + } + + bool encoded_qbk_value_impl::is_encoded() const { return true; } + + bool encoded_qbk_value_impl::equals(value_node* other) const + { + try { + return this->get_quickbook() == other->get_quickbook(); + } catch (value_undefined_method&) { + } + + try { + return this->get_encoded() == other->get_encoded(); + } catch (value_undefined_method&) { + } + + return false; + } + } + + value qbk_value( + file_ptr const& f, + string_iterator x, + string_iterator y, + value::tag_type t) + { + return value(new detail::qbk_value_impl(f, x, y, t)); + } + + value encoded_value(std::string const& x, value::tag_type t) + { + return value(new detail::encoded_value_impl(x, t)); + } + + value encoded_qbk_value( + file_ptr const& f, + string_iterator x, + string_iterator y, + std::string const& z, + value::tag_type t) + { + return value(new detail::encoded_qbk_value_impl(f, x, y, z, t)); + } + + ////////////////////////////////////////////////////////////////////////// + // List methods + + namespace detail + { + namespace + { + value_node** list_ref_back(value_node**); + void list_ref(value_node*); + void list_unref(value_node*); + value_node** merge_sort(value_node**); + value_node** merge_sort(value_node**, int); + value_node** merge(value_node**, value_node**, value_node**); + void rotate(value_node**, value_node**, value_node**); + + value_node** list_ref_back(value_node** back) + { + while (*back != &value_list_end_impl::instance) { + intrusive_ptr_add_ref(*back); + back = &(*back)->next_; + } + + return back; + } + + void list_ref(value_node* ptr) + { + while (ptr != &value_list_end_impl::instance) { + intrusive_ptr_add_ref(ptr); + ptr = ptr->next_; + } + } + + void list_unref(value_node* ptr) + { + while (ptr != &value_list_end_impl::instance) { + value_node* next = ptr->next_; + intrusive_ptr_release(ptr); + ptr = next; + } + } + + value_node** merge_sort(value_node** l) + { + if (*l == &value_list_end_impl::instance) + return l; + else + return merge_sort(l, 9999); + } + + value_node** merge_sort(value_node** l, int recurse_limit) + { + value_node** p = &(*l)->next_; + for (int count = 0; count < recurse_limit && + *p != &value_list_end_impl::instance; + ++count) { + p = merge(l, p, merge_sort(p, count)); + } + return p; + } + + value_node** merge( + value_node** first, value_node** second, value_node** third) + { + for (;;) { + for (;;) { + if (first == second) return third; + if ((*second)->tag_ < (*first)->tag_) break; + first = &(*first)->next_; + } + + rotate(first, second, third); + first = &(*first)->next_; + + // Since the two ranges were just swapped, the order is now: + // first...third...second + // + // Also, that since the second section of the list was + // originally before the first, if the heads are equal + // we need to swap to maintain the order. + + for (;;) { + if (first == third) return second; + if ((*third)->tag_ <= (*first)->tag_) break; + first = &(*first)->next_; + } + + rotate(first, third, second); + first = &(*first)->next_; + } + } + + void rotate( + value_node** first, value_node** second, value_node** third) + { + value_node* tmp = *first; + *first = *second; + *second = *third; + *third = tmp; + // if(*second != &value_list_end_impl::instance) back = second; + } + } + } + + ////////////////////////////////////////////////////////////////////////// + // Lists + + namespace detail + { + struct value_list_impl : public value_node + { + value_list_impl(value::tag_type); + value_list_impl(value_list_builder&, value::tag_type); + + private: + value_list_impl(value_list_impl const&); + + char const* type_name() const { return "list"; } + + virtual ~value_list_impl(); + virtual value_node* clone() const; + virtual bool empty() const; + virtual bool equals(value_node*) const; + + virtual bool is_list() const; + virtual value_node* get_list() const; + + value_node* head_; + }; + + value_list_impl::value_list_impl(value::tag_type tag) + : value_node(tag), head_(&value_list_end_impl::instance) + { + } + + value_list_impl::value_list_impl( + value_list_builder& builder, value::tag_type tag) + : value_node(tag), head_(builder.release()) + { + } + + value_list_impl::value_list_impl(value_list_impl const& x) + : value_node(x.tag_), head_(x.head_) + { + list_ref(head_); + } + + value_list_impl::~value_list_impl() { list_unref(head_); } + + value_node* value_list_impl::clone() const + { + return new value_list_impl(*this); + } + + bool value_list_impl::empty() const + { + return head_ == &value_list_end_impl::instance; + } + + bool value_list_impl::is_list() const { return true; } + + value_node* value_list_impl::get_list() const { return head_; } + + bool value_list_impl::equals(value_node* other) const + { + value_node* x1; + + try { + x1 = other->get_list(); + } catch (value_undefined_method&) { + return false; + } + + for (value_node *x2 = head_; x1 != x2; + x1 = x1->next_, x2 = x2->next_) { + if (x2 == &value_list_end_impl::instance || !x1->equals(x2)) + return false; + } + + return true; + } + } + + ////////////////////////////////////////////////////////////////////////// + // List builder + + namespace detail + { + // value_list_builder + + value_list_builder::value_list_builder() + : head_(&value_list_end_impl::instance), back_(&head_) + { + } + + value_list_builder::value_list_builder(value_node* ptr) + : head_(ptr), back_(list_ref_back(&head_)) + { + } + + value_list_builder::~value_list_builder() { list_unref(head_); } + + void value_list_builder::swap(value_list_builder& other) + { + std::swap(head_, other.head_); + std::swap(back_, other.back_); + if (back_ == &other.head_) back_ = &head_; + if (other.back_ == &head_) other.back_ = &other.head_; + } + + value_node* value_list_builder::release() + { + value_node* r = head_; + head_ = &value_list_end_impl::instance; + back_ = &head_; + return r; + } + + void value_list_builder::append(value_node* item) + { + if (item->next_) item = item->clone(); + intrusive_ptr_add_ref(item); + item->next_ = *back_; + *back_ = item; + back_ = &item->next_; + } + + void value_list_builder::sort() + { + back_ = merge_sort(&head_); + assert(*back_ == &value_list_end_impl::instance); + } + + bool value_list_builder::empty() const + { + return head_ == &value_list_end_impl::instance; + } + } + + ////////////////////////////////////////////////////////////////////////// + // Value builder + + value_builder::value_builder() + : current(), list_tag(value::default_tag), saved() + { + } + + void value_builder::swap(value_builder& other) + { + current.swap(other.current); + std::swap(list_tag, other.list_tag); + saved.swap(other.saved); + } + + void value_builder::save() + { + boost::scoped_ptr<value_builder> store(new value_builder); + swap(*store); + saved.swap(store); + } + + void value_builder::restore() + { + boost::scoped_ptr<value_builder> store; + store.swap(saved); + swap(*store); + } + + value value_builder::release() + { + return value(new detail::value_list_impl(current, list_tag)); + } + + void value_builder::insert(value const& item) + { + current.append(item.value_); + } + + void value_builder::extend(value const& list) + { + for (value::iterator begin = list.begin(), end = list.end(); + begin != end; ++begin) { + insert(*begin); + } + } + + void value_builder::start_list(value::tag_type tag) + { + save(); + list_tag = tag; + } + + void value_builder::finish_list() + { + value list = release(); + restore(); + insert(list); + } + + void value_builder::clear_list() { restore(); } + + void value_builder::sort_list() { current.sort(); } + + bool value_builder::empty() const { return current.empty(); } + + //////////////////////////////////////////////////////////////////////////// + // Iterator + + namespace detail + { + value::iterator::iterator() : ptr_(&value_list_end_impl::instance) {} + } +} diff --git a/src/boost/tools/quickbook/src/values.hpp b/src/boost/tools/quickbook/src/values.hpp new file mode 100644 index 000000000..3ba75ffe5 --- /dev/null +++ b/src/boost/tools/quickbook/src/values.hpp @@ -0,0 +1,444 @@ +/*============================================================================= + Copyright (c) 2010-2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// An easy way to store data parsed for quickbook. + +#if !defined(BOOST_SPIRIT_QUICKBOOK_VALUES_HPP) +#define BOOST_SPIRIT_QUICKBOOK_VALUES_HPP + +#include <cassert> +#include <stdexcept> +#include <string> +#include <utility> +#include <boost/iterator/iterator_traits.hpp> +#include <boost/operators.hpp> +#include <boost/scoped_ptr.hpp> +#include "files.hpp" +#include "fwd.hpp" +#include "string_view.hpp" + +namespace quickbook +{ + struct value; + struct value_builder; + struct value_error; + + namespace detail + { + //////////////////////////////////////////////////////////////////////// + // Node + + struct value_node + { + private: + value_node(value_node const&); + value_node& operator=(value_node const&); + + public: + typedef int tag_type; + + protected: + explicit value_node(tag_type); + virtual ~value_node(); + + public: + virtual char const* type_name() const = 0; + virtual value_node* clone() const = 0; + + virtual file_ptr get_file() const; + virtual string_iterator get_position() const; + virtual quickbook::string_view get_quickbook() const; + virtual std::string get_encoded() const; + virtual int get_int() const; + + virtual bool check() const; + virtual bool empty() const; + virtual bool is_encoded() const; + virtual bool is_list() const; + virtual bool equals(value_node*) const; + + virtual value_node* get_list() const; + + int ref_count_; + const tag_type tag_; + value_node* next_; + + friend void intrusive_ptr_add_ref(value_node* ptr) + { + ++ptr->ref_count_; + } + friend void intrusive_ptr_release(value_node* ptr) + { + if (--ptr->ref_count_ == 0) delete ptr; + } + }; + + //////////////////////////////////////////////////////////////////////// + // Value base + // + // This defines most of the public methods for value. + // 'begin' and 'end' are defined with the iterators later. + + struct value_base + { + public: + struct iterator; + + typedef iterator const_iterator; + typedef value_node::tag_type tag_type; + enum + { + default_tag = 0 + }; + + protected: + explicit value_base(value_node* base) : value_(base) + { + assert(value_); + } + + ~value_base() {} + + void swap(value_base& x) { std::swap(value_, x.value_); } + + public: + bool check() const { return value_->check(); } + bool empty() const { return value_->empty(); } + bool is_encoded() const { return value_->is_encoded(); } + bool is_list() const { return value_->is_list(); } + + iterator begin() const; + iterator end() const; + + // Item accessors + tag_type get_tag() const { return value_->tag_; } + file_ptr get_file() const { return value_->get_file(); } + string_iterator get_position() const + { + return value_->get_position(); + } + quickbook::string_view get_quickbook() const + { + return value_->get_quickbook(); + } + std::string get_encoded() const { return value_->get_encoded(); } + int get_int() const { return value_->get_int(); } + + // Equality is pretty inefficient. Not really designed for anything + // more than testing purposes. + friend bool operator==(value_base const& x, value_base const& y) + { + return x.value_->equals(y.value_); + } + + protected: + value_node* value_; + + // value_builder needs to access 'value_' to get the node + // from a value. + friend struct quickbook::value_builder; + }; + + //////////////////////////////////////////////////////////////////////// + // Reference and proxy values for use in iterators + + struct value_ref : public value_base + { + public: + explicit value_ref(value_node* base) : value_base(base) {} + }; + + struct value_proxy : public value_base + { + public: + explicit value_proxy(value_node* base) : value_base(base) {} + value_proxy* operator->() { return this; } + value_ref operator*() const { return value_ref(value_); } + }; + + //////////////////////////////////////////////////////////////////////// + // Iterators + + struct value_base::iterator : public boost::forward_iterator_helper< + iterator, + value, + int, + value_proxy, + value_ref> + { + public: + iterator(); + explicit iterator(value_node* p) : ptr_(p) {} + friend bool operator==(iterator x, iterator y) + { + return x.ptr_ == y.ptr_; + } + iterator& operator++() + { + ptr_ = ptr_->next_; + return *this; + } + value_ref operator*() const { return value_ref(ptr_); } + value_proxy operator->() const { return value_proxy(ptr_); } + + private: + value_node* ptr_; + }; + + inline value_base::iterator value_base::begin() const + { + return iterator(value_->get_list()); + } + + inline value_base::iterator value_base::end() const + { + return iterator(); + } + + //////////////////////////////////////////////////////////////////////// + // Reference counting for values + + struct value_counted : public value_base + { + value_counted& operator=(value_counted const&); + + protected: + value_counted(); + value_counted(value_counted const&); + value_counted(value_base const&); + value_counted(value_node*); + ~value_counted(); + }; + + //////////////////////////////////////////////////////////////////////// + // List builder + // + // Values are immutable, so this class is used to build a list of + // value nodes before constructing the value. + + struct value_list_builder + { + value_list_builder(value_list_builder const&); + value_list_builder& operator=(value_list_builder const&); + + public: + value_list_builder(); + value_list_builder(value_node*); + ~value_list_builder(); + void swap(value_list_builder& b); + value_node* release(); + + void append(value_node*); + void sort(); + + bool empty() const; + + private: + value_node* head_; + value_node** back_; + }; + } + + //////////////////////////////////////////////////////////////////////////// + // Value + // + // Most of the methods are in value_base. + + struct value : public detail::value_counted + { + public: + value(); + value(value const&); + value(detail::value_base const&); + explicit value(detail::value_node*); + value& operator=(value); + void swap(value& x) { detail::value_counted::swap(x); } + }; + + // Empty + value empty_value(value::tag_type = value::default_tag); + + // Integers + value int_value(int, value::tag_type = value::default_tag); + + // String types + + // Quickbook strings contain a reference to the original quickbook source. + value qbk_value( + file_ptr const&, + string_iterator, + string_iterator, + value::tag_type = value::default_tag); + + // Encoded strings are either plain text or boostbook. + value encoded_value( + std::string const&, value::tag_type = value::default_tag); + + // An encoded quickbook string is an encoded string that contains a + // reference to the quickbook source it was generated from. + value encoded_qbk_value( + file_ptr const&, + string_iterator, + string_iterator, + std::string const&, + value::tag_type = value::default_tag); + + //////////////////////////////////////////////////////////////////////////// + // Value Builder + // + // Used to incrementally build a valueeter tree. + + struct value_builder + { + public: + value_builder(); + void swap(value_builder& b); + + void save(); + void restore(); + + value release(); + + void insert(value const&); + void extend(value const&); + + void start_list(value::tag_type = value::default_tag); + void finish_list(); + void clear_list(); + void sort_list(); + + bool empty() const; + + private: + detail::value_list_builder current; + value::tag_type list_tag; + boost::scoped_ptr<value_builder> saved; + }; + + //////////////////////////////////////////////////////////////////////////// + // Value Error + // + + struct value_error : public std::logic_error + { + public: + explicit value_error(std::string const&); + }; + + //////////////////////////////////////////////////////////////////////////// + // Value Consumer + // + // Convenience class for unpacking value values. + + struct value_consumer + { + public: + struct iterator : public boost::input_iterator_helper< + iterator, + boost::iterator_value<value::iterator>::type, + boost::iterator_difference<value::iterator>::type, + boost::iterator_pointer<value::iterator>::type, + boost::iterator_reference<value::iterator>::type> + { + public: + iterator(); + explicit iterator(value::iterator* p) : ptr_(p) {} + friend bool operator==(iterator x, iterator y) + { + return *x.ptr_ == *y.ptr_; + } + iterator& operator++() + { + ++*ptr_; + return *this; + } + reference operator*() const { return **ptr_; } + pointer operator->() const { return ptr_->operator->(); } + + private: + value::iterator* ptr_; + }; + + typedef iterator const_iterator; + typedef iterator::reference reference; + + value_consumer(value const& x) + : list_(x), pos_(x.begin()), end_(x.end()) + { + } + + value_consumer(reference x) : list_(x), pos_(x.begin()), end_(x.end()) + { + } + + reference consume() + { + assert_check(); + return *pos_++; + } + + reference consume(value::tag_type t) + { + assert_check(t); + return *pos_++; + } + + value optional_consume() + { + if (check()) { + return *pos_++; + } + else { + return value(); + } + } + + value optional_consume(value::tag_type t) + { + if (check(t)) { + return *pos_++; + } + else { + return value(); + } + } + + bool check() const { return pos_ != end_; } + + bool check(value::tag_type t) const + { + return pos_ != end_ && t == pos_->get_tag(); + } + + void finish() const + { + if (pos_ != end_) throw value_error("Not all values handled."); + } + + iterator begin() { return iterator(&pos_); } + iterator end() { return iterator(&end_); } + + private: + void assert_check() const + { + if (pos_ == end_) + throw value_error("Attempt to read past end of value list."); + } + + void assert_check(value::tag_type t) const + { + assert_check(); + if (t != pos_->get_tag()) throw value_error("Incorrect value tag."); + } + + value list_; + value::iterator pos_, end_; + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/values_parse.hpp b/src/boost/tools/quickbook/src/values_parse.hpp new file mode 100644 index 000000000..ee9cb2be7 --- /dev/null +++ b/src/boost/tools/quickbook/src/values_parse.hpp @@ -0,0 +1,137 @@ +/*============================================================================= + Copyright (c) 2010-2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_SPIRIT_QUICKBOOK_VALUES_PARSE_HPP) +#define BOOST_SPIRIT_QUICKBOOK_VALUES_PARSE_HPP + +#include <boost/spirit/include/phoenix1_functions.hpp> +#include "parsers.hpp" +#include "scoped.hpp" +#include "values.hpp" + +#include <iostream> + +namespace quickbook +{ + namespace ph = phoenix; + + struct value_builder_save : scoped_action_base + { + explicit value_builder_save(value_builder& builder_) : builder(builder_) + { + } + + bool start() + { + builder.save(); + return true; + } + + void cleanup() { builder.restore(); } + + value_builder& builder; + + private: + value_builder_save& operator=(value_builder_save const&); + }; + + struct value_builder_list : scoped_action_base + { + explicit value_builder_list(value_builder& builder_) : builder(builder_) + { + } + + bool start(value::tag_type tag = value::default_tag) + { + builder.start_list(tag); + return true; + } + + void success(parse_iterator, parse_iterator) { builder.finish_list(); } + void failure() { builder.clear_list(); } + + value_builder& builder; + + private: + value_builder_list& operator=(value_builder_list const&); + }; + + struct value_entry + { + template < + typename Arg1, + typename Arg2 = void, + typename Arg3 = void, + typename Arg4 = void> + struct result + { + typedef void type; + }; + + explicit value_entry(value_builder& builder_, file_ptr* current_file_) + : builder(builder_), current_file(current_file_) + { + } + + void operator()( + parse_iterator begin, + parse_iterator end, + value::tag_type tag = value::default_tag) const + { + builder.insert( + qbk_value(*current_file, begin.base(), end.base(), tag)); + } + + void operator()(int v, value::tag_type tag = value::default_tag) const + { + builder.insert(int_value(v, tag)); + } + + value_builder& builder; + file_ptr* current_file; + + private: + value_entry& operator=(value_entry const&); + }; + + struct value_sort + { + typedef void result_type; + + explicit value_sort(value_builder& builder_) : builder(builder_) {} + + void operator()() const { builder.sort_list(); } + + value_builder& builder; + + private: + value_sort& operator=(value_sort const&); + }; + + struct value_parser + { + explicit value_parser(file_ptr* current_file) + : builder() + , save(value_builder_save(builder)) + , list(value_builder_list(builder)) + , entry(value_entry(builder, current_file)) + , sort(value_sort(builder)) + { + } + + value release() { return builder.release(); } + + value_builder builder; + scoped_parser<value_builder_save> save; + scoped_parser<value_builder_list> list; + ph::function<value_entry> entry; + ph::function<value_sort> sort; + }; +} + +#endif diff --git a/src/boost/tools/quickbook/src/xml_parse.cpp b/src/boost/tools/quickbook/src/xml_parse.cpp new file mode 100644 index 000000000..4a043bb2b --- /dev/null +++ b/src/boost/tools/quickbook/src/xml_parse.cpp @@ -0,0 +1,302 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "xml_parse.hpp" +#include "simple_parse.hpp" +#include "stream.hpp" +#include "utils.hpp" + +namespace quickbook +{ + namespace detail + { + // write_xml_tree + + void write_xml_tree_impl( + std::string& out, xml_element* node, unsigned int depth); + + void write_xml_tree(xml_element* node) + { + std::string result; + write_xml_tree_impl(result, node, 0); + quickbook::detail::out() << result << std::flush; + } + + void write_xml_tree_impl( + std::string& out, xml_element* node, unsigned int depth) + { + if (!node) { + return; + } + + for (unsigned i = 0; i < depth; ++i) { + out += " "; + } + switch (node->type_) { + case xml_element::element_node: + out += "Node: "; + out += node->name_; + break; + case xml_element::element_text: + out += "Text"; + break; + case xml_element::element_html: + out += "HTML"; + break; + default: + out += "Unknown node type"; + break; + } + out += "\n"; + for (xml_element* it = node->children(); it; it = it->next()) { + write_xml_tree_impl(out, it, depth + 1); + } + } + + // xml_parse + + void read_tag( + xml_tree_builder&, + string_iterator& it, + string_iterator start, + string_iterator end); + void read_close_tag( + xml_tree_builder&, + string_iterator& it, + string_iterator start, + string_iterator end); + void skip_question_mark_tag( + string_iterator& it, string_iterator start, string_iterator end); + void skip_exclamation_mark_tag( + string_iterator& it, string_iterator start, string_iterator end); + quickbook::string_view read_tag_name( + string_iterator& it, string_iterator start, string_iterator end); + quickbook::string_view read_attribute_value( + string_iterator& it, string_iterator start, string_iterator end); + quickbook::string_view read_string( + string_iterator& it, string_iterator end); + + xml_tree xml_parse(quickbook::string_view source) + { + typedef string_iterator iterator; + iterator it = source.begin(), end = source.end(); + + xml_tree_builder builder; + + while (true) { + iterator start = it; + read_to(it, end, '<'); + if (start != it) { + builder.add_element(xml_element::text_node( + quickbook::string_view(start, it - start))); + } + + if (it == end) { + break; + } + start = it++; + if (it == end) { + throw xml_parse_error("Invalid tag", start); + } + + switch (*it) { + case '?': + skip_question_mark_tag(it, start, end); + break; + case '!': + skip_exclamation_mark_tag(it, start, end); + break; + case '/': + read_close_tag(builder, it, start, end); + break; + default: + read_tag(builder, it, start, end); + break; + } + } + + return builder.release(); + } + + void read_tag( + xml_tree_builder& builder, + string_iterator& it, + string_iterator start, + string_iterator end) + { + assert(it == start + 1 && it != end); + quickbook::string_view name = read_tag_name(it, start, end); + xml_element* node = xml_element::node(name); + builder.add_element(node); + + // Read attributes + while (true) { + read_some_of(it, end, " \t\n\r"); + if (it == end) { + throw xml_parse_error("Invalid tag", start); + } + if (*it == '>') { + ++it; + builder.start_children(); + break; + } + if (*it == '/') { + ++it; + read_some_of(it, end, " \t\n\r"); + if (it == end || *it != '>') { + throw xml_parse_error("Invalid tag", start); + } + ++it; + break; + } + quickbook::string_view attribute_name = + read_tag_name(it, start, end); + read_some_of(it, end, " \t\n\r"); + if (it == end) { + throw xml_parse_error("Invalid tag", start); + } + quickbook::string_view attribute_value; + if (*it == '=') { + ++it; + attribute_value = read_attribute_value(it, start, end); + } + node->set_attribute( + attribute_name, + quickbook::detail::decode_string(attribute_value)); + } + } + + void read_close_tag( + xml_tree_builder& builder, + string_iterator& it, + string_iterator start, + string_iterator end) + { + assert(it == start + 1 && it != end && *it == '/'); + ++it; + quickbook::string_view name = read_tag_name(it, start, end); + read_some_of(it, end, " \t\n\r"); + if (it == end || *it != '>') { + throw xml_parse_error("Invalid close tag", start); + } + ++it; + + if (!builder.parent() || builder.parent()->name_ != name) { + throw xml_parse_error("Close tag doesn't match", start); + } + + builder.end_children(); + } + + void skip_question_mark_tag( + string_iterator& it, string_iterator start, string_iterator end) + { + assert(it == start + 1 && it != end && *it == '?'); + ++it; + + while (true) { + read_to_one_of(it, end, "\"'?<>"); + if (it == end) { + throw xml_parse_error("Invalid tag", start); + } + switch (*it) { + case '"': + case '\'': + read_string(it, end); + break; + case '?': + if (read(it, end, "?>")) { + return; + } + else { + ++it; + } + break; + default: + throw xml_parse_error("Invalid tag", start); + } + } + } + + void skip_exclamation_mark_tag( + string_iterator& it, string_iterator start, string_iterator end) + { + assert(it == start + 1 && it != end && *it == '!'); + ++it; + + if (read(it, end, "--")) { + if (read_past(it, end, "-->")) { + return; + } + else { + throw xml_parse_error("Invalid comment", start); + } + } + + while (true) { + read_to_one_of(it, end, "\"'<>"); + if (it == end) { + throw xml_parse_error("Invalid tag", start); + } + switch (*it) { + case '"': + case '\'': + read_string(it, end); + break; + case '>': + ++it; + return; + default: + throw xml_parse_error("Invalid tag", start); + } + } + } + + quickbook::string_view read_tag_name( + string_iterator& it, string_iterator start, string_iterator end) + { + read_some_of(it, end, " \t\n\r"); + string_iterator name_start = it; + read_some_of( + it, end, + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:-"); + if (name_start == it) { + throw xml_parse_error("Invalid tag", start); + } + return quickbook::string_view(name_start, it - name_start); + } + + quickbook::string_view read_attribute_value( + string_iterator& it, string_iterator start, string_iterator end) + { + read_some_of(it, end, " \t\n\r"); + if (*it == '"' || *it == '\'') { + return read_string(it, end); + } + else { + throw xml_parse_error("Invalid tag", start); + } + } + + quickbook::string_view read_string( + string_iterator& it, string_iterator end) + { + assert(it != end && (*it == '"' || *it == '\'')); + + string_iterator start = it; + char deliminator = *it; + ++it; + read_to(it, end, deliminator); + if (it == end) { + throw xml_parse_error("Invalid string", start); + } + ++it; + return quickbook::string_view(start + 1, it - start - 2); + } + } +} diff --git a/src/boost/tools/quickbook/src/xml_parse.hpp b/src/boost/tools/quickbook/src/xml_parse.hpp new file mode 100644 index 000000000..6d8e4ca16 --- /dev/null +++ b/src/boost/tools/quickbook/src/xml_parse.hpp @@ -0,0 +1,134 @@ +/*============================================================================= +Copyright (c) 2017 Daniel James + +Use, modification and distribution is subject to the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_QUICKBOOK_XML_PARSE_HPP) +#define BOOST_QUICKBOOK_XML_PARSE_HPP + +#include <list> +#include <string> +#include "string_view.hpp" +#include "tree.hpp" + +namespace quickbook +{ + namespace detail + { + struct xml_element; + typedef tree<xml_element> xml_tree; + typedef tree_builder<xml_element> xml_tree_builder; + struct xml_parse_error; + + struct xml_element : tree_node<xml_element> + { + enum element_type + { + element_node, + element_text, + element_html + } type_; + std::string name_; + + private: + std::list<std::pair<std::string, std::string> > attributes_; + + public: + std::string contents_; + + explicit xml_element(element_type n) : type_(n) {} + + explicit xml_element(element_type n, quickbook::string_view name) + : type_(n), name_(name.begin(), name.end()) + { + } + + static xml_element* text_node(quickbook::string_view x) + { + xml_element* n = new xml_element(element_text); + n->contents_.assign(x.begin(), x.end()); + return n; + } + + static xml_element* html_node(quickbook::string_view x) + { + xml_element* n = new xml_element(element_html); + n->contents_.assign(x.begin(), x.end()); + return n; + } + + static xml_element* node(quickbook::string_view x) + { + return new xml_element(element_node, x); + } + + bool has_attribute(quickbook::string_view name) + { + for (auto it = attributes_.begin(), end = attributes_.end(); + it != end; ++it) { + if (name == it->first) { + return true; + } + } + return false; + } + + string_view get_attribute(quickbook::string_view name) + { + for (auto it = attributes_.begin(), end = attributes_.end(); + it != end; ++it) { + if (name == it->first) { + return it->second; + } + } + return string_view(); + } + + string_view set_attribute( + quickbook::string_view name, quickbook::string_view value) + { + for (auto it = attributes_.begin(), end = attributes_.end(); + it != end; ++it) { + if (name == it->first) { + it->second.assign(value.begin(), value.end()); + return it->second; + } + } + + attributes_.push_back( + std::make_pair(name.to_s(), value.to_s())); + return attributes_.back().second; + } + + xml_element* get_child(quickbook::string_view name) + { + for (auto it = children(); it; it = it->next()) { + if (it->type_ == element_node && it->name_ == name) { + return it; + } + } + + return 0; + } + }; + + struct xml_parse_error + { + char const* message; + string_iterator pos; + + xml_parse_error(char const* m, string_iterator p) + : message(m), pos(p) + { + } + }; + + void write_xml_tree(xml_element*); + xml_tree xml_parse(quickbook::string_view); + } +} + +#endif diff --git a/src/boost/tools/quickbook/test/Jamfile.v2 b/src/boost/tools/quickbook/test/Jamfile.v2 new file mode 100644 index 000000000..c0d543f59 --- /dev/null +++ b/src/boost/tools/quickbook/test/Jamfile.v2 @@ -0,0 +1,173 @@ +# +# Copyright (c) 2005 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test + : requirements + <toolset>msvc:<debug-symbols>off + <cxxstd>98:<build>no + <cxxstd>03:<build>no + ; + +build-project doc-info ; +build-project unit ; +build-project command-line ; +build-project snippets ; +build-project "include" ; +build-project versions ; +build-project xinclude ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test anchor-1_1 ] + [ quickbook-test anchor-1_6 ] + [ quickbook-test anchor-1_7 ] + [ quickbook-test blocks-1_5 ] + [ quickbook-test callouts-1_5 ] + [ quickbook-test callouts-1_7 ] + [ quickbook-test code-1_1 ] + [ quickbook-test code-1_5 ] + [ quickbook-test code_cpp-1_5 ] + [ quickbook-error-test code_cpp_mismatched_escape-1_4-fail ] + [ quickbook-test code_python-1_5 ] + [ quickbook-error-test code_python_mismatched_escape-1_4-fail ] + [ quickbook-test code_snippet-1_1 ] + [ quickbook-test code_teletype-1_5 ] + [ quickbook-error-test code_unclosed_block-1_6-fail ] + [ quickbook-test command_line_macro-1_1 : : : + <quickbook-test-define>__macro__=*bold* + <quickbook-test-define>__empty__ ] + [ quickbook-error-test command_line_macro-1_1-invalid : + command_line_macro-1_1.quickbook : + <testing.arg>-Dsomething[] ] + [ quickbook-test cond_phrase-1_5 ] + [ quickbook-test cond_phrase-1_7 ] + # TODO: This test generates invalid boostbook, so it breaks when generating html + # [ quickbook-test elements-1_5 ] + [ quickbook-test elements-1_6 ] + [ quickbook-error-test endsect-wrong-id-1_4-fail ] + [ quickbook-error-test endsect-wrong-id-1_7-fail ] + [ quickbook-error-test endsect-unopened-1_7-fail ] + [ quickbook-test escape-1_1 ] + [ quickbook-test escape-1_6 ] + [ quickbook-error-test escape-mismatched-1_5-fail ] + [ quickbook-test footnotes-1_7 ] + [ quickbook-test heading-1_1 ] + [ quickbook-test heading-1_3 ] + [ quickbook-test heading-1_5 ] + [ quickbook-test heading-1_6 ] + [ quickbook-test heading-1_7 ] + [ quickbook-error-test heading_unclosed-1_4-fail ] + [ quickbook-test hr-1_5 ] + [ quickbook-test hr-1_6 ] + [ quickbook-test identifier-1_5 ] + [ quickbook-test identifier-1_6 ] + [ quickbook-test image-1_5 ] + [ quickbook-test image-1_6 ] + [ quickbook-error-test import-1_1-fail ] + [ quickbook-error-test include-1_1-fail ] + [ quickbook-test include-1_5 ] + [ quickbook-test include-1_6 ] + [ quickbook-test include-1_7 ] + [ quickbook-test include2-1_6 ] + [ quickbook-error-test include_win_path-1_6-fail ] + [ quickbook-error-test include_invalid_path1-1_7-fail ] + [ quickbook-error-test include_invalid_path2-1_7-fail ] + [ quickbook-error-test include_invalid_path3-1_7-fail ] + [ quickbook-error-test include_unicode_glob-1_7-fail ] + [ quickbook-test link-1_1 ] + [ quickbook-test link-1_6 ] + [ quickbook-test link-1_7 ] + [ quickbook-error-test link-1_7-fail ] + [ quickbook-error-test link-1_7-fail2 ] + [ quickbook-test list_test-1_5 ] + [ quickbook-test list_test-1_6 ] + [ quickbook-error-test list_test-1_6-fail ] + [ quickbook-test list_test-1_7 ] + [ quickbook-error-test list_test-1_7-fail1 ] + [ quickbook-test macro-1_5 ] + [ quickbook-test macro-1_6 ] + [ quickbook-error-test mismatched_brackets-1_1-fail ] + [ quickbook-test mismatched_brackets1-1_1 ] + [ quickbook-test mismatched_brackets2-1_1 ] + [ quickbook-test mismatched_brackets3-1_1 ] + [ quickbook-error-test mismatched_brackets1-1_1-strict-fail : + mismatched_brackets1-1_1.quickbook : <testing.arg>--strict ] + [ quickbook-error-test mismatched_brackets2-1_1-strict-fail : + mismatched_brackets2-1_1.quickbook : <testing.arg>--strict ] + [ quickbook-error-test mismatched_brackets3-1_1-strict-fail : + mismatched_brackets3-1_1.quickbook : <testing.arg>--strict ] + [ quickbook-error-test mismatched_brackets1-1_7-strict-fail : + mismatched_brackets1-1_1.quickbook : <testing.arg>--strict ] + [ quickbook-test newline-1_1 ] + [ quickbook-test para_test-1_5 ] + [ quickbook-error-test post_process-fail ] + [ quickbook-test preformatted-1_1 ] + [ quickbook-test preformatted-1_6 ] + [ quickbook-test role-1_6 ] + [ quickbook-test role-1_7 ] + [ quickbook-error-test role-1_7-fail ] + [ quickbook-test section-1_4 ] + [ quickbook-test section-1_5-unclosed ] + [ quickbook-test section-1_5 ] + [ quickbook-error-test section-1_5-unclosed-strict-fail : + section-1_5-unclosed : <testing.arg>--strict ] + [ quickbook-test section-1_5-strict : + section-1_5.quickbook : : <testing.arg>--strict ] + [ quickbook-test section-1_7 ] + [ quickbook-test simple_markup-1_5 ] + [ quickbook-test source_mode-1_7 ] + [ quickbook-test stray_close_bracket-1_1 ] + [ quickbook-error-test stray_close_bracket-1_1-strict-fail : + stray_close_bracket-1_1.quickbook : + <testing.arg>--strict ] + [ quickbook-error-test stray_close_bracket-1_7-fail ] + [ quickbook-test svg-1_1 ] + [ quickbook-test table-1_3 ] + [ quickbook-test table-1_5 ] + [ quickbook-test table-1_6 ] + [ quickbook-test table-1_7 ] + [ quickbook-error-test template_arguments1-1_1-fail ] + [ quickbook-error-test template_arguments1-1_5-fail ] + [ quickbook-error-test template_arguments2-1_1-fail ] + [ quickbook-error-test template_arguments2-1_5-fail ] + [ quickbook-error-test template_arguments3-1_1-fail ] + [ quickbook-error-test template_arguments3-1_5-fail ] + [ quickbook-test template_section-1_5 ] + [ quickbook-error-test template_section1-1_5-fail ] + [ quickbook-error-test template_section2-1_5-fail ] + [ quickbook-error-test template_section3-1_5-fail ] + [ quickbook-test templates-1_3 ] + [ quickbook-test templates-1_4 ] + [ quickbook-test templates-1_5 ] + [ quickbook-test templates-1_6 ] + [ quickbook-error-test templates-1_6-fail1 ] + [ quickbook-test templates-1_7 ] + [ quickbook-error-test templates-1_7-fail1 ] + [ quickbook-error-test templates-1_7-fail2 ] + [ quickbook-test unicode_escape-1_5 ] + [ quickbook-test unmatched_element-1_5 ] + [ quickbook-test unmatched_element-1_6 ] + [ quickbook-error-test utf16be_bom-1_5-fail ] + [ quickbook-error-test utf16le_bom-1_5-fail ] + [ quickbook-test utf8-1_5 ] + [ quickbook-test utf8_bom-1_5 ] + [ quickbook-error-test variablelist-1_5-fail ] + [ quickbook-test variablelist-1_5 ] + [ quickbook-error-test version-0_1-fail ] + [ quickbook-error-test version-1_8-fail ] + [ quickbook-error-test version-2_0-fail ] + [ quickbook-test xml_escape-1_2 ] + [ quickbook-test xml_escape-1_5 ] + + [ quickbook-test quickbook_manual-1_4 ] + ; + +# for `b2 quick` in status +alias quick : quickbook_manual-1_4 ; +explicit quick ; diff --git a/src/boost/tools/quickbook/test/anchor-1_1.gold b/src/boost/tools/quickbook/test/anchor-1_1.gold new file mode 100644 index 000000000..e0b820971 --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_1.gold @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="anchor_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Anchor Test</title> + <section id="anchor_test.anchors"> + <title>Anchors</title> + <para> + <anchor id="a1"/>A paragraph containing several anchors. <anchor id="a2"/>We + want to make sure they appear in the correct place. <anchor id="a3"/> + </para> + <bridgehead renderas="sect3" id="anchor_test.anchors.h0"> + <phrase id="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor"/><link + linkend="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor">This + heading shouldn't pick up the previous anchor</link> + </bridgehead> + <anchor id="a4"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h1"> + <phrase id="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor"/><link + linkend="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor">This + heading should pick up the previous anchor</link> + </bridgehead> + <anchor id="a5"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h2"> + <phrase id="anchor_test.anchors.and_this_one"/><link linkend="anchor_test.anchors.and_this_one">And + this one</link> + </bridgehead> + <anchor id="a6"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h3"> + <phrase id="anchor_test.anchors.also_this_one"/><link linkend="anchor_test.anchors.also_this_one">Also + this one</link> + </bridgehead> + <anchor id="a7"/> + <bridgehead renderas="sect3" id="anchors.finally_this"> + Finally this + </bridgehead> + <anchor id="a8"/> + </section> + <section id="anchor_test.section_anchor"> + <title><anchor id="a9"/>Section Anchor</title> + <section id="anchor_test.nested_section"> + <title><anchor id="a10"/>Nested Section</title> + </section> + <anchor id="a11"/> + </section> + <section id="anchor_test.conditional_section_anchor"> + <title><anchor id="a12"/>Conditional Section Anchor</title> + </section> + <section id="anchor_test.lists"> + <title>Lists</title> <anchor id="a14"/> + <itemizedlist> + <listitem> + <simpara> + Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + Nested List <anchor id="a15"/> + <itemizedlist> + <listitem> + <simpara> + Nested Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Nested Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + <anchor id="a16"/>Nested Item 3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Item 3 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="anchor_test.anchors_in_templates"> + <title>Anchors in templates</title> + <para> + <anchor id="t1"/>Some text. + </para> + <para> + <anchor id="t2"/>Text content + </para> + </section> + <section id="anchor_test.anchors_in_syntax_highlighted_code"> + <title>Anchors in syntax highlighted code</title> +<programlisting><phrase role="keyword">int</phrase> <anchor id="s1"/><phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> + </section> + <section id="anchor_test.nested_anchors"> + <title>Nested anchors</title> + <table frame="all" id="anchor_test.nested_anchors.t0"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + <anchor id="table1"/>Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + <anchor id="table2"/>Cell 2 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 3<anchor id="table3"/> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/anchor-1_1.gold-html b/src/boost/tools/quickbook/test/anchor-1_1.gold-html new file mode 100644 index 000000000..e6610d417 --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_1.gold-html @@ -0,0 +1,205 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Anchor Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#anchor_test.anchors">Anchors</a> + </li> + <li> + <a href="#anchor_test.section_anchor"><span></span>Section Anchor</a> + </li> + <li> + <a href="#anchor_test.conditional_section_anchor"><span></span>Conditional + Section Anchor</a> + </li> + <li> + <a href="#anchor_test.lists">Lists</a> + </li> + <li> + <a href="#anchor_test.anchors_in_templates">Anchors in templates</a> + </li> + <li> + <a href="#anchor_test.anchors_in_syntax_highlighted_code">Anchors in syntax + highlighted code</a> + </li> + <li> + <a href="#anchor_test.nested_anchors">Nested anchors</a> + </li> + </ul> + </div> + <div id="anchor_test.anchors"> + <h3> + Anchors + </h3> + <div id="anchor_test.anchors"> + <p> + <span id="a1"></span>A paragraph containing several anchors. <span id="a2"></span>We + want to make sure they appear in the correct place. <span id="a3"></span> + </p> + <h3 id="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor"> + This heading shouldn't pick up the previous anchor + </h3> + <span id="a4"></span> + <h3 id="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor"> + This heading should pick up the previous anchor + </h3> + <span id="a5"></span> + <h3 id="anchor_test.anchors.and_this_one"> + And this one + </h3> + <span id="a6"></span> + <h3 id="anchor_test.anchors.also_this_one"> + Also this one + </h3> + <span id="a7"></span> + <h3 id="anchors.finally_this"> + Finally this + </h3> + <span id="a8"></span> + </div> + </div> + <div id="anchor_test.section_anchor"> + <h3> + <span id="a9"></span>Section Anchor + </h3> + <div id="anchor_test.section_anchor"> + <span id="a11"></span> + </div> + <div id="anchor_test.nested_section"> + <h3> + <span id="a10"></span>Nested Section + </h3> + <div id="anchor_test.nested_section"> + </div> + </div> + </div> + <div id="anchor_test.conditional_section_anchor"> + <h3> + <span id="a12"></span>Conditional Section Anchor + </h3> + <div id="anchor_test.conditional_section_anchor"> + </div> + </div> + <div id="anchor_test.lists"> + <h3> + Lists + </h3> + <div id="anchor_test.lists"> + <span id="a14"></span> + <ul> + <li> + <div> + Item 1 + </div> + </li> + <li> + <div> + Item 2 + </div> + </li> + <li> + <div> + Nested List <span id="a15"></span> + <ul> + <li> + <div> + Nested Item 1 + </div> + </li> + <li> + <div> + Nested Item 2 + </div> + </li> + <li> + <div> + <span id="a16"></span>Nested Item 3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + Item 3 + </div> + </li> + </ul> + </div> + </div> + <div id="anchor_test.anchors_in_templates"> + <h3> + Anchors in templates + </h3> + <div id="anchor_test.anchors_in_templates"> + <p> + <span id="t1"></span>Some text. + </p> + <p> + <span id="t2"></span>Text content + </p> + </div> + </div> + <div id="anchor_test.anchors_in_syntax_highlighted_code"> + <h3> + Anchors in syntax highlighted code + </h3> + <div id="anchor_test.anchors_in_syntax_highlighted_code"> +<pre class="programlisting"><span class="keyword">int</span> <span id="s1"></span><span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </div> + </div> + <div id="anchor_test.nested_anchors"> + <h3> + Nested anchors + </h3> + <div id="anchor_test.nested_anchors"> + <div id="anchor_test.nested_anchors.t0" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + <span id="table1"></span>Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + <span id="table2"></span>Cell 2 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 3<span id="table3"></span> + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/anchor-1_1.quickbook b/src/boost/tools/quickbook/test/anchor-1_1.quickbook new file mode 100644 index 000000000..0e8934ee0 --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_1.quickbook @@ -0,0 +1,80 @@ +[article Anchor Test] + +[section Anchors] + +[#a1] A paragraph containing several anchors. [#a2] We want to make sure +they appear in the correct place. [#a3] + +[heading This heading shouldn't pick up the previous anchor] + +[#a4] + +[heading This heading should pick up the previous anchor] + +[#a5] +[heading And this one] + +[#a6][heading Also this one] + +[#a7][h3 Finally this] + +[#a8] + +[endsect] + +[#a9] +[section Section Anchor] +[#a10][section Nested Section] +[endsect] +[/ This anchor is invalid, I'm not sure what to do with it] +[#a11] +[endsect] + +[#a12][?__not_defined__ #a13] +[section Conditional Section Anchor] +[endsect] + +[section Lists] + +[#a14] +* Item 1 +* Item 2 +* Nested List + [#a15] + * Nested Item 1 + * Nested Item 2 + * [#a16] Nested Item 3 +* Item 3 + +[endsect] + +[section Anchors in templates] + +[template anchor1[][#t1]] +[template para[] Text content] + +[anchor1] + +Some text. + +[#t2] + +[para] + +[endsect] + +[section Anchors in syntax highlighted code] + + int ``[#s1]``main() {} + +[endsect] + +[section Nested anchors] + +[table Table with anchors + [[Heading]] + [[[#table1]Cell 1]] + [[[#table2] Cell 2]] + [[Cell 3[#table3]]] +] +[endsect] diff --git a/src/boost/tools/quickbook/test/anchor-1_6.gold b/src/boost/tools/quickbook/test/anchor-1_6.gold new file mode 100644 index 000000000..5d056f2db --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_6.gold @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="anchor_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Anchor Test</title> + <section id="anchor_test.anchors"> + <title><link linkend="anchor_test.anchors">Anchors</link></title> + <para> + <anchor id="a1"/>A paragraph containing several anchors. <anchor id="a2"/>We + want to make sure they appear in the correct place. <anchor id="a3"/> + </para> + <bridgehead renderas="sect3" id="anchor_test.anchors.h0"> + <phrase id="anchor_test.anchors.this_heading_shouldn_t_pick_up_t"/><link linkend="anchor_test.anchors.this_heading_shouldn_t_pick_up_t">This + heading shouldn't pick up the previous anchor</link> + </bridgehead> + <anchor id="a4"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h1"> + <phrase id="anchor_test.anchors.this_heading_should_pick_up_the_"/><link linkend="anchor_test.anchors.this_heading_should_pick_up_the_">This + heading should pick up the previous anchor</link> + </bridgehead> + <anchor id="a5"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h2"> + <phrase id="anchor_test.anchors.and_this_one"/><link linkend="anchor_test.anchors.and_this_one">And + this one</link> + </bridgehead> + <anchor id="a6"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h3"> + <phrase id="anchor_test.anchors.also_this_one"/><link linkend="anchor_test.anchors.also_this_one">Also + this one</link> + </bridgehead> + <anchor id="a7"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h4"> + <phrase id="anchor_test.anchors.finally_this"/><link linkend="anchor_test.anchors.finally_this">Finally + this</link> + </bridgehead> + <anchor id="a8"/> + </section> + <section id="anchor_test.section_anchor"> + <title><anchor id="a9"/><link linkend="anchor_test.section_anchor">Section Anchor</link></title> + <section id="anchor_test.section_anchor.nested_section"> + <title><anchor id="a10"/><link linkend="anchor_test.section_anchor.nested_section">Nested + Section</link></title> + </section> + <anchor id="a11"/> + </section> + <section id="anchor_test.conditional_section_anchor"> + <title><anchor id="a12"/><link linkend="anchor_test.conditional_section_anchor">Conditional + Section Anchor</link></title> + </section> + <section id="anchor_test.lists"> + <title><link linkend="anchor_test.lists">Lists</link></title> <anchor id="a14"/> + <itemizedlist> + <listitem> + <simpara> + Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + Nested List <anchor id="a15"/> + <itemizedlist> + <listitem> + <simpara> + Nested Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Nested Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + <anchor id="a16"/>Nested Item 3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Item 3 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="anchor_test.anchors_in_templates"> + <title><link linkend="anchor_test.anchors_in_templates">Anchors in templates</link></title> + <para> + <anchor id="t1"/>Some text. + </para> + <para> + <anchor id="t2"/>Text content + </para> + </section> + <section id="anchor_test.anchors_in_syntax_highlighted_co"> + <title><link linkend="anchor_test.anchors_in_syntax_highlighted_co">Anchors in + syntax highlighted code</link></title> +<programlisting><phrase role="keyword">int</phrase> <anchor id="s1"/><phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> + </section> + <section id="anchor_test.nested_anchors"> + <title><link linkend="anchor_test.nested_anchors">Nested anchors</link></title> + <table frame="all" id="anchor_test.nested_anchors.table_with_anchors"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + <anchor id="table1"/>Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + <anchor id="table2"/>Cell 2 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 3<anchor id="table3"/> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="anchor_test.anchors_with_escapes"> + <title><link linkend="anchor_test.anchors_with_escapes">Anchors with escapes</link></title> + <anchor id="[oddid]"/> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/anchor-1_6.gold-html b/src/boost/tools/quickbook/test/anchor-1_6.gold-html new file mode 100644 index 000000000..001b275f5 --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_6.gold-html @@ -0,0 +1,216 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Anchor Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#anchor_test.anchors">Anchors</a> + </li> + <li> + <a href="#anchor_test.section_anchor"><span></span>Section Anchor</a> + </li> + <li> + <a href="#anchor_test.conditional_section_anchor"><span></span>Conditional + Section Anchor</a> + </li> + <li> + <a href="#anchor_test.lists">Lists</a> + </li> + <li> + <a href="#anchor_test.anchors_in_templates">Anchors in templates</a> + </li> + <li> + <a href="#anchor_test.anchors_in_syntax_highlighted_co">Anchors in syntax + highlighted code</a> + </li> + <li> + <a href="#anchor_test.nested_anchors">Nested anchors</a> + </li> + <li> + <a href="#anchor_test.anchors_with_escapes">Anchors with escapes</a> + </li> + </ul> + </div> + <div id="anchor_test.anchors"> + <h3> + Anchors + </h3> + <div id="anchor_test.anchors"> + <p> + <span id="a1"></span>A paragraph containing several anchors. <span id="a2"></span>We + want to make sure they appear in the correct place. <span id="a3"></span> + </p> + <h3 id="anchor_test.anchors.this_heading_shouldn_t_pick_up_t"> + This heading shouldn't pick up the previous anchor + </h3> + <span id="a4"></span> + <h3 id="anchor_test.anchors.this_heading_should_pick_up_the_"> + This heading should pick up the previous anchor + </h3> + <span id="a5"></span> + <h3 id="anchor_test.anchors.and_this_one"> + And this one + </h3> + <span id="a6"></span> + <h3 id="anchor_test.anchors.also_this_one"> + Also this one + </h3> + <span id="a7"></span> + <h3 id="anchor_test.anchors.finally_this"> + Finally this + </h3> + <span id="a8"></span> + </div> + </div> + <div id="anchor_test.section_anchor"> + <h3> + <span id="a9"></span>Section Anchor + </h3> + <div id="anchor_test.section_anchor"> + <span id="a11"></span> + </div> + <div id="anchor_test.section_anchor.nested_section"> + <h3> + <span id="a10"></span>Nested Section + </h3> + <div id="anchor_test.section_anchor.nested_section"> + </div> + </div> + </div> + <div id="anchor_test.conditional_section_anchor"> + <h3> + <span id="a12"></span>Conditional Section Anchor + </h3> + <div id="anchor_test.conditional_section_anchor"> + </div> + </div> + <div id="anchor_test.lists"> + <h3> + Lists + </h3> + <div id="anchor_test.lists"> + <span id="a14"></span> + <ul> + <li> + <div> + Item 1 + </div> + </li> + <li> + <div> + Item 2 + </div> + </li> + <li> + <div> + Nested List <span id="a15"></span> + <ul> + <li> + <div> + Nested Item 1 + </div> + </li> + <li> + <div> + Nested Item 2 + </div> + </li> + <li> + <div> + <span id="a16"></span>Nested Item 3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + Item 3 + </div> + </li> + </ul> + </div> + </div> + <div id="anchor_test.anchors_in_templates"> + <h3> + Anchors in templates + </h3> + <div id="anchor_test.anchors_in_templates"> + <p> + <span id="t1"></span>Some text. + </p> + <p> + <span id="t2"></span>Text content + </p> + </div> + </div> + <div id="anchor_test.anchors_in_syntax_highlighted_co"> + <h3> + Anchors in syntax highlighted code + </h3> + <div id="anchor_test.anchors_in_syntax_highlighted_co"> +<pre class="programlisting"><span class="keyword">int</span> <span id="s1"></span><span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </div> + </div> + <div id="anchor_test.nested_anchors"> + <h3> + Nested anchors + </h3> + <div id="anchor_test.nested_anchors"> + <div id="anchor_test.nested_anchors.table_with_anchors" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + <span id="table1"></span>Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + <span id="table2"></span>Cell 2 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 3<span id="table3"></span> + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="anchor_test.anchors_with_escapes"> + <h3> + Anchors with escapes + </h3> + <div id="anchor_test.anchors_with_escapes"> + <span id="[oddid]"></span> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/anchor-1_6.quickbook b/src/boost/tools/quickbook/test/anchor-1_6.quickbook new file mode 100644 index 000000000..8d4a7b34e --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_6.quickbook @@ -0,0 +1,88 @@ +[article Anchor Test +[quickbook 1.6] +] + +[section Anchors] + +[#a1] A paragraph containing several anchors. [#a2] We want to make sure +they appear in the correct place. [#a3] + +[heading This heading shouldn't pick up the previous anchor] + +[#a4] + +[heading This heading should pick up the previous anchor] + +[#a5] +[heading And this one] + +[#a6][heading Also this one] + +[#a7][h3 Finally this] + +[#a8] + +[endsect] + +[#a9] +[section Section Anchor] +[#a10][section Nested Section] +[endsect] +[/ This anchor is invalid, I'm not sure what to do with it] +[#a11] +[endsect] + +[#a12][?__not_defined__ #a13] +[section Conditional Section Anchor] +[endsect] + +[section Lists] + +[#a14] +* Item 1 +* Item 2 +* Nested List + [#a15] + * Nested Item 1 + * Nested Item 2 + * [#a16] Nested Item 3 +* Item 3 + +[endsect] + +[section Anchors in templates] + +[template anchor1[][#t1]] +[template para[] Text content] + +[anchor1] + +Some text. + +[#t2] + +[para] + +[endsect] + +[section Anchors in syntax highlighted code] + + int ``[#s1]``main() {} + +[endsect] + +[section Nested anchors] + +[table Table with anchors + [[Heading]] + [[[#table1]Cell 1]] + [[[#table2] Cell 2]] + [[Cell 3[#table3]]] +] +[endsect] + +[section Anchors with escapes] + +[#\[oddid\]] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/anchor-1_7.gold b/src/boost/tools/quickbook/test/anchor-1_7.gold new file mode 100644 index 000000000..71e22458d --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_7.gold @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="anchor_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Anchor Test</title> + <section id="anchor_test.anchors"> + <title><link linkend="anchor_test.anchors">Anchors</link></title> + <para> + <anchor id="a1"/>A paragraph containing several anchors. <anchor id="a2"/>We + want to make sure they appear in the correct place. <anchor id="a3"/> + </para> + <bridgehead renderas="sect3" id="anchor_test.anchors.h0"> + <phrase id="anchor_test.anchors.this_heading_shouldn_t_pick_up_t"/><link linkend="anchor_test.anchors.this_heading_shouldn_t_pick_up_t">This + heading shouldn't pick up the previous anchor</link> + </bridgehead> + <anchor id="a4"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h1"> + <phrase id="anchor_test.anchors.this_heading_should_pick_up_the_"/><link linkend="anchor_test.anchors.this_heading_should_pick_up_the_">This + heading should pick up the previous anchor</link> + </bridgehead> + <anchor id="a5"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h2"> + <phrase id="anchor_test.anchors.and_this_one"/><link linkend="anchor_test.anchors.and_this_one">And + this one</link> + </bridgehead> + <anchor id="a6"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h3"> + <phrase id="anchor_test.anchors.also_this_one"/><link linkend="anchor_test.anchors.also_this_one">Also + this one</link> + </bridgehead> + <anchor id="a7"/> + <bridgehead renderas="sect3" id="anchor_test.anchors.h4"> + <phrase id="anchor_test.anchors.finally_this"/><link linkend="anchor_test.anchors.finally_this">Finally + this</link> + </bridgehead> + <anchor id="a8"/> + </section> + <section id="anchor_test.section_anchor"> + <title><anchor id="a9"/><link linkend="anchor_test.section_anchor">Section Anchor</link></title> + <section id="anchor_test.section_anchor.nested_section"> + <title><anchor id="a10"/><link linkend="anchor_test.section_anchor.nested_section">Nested + Section</link></title> + </section> + <anchor id="a11"/> + </section> + <section id="anchor_test.conditional_section_anchor"> + <title><anchor id="a12"/><link linkend="anchor_test.conditional_section_anchor">Conditional + Section Anchor</link></title> + </section> + <section id="anchor_test.lists"> + <title><link linkend="anchor_test.lists">Lists</link></title> <anchor id="a14"/> + <itemizedlist> + <listitem> + <simpara> + Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + Nested List <anchor id="a15"/> + <itemizedlist> + <listitem> + <simpara> + Nested Item 1 + </simpara> + </listitem> + <listitem> + <simpara> + Nested Item 2 + </simpara> + </listitem> + <listitem> + <simpara> + <anchor id="a16"/>Nested Item 3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Item 3 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="anchor_test.anchors_in_templates"> + <title><link linkend="anchor_test.anchors_in_templates">Anchors in templates</link></title> + <para> + <anchor id="t1"/>Some text. + </para> + <para> + <anchor id="t2"/>Text content + </para> + </section> + <section id="anchor_test.anchors_in_syntax_highlighted_co"> + <title><link linkend="anchor_test.anchors_in_syntax_highlighted_co">Anchors in + syntax highlighted code</link></title> +<programlisting><phrase role="keyword">int</phrase> <anchor id="s1"/><phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> + </section> + <section id="anchor_test.nested_anchors"> + <title><link linkend="anchor_test.nested_anchors">Nested anchors</link></title> + <table frame="all" id="anchor_test.nested_anchors.table_with_anchors"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + <anchor id="table1"/>Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + <anchor id="table2"/>Cell 2 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 3<anchor id="table3"/> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="anchor_test.templates"> + <title><link linkend="anchor_test.templates">Anchors with templates</link></title> + <anchor id="anchor1"/><anchor id="anchor2"/><anchor id="x1y"/><anchor id="x12y"/> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/anchor-1_7.gold-html b/src/boost/tools/quickbook/test/anchor-1_7.gold-html new file mode 100644 index 000000000..890eb5191 --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_7.gold-html @@ -0,0 +1,217 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Anchor Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#anchor_test.anchors">Anchors</a> + </li> + <li> + <a href="#anchor_test.section_anchor"><span></span>Section Anchor</a> + </li> + <li> + <a href="#anchor_test.conditional_section_anchor"><span></span>Conditional + Section Anchor</a> + </li> + <li> + <a href="#anchor_test.lists">Lists</a> + </li> + <li> + <a href="#anchor_test.anchors_in_templates">Anchors in templates</a> + </li> + <li> + <a href="#anchor_test.anchors_in_syntax_highlighted_co">Anchors in syntax + highlighted code</a> + </li> + <li> + <a href="#anchor_test.nested_anchors">Nested anchors</a> + </li> + <li> + <a href="#anchor_test.templates">Anchors with templates</a> + </li> + </ul> + </div> + <div id="anchor_test.anchors"> + <h3> + Anchors + </h3> + <div id="anchor_test.anchors"> + <p> + <span id="a1"></span>A paragraph containing several anchors. <span id="a2"></span>We + want to make sure they appear in the correct place. <span id="a3"></span> + </p> + <h3 id="anchor_test.anchors.this_heading_shouldn_t_pick_up_t"> + This heading shouldn't pick up the previous anchor + </h3> + <span id="a4"></span> + <h3 id="anchor_test.anchors.this_heading_should_pick_up_the_"> + This heading should pick up the previous anchor + </h3> + <span id="a5"></span> + <h3 id="anchor_test.anchors.and_this_one"> + And this one + </h3> + <span id="a6"></span> + <h3 id="anchor_test.anchors.also_this_one"> + Also this one + </h3> + <span id="a7"></span> + <h3 id="anchor_test.anchors.finally_this"> + Finally this + </h3> + <span id="a8"></span> + </div> + </div> + <div id="anchor_test.section_anchor"> + <h3> + <span id="a9"></span>Section Anchor + </h3> + <div id="anchor_test.section_anchor"> + <span id="a11"></span> + </div> + <div id="anchor_test.section_anchor.nested_section"> + <h3> + <span id="a10"></span>Nested Section + </h3> + <div id="anchor_test.section_anchor.nested_section"> + </div> + </div> + </div> + <div id="anchor_test.conditional_section_anchor"> + <h3> + <span id="a12"></span>Conditional Section Anchor + </h3> + <div id="anchor_test.conditional_section_anchor"> + </div> + </div> + <div id="anchor_test.lists"> + <h3> + Lists + </h3> + <div id="anchor_test.lists"> + <span id="a14"></span> + <ul> + <li> + <div> + Item 1 + </div> + </li> + <li> + <div> + Item 2 + </div> + </li> + <li> + <div> + Nested List <span id="a15"></span> + <ul> + <li> + <div> + Nested Item 1 + </div> + </li> + <li> + <div> + Nested Item 2 + </div> + </li> + <li> + <div> + <span id="a16"></span>Nested Item 3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + Item 3 + </div> + </li> + </ul> + </div> + </div> + <div id="anchor_test.anchors_in_templates"> + <h3> + Anchors in templates + </h3> + <div id="anchor_test.anchors_in_templates"> + <p> + <span id="t1"></span>Some text. + </p> + <p> + <span id="t2"></span>Text content + </p> + </div> + </div> + <div id="anchor_test.anchors_in_syntax_highlighted_co"> + <h3> + Anchors in syntax highlighted code + </h3> + <div id="anchor_test.anchors_in_syntax_highlighted_co"> +<pre class="programlisting"><span class="keyword">int</span> <span id="s1"></span><span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </div> + </div> + <div id="anchor_test.nested_anchors"> + <h3> + Nested anchors + </h3> + <div id="anchor_test.nested_anchors"> + <div id="anchor_test.nested_anchors.table_with_anchors" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + <span id="table1"></span>Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + <span id="table2"></span>Cell 2 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 3<span id="table3"></span> + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="anchor_test.templates"> + <h3> + Anchors with templates + </h3> + <div id="anchor_test.templates"> + <span id="anchor1"></span><span id="anchor2"></span><span id="x1y"></span><span + id="x12y"></span> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/anchor-1_7.quickbook b/src/boost/tools/quickbook/test/anchor-1_7.quickbook new file mode 100644 index 000000000..f2b5c13db --- /dev/null +++ b/src/boost/tools/quickbook/test/anchor-1_7.quickbook @@ -0,0 +1,97 @@ +[article Anchor Test +[quickbook 1.7] +] + +[section Anchors] + +[#a1] A paragraph containing several anchors. [#a2] We want to make sure +they appear in the correct place. [#a3] + +[heading This heading shouldn't pick up the previous anchor] + +[#a4] + +[heading This heading should pick up the previous anchor] + +[#a5] +[heading And this one] + +[#a6][heading Also this one] + +[#a7][h3 Finally this] + +[#a8] + +[endsect] + +[#a9] +[section Section Anchor] +[#a10][section Nested Section] +[endsect] +[/ This anchor is invalid, I'm not sure what to do with it] +[#a11] +[endsect] + +[#a12][?__not_defined__ #a13] +[section Conditional Section Anchor] +[endsect] + +[section Lists] + +[#a14] +* Item 1 +* Item 2 +* Nested List + [#a15] + * Nested Item 1 + * Nested Item 2 + * [#a16] Nested Item 3 +* Item 3 + +[endsect] + +[section Anchors in templates] + +[template anchor1[][#t1]] +[template para[] Text content] + +[anchor1] + +Some text. + +[#t2] + +[para] + +[endsect] + +[section Anchors in syntax highlighted code] + + int ``[#s1]``main() {} + +[endsect] + +[section Nested anchors] + +[table Table with anchors + [[Heading]] + [[[#table1]Cell 1]] + [[[#table2] Cell 2]] + [[Cell 3[#table3]]] +] +[endsect] + +[section:templates Anchors with templates] + +[template a1 anchor1] +[template a2 anchor2] + +[#[a1]] +[#[a2]] + +[template anchor[name] [#x[name]y]] + +[anchor 1] +[anchor 12] + +[endsect] [/ templates] diff --git a/src/boost/tools/quickbook/test/blocks-1_5.gold b/src/boost/tools/quickbook/test/blocks-1_5.gold new file mode 100644 index 000000000..2d7370be6 --- /dev/null +++ b/src/boost/tools/quickbook/test/blocks-1_5.gold @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="various_blocks" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Various blocks</title> + <bridgehead renderas="sect2" id="various_blocks.h0"> + <phrase id="various_blocks.blockquotes"/><link linkend="various_blocks.blockquotes">Blockquotes</link> + </bridgehead> + <para> + Here's a blockquote: + </para> + <blockquote> + <para> + Blockquote. + </para> + </blockquote> + <para> + And another: + </para> + <blockquote> + <para> + Blockquote first paragraph. + </para> + <para> + Blockquote second paragraph. + </para> + </blockquote> + <bridgehead renderas="sect2" id="various_blocks.h1"> + <phrase id="various_blocks.admonitions"/><link linkend="various_blocks.admonitions">Admonitions</link> + </bridgehead> + <warning> + <para> + Warning + </para> + </warning> + <caution> + <para> + Caution + </para> + </caution> + <important> + <para> + Important + </para> + </important> + <note> + <para> + Note + </para> + </note> + <tip> + <para> + Tip + </para> + </tip> + <warning> + <para> + Warning first paragraph. + </para> + <para> + Warning second paragraph. + </para> + </warning> + <bridgehead renderas="sect2" id="various_blocks.h2"> + <phrase id="various_blocks.blurb"/><link linkend="various_blocks.blurb">Blurb</link> + </bridgehead> + <sidebar role="blurb"> + <para> + Blurb + </para> + </sidebar> + <bridgehead renderas="sect2" id="various_blocks.h3"> + <phrase id="various_blocks.inline_blocks"/><link linkend="various_blocks.inline_blocks">Inline + blocks</link> + </bridgehead> + <blockquote> + <para> + Blockquote containing a footnote<footnote id="various_blocks.f0"> + <para> + Here it is! + </para> + </footnote>. + </para> + </blockquote> + <para> + [tipping point] + </para> + <para> + Multiple paragraphs because of the inline blocks. + </para> + <warning> + <para> + Warning + </para> + </warning> + <para> + This line should appear as a separate paragraph. + </para> + <warning> + <para> + Warning + </para> + </warning> + <itemizedlist> + <listitem> + <simpara> + This should be a list item because it's preceded by block markup. + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/blocks-1_5.gold-html b/src/boost/tools/quickbook/test/blocks-1_5.gold-html new file mode 100644 index 000000000..c60436487 --- /dev/null +++ b/src/boost/tools/quickbook/test/blocks-1_5.gold-html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Various blocks + </h3> + <h2 id="various_blocks.blockquotes"> + Blockquotes + </h2> + <p> + Here's a blockquote: + </p> + <blockquote> + <p> + Blockquote. + </p> + </blockquote> + <p> + And another: + </p> + <blockquote> + <p> + Blockquote first paragraph. + </p> + <p> + Blockquote second paragraph. + </p> + </blockquote> + <h2 id="various_blocks.admonitions"> + Admonitions + </h2> + <div class="warning"> + <p> + Warning + </p> + </div> + <div class="caution"> + <p> + Caution + </p> + </div> + <div class="important"> + <p> + Important + </p> + </div> + <div class="note"> + <p> + Note + </p> + </div> + <div class="tip"> + <p> + Tip + </p> + </div> + <div class="warning"> + <p> + Warning first paragraph. + </p> + <p> + Warning second paragraph. + </p> + </div> + <h2 id="various_blocks.blurb"> + Blurb + </h2> + <div class="blurb"> + <p> + Blurb + </p> + </div> + <h2 id="various_blocks.inline_blocks"> + Inline blocks + </h2> + <blockquote> + <p> + Blockquote containing a footnote<a id="various_blocks.f0" href="#footnote-1"><sup + class="footnote">[1]</sup></a>. + </p> + </blockquote> + <p> + [tipping point] + </p> + <p> + Multiple paragraphs because of the inline blocks. + </p> + <div class="warning"> + <p> + Warning + </p> + </div> + <p> + This line should appear as a separate paragraph. + </p> + <div class="warning"> + <p> + Warning + </p> + </div> + <ul> + <li> + <div> + This should be a list item because it's preceded by block markup. + </div> + </li> + </ul> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#various_blocks.f0"><sup>[1]</sup></a> Here it is! + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/blocks-1_5.quickbook b/src/boost/tools/quickbook/test/blocks-1_5.quickbook new file mode 100644 index 000000000..2632a0fd6 --- /dev/null +++ b/src/boost/tools/quickbook/test/blocks-1_5.quickbook @@ -0,0 +1,46 @@ +[article Various blocks +[quickbook 1.5] +] + +[heading Blockquotes] + +Here's a blockquote: + +[:Blockquote.] + +And another: + +[: +Blockquote first paragraph. + +Blockquote second paragraph. +] + +[heading Admonitions] + +[warning Warning] +[caution Caution] +[important Important] +[note Note] +[tip Tip] + +[warning Warning first paragraph. + +Warning second paragraph.] + +[heading Blurb] + +[blurb Blurb] + +[heading Inline blocks] + +[: Blockquote containing a footnote[footnote Here it is!].] + +[/ Unfortunately footnotes currently can't contain blocks.] + +[/ Quickbook shouldn't think that this is a tip] +[tipping point] + +Multiple paragraphs because of the inline blocks. [warning Warning] This +line should appear as a separate paragraph.[warning Warning] +* This should be a list item because it's preceded by block markup.
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/callouts-1_5.gold b/src/boost/tools/quickbook/test/callouts-1_5.gold new file mode 100644 index 000000000..5b66c9933 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_5.gold @@ -0,0 +1,241 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="callout_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Callout Tests</title> + <para> + Example 1: + </para> + <para> + Now we can define a function that simulates an ordinary six-sided die. + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c0" linkends="callout_tests.c1" /> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c0" id="callout_tests.c1"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> + Example 2: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c2" linkends="callout_tests.c3" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c2" id="callout_tests.c3"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c4" linkends="callout_tests.c5" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c4" id="callout_tests.c5"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3 (again!): + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c6" linkends="callout_tests.c7" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c6" id="callout_tests.c7"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 4: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c8" linkends="callout_tests.c9" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> + <co id="callout_tests.c10" linkends="callout_tests.c11" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c12" linkends="callout_tests.c13" /> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c8" id="callout_tests.c9"> + <para> + callout 1 + </para> + </callout> + <callout arearefs="callout_tests.c10" id="callout_tests.c11"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.c12" id="callout_tests.c13"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> +<programlisting><co id="callout_tests.c14" linkends="callout_tests.c15" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c16" linkends="callout_tests.c17" /> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.c14" id="callout_tests.c15"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.c16" id="callout_tests.c17"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <section id="callout_tests.test_section"> + <title><link linkend="callout_tests.test_section">Try callouts in a section</link></title> + <para> + Example 1: + </para> + <para> + Now we can define a function that simulates an ordinary six-sided die. + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c0" linkends="callout_tests.test_section.c1" /> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c0" id="callout_tests.test_section.c1"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> + Example 2: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c2" linkends="callout_tests.test_section.c3" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c2" id="callout_tests.test_section.c3"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c4" linkends="callout_tests.test_section.c5" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c4" id="callout_tests.test_section.c5"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3 (again!): + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c6" linkends="callout_tests.test_section.c7" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c6" id="callout_tests.test_section.c7"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 4: + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c8" linkends="callout_tests.test_section.c9" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> + <co id="callout_tests.test_section.c10" linkends="callout_tests.test_section.c11" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c12" linkends="callout_tests.test_section.c13" /> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c8" id="callout_tests.test_section.c9"> + <para> + callout 1 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c10" id="callout_tests.test_section.c11"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c12" id="callout_tests.test_section.c13"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> +<programlisting><co id="callout_tests.test_section.c14" linkends="callout_tests.test_section.c15" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c16" linkends="callout_tests.test_section.c17" /> +</programlisting> + </para> + <calloutlist> + <callout arearefs="callout_tests.test_section.c14" id="callout_tests.test_section.c15"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c16" id="callout_tests.test_section.c17"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/callouts-1_5.gold-html b/src/boost/tools/quickbook/test/callouts-1_5.gold-html new file mode 100644 index 000000000..17319559b --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_5.gold-html @@ -0,0 +1,276 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Callout Tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#callout_tests.test_section">Try callouts in a section</a> + </li> + </ul> + </div> + <p> + Example 1: + </p> + <p> + Now we can define a function that simulates an ordinary six-sided die. + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c1">(1)</a> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.c1"> + <a href="#callout_tests.c0">(1)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> + Example 2: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c3">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.c3"> + <a href="#callout_tests.c2">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c5">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.c5"> + <a href="#callout_tests.c4">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3 (again!): + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c7">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.c7"> + <a href="#callout_tests.c6">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 4: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c9">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> + <a href="#callout_tests.c11">(2)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c13">(3)</a> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.c9"> + <a href="#callout_tests.c8">(1)</a> + <p> + callout 1 + </p> + </div> + <div id="callout_tests.c11"> + <a href="#callout_tests.c10">(2)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.c13"> + <a href="#callout_tests.c12">(3)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> +<pre class="programlisting"><a href="#callout_tests.c15">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c17">(2)</a> +</pre> + </p> + <div> + <div id="callout_tests.c15"> + <a href="#callout_tests.c14">(1)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.c17"> + <a href="#callout_tests.c16">(2)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <div id="callout_tests.test_section"> + <h3> + Try callouts in a section + </h3> + <div id="callout_tests.test_section"> + <p> + Example 1: + </p> + <p> + Now we can define a function that simulates an ordinary six-sided die. + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c1">(1)</a> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c1"> + <a href="#callout_tests.test_section.c0">(1)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> + Example 2: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c3">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c3"> + <a href="#callout_tests.test_section.c2">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c5">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c5"> + <a href="#callout_tests.test_section.c4">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3 (again!): + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c7">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c7"> + <a href="#callout_tests.test_section.c6">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 4: + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c9">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> + <a href="#callout_tests.test_section.c11">(2)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c13">(3)</a> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c9"> + <a href="#callout_tests.test_section.c8">(1)</a> + <p> + callout 1 + </p> + </div> + <div id="callout_tests.test_section.c11"> + <a href="#callout_tests.test_section.c10">(2)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.test_section.c13"> + <a href="#callout_tests.test_section.c12">(3)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> +<pre class="programlisting"><a href="#callout_tests.test_section.c15">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c17">(2)</a> +</pre> + </p> + <div> + <div id="callout_tests.test_section.c15"> + <a href="#callout_tests.test_section.c14">(1)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.test_section.c17"> + <a href="#callout_tests.test_section.c16">(2)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/callouts-1_5.quickbook b/src/boost/tools/quickbook/test/callouts-1_5.quickbook new file mode 100644 index 000000000..b17e90489 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_5.quickbook @@ -0,0 +1,51 @@ +[article Callout Tests + [quickbook 1.5] +] + +[import callouts.cpp] + +Example 1: + +[example1] + +Example 2: + +[example2] + +Example 3: + +[example3] + +Example 3 (again!): + +[example3] + +Example 4: + +[example4] +[example4a] + +[section:test_section Try callouts in a section] + +Example 1: + +[example1] + +Example 2: + +[example2] + +Example 3: + +[example3] + +Example 3 (again!): + +[example3] + +Example 4: + +[example4] +[example4a] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/callouts-1_7.gold b/src/boost/tools/quickbook/test/callouts-1_7.gold new file mode 100644 index 000000000..5d2c2d154 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_7.gold @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="callout_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Callout Tests</title> + <para> + Example 1: + </para> + <para> + Now we can define a function that simulates an ordinary six-sided die. + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c0" linkends="callout_tests.c1" /> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c0" id="callout_tests.c1"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> + Example 2: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c2" linkends="callout_tests.c3" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c2" id="callout_tests.c3"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c4" linkends="callout_tests.c5" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c4" id="callout_tests.c5"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3 (again!): + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c6" linkends="callout_tests.c7" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c6" id="callout_tests.c7"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 4: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.c8" linkends="callout_tests.c9" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> + <co id="callout_tests.c10" linkends="callout_tests.c11" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c12" linkends="callout_tests.c13" /> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c8" id="callout_tests.c9"> + <para> + callout 1 + </para> + </callout> + <callout arearefs="callout_tests.c10" id="callout_tests.c11"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.c12" id="callout_tests.c13"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> +<programlisting><co id="callout_tests.c14" linkends="callout_tests.c15" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.c16" linkends="callout_tests.c17" /> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.c14" id="callout_tests.c15"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.c16" id="callout_tests.c17"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <section id="callout_tests.test_section"> + <title><link linkend="callout_tests.test_section">Try callouts in a section</link></title> + <para> + Example 1: + </para> + <para> + Now we can define a function that simulates an ordinary six-sided die. + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c0" linkends="callout_tests.test_section.c1" /> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c0" id="callout_tests.test_section.c1"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + <para> + Example 2: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c2" linkends="callout_tests.test_section.c3" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c2" id="callout_tests.test_section.c3"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c4" linkends="callout_tests.test_section.c5" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c4" id="callout_tests.test_section.c5"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 3 (again!): + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c6" linkends="callout_tests.test_section.c7" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c6" id="callout_tests.test_section.c7"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + Example 4: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.test_section.c8" linkends="callout_tests.test_section.c9" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> + <co id="callout_tests.test_section.c10" linkends="callout_tests.test_section.c11" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c12" linkends="callout_tests.test_section.c13" /> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c8" id="callout_tests.test_section.c9"> + <para> + callout 1 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c10" id="callout_tests.test_section.c11"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c12" id="callout_tests.test_section.c13"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> +<programlisting><co id="callout_tests.test_section.c14" linkends="callout_tests.test_section.c15" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.test_section.c16" linkends="callout_tests.test_section.c17" /> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.test_section.c14" id="callout_tests.test_section.c15"> + <para> + callout 2 + </para> + </callout> + <callout arearefs="callout_tests.test_section.c16" id="callout_tests.test_section.c17"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> + </section> + <section id="callout_tests.blocks"> + <title><link linkend="callout_tests.blocks">Callouts in code blocks</link></title> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <co id="callout_tests.blocks.c0" linkends="callout_tests.blocks.c1" /> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.blocks.c0" id="callout_tests.blocks.c1"> + <para> + create a uniform_int distribution + </para> + </callout> + </calloutlist> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <co id="callout_tests.blocks.c2" linkends="callout_tests.blocks.c3" /><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special"><></phrase> <phrase role="special">></phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase> +<phrase role="special">}</phrase> +</programlisting> + <calloutlist> + <callout arearefs="callout_tests.blocks.c2" id="callout_tests.blocks.c3"> + <important> + <para> + test + </para> + </important> + </callout> + </calloutlist> + <para> + <code><phrase role="comment">/*< This shouldn't be a callout >*/</phrase></code> + </para> + <para>Silly test<co linkends="silly-callout"/></para> +<calloutlist><callout id="silly-callout"><para>silly</para></callout></calloutlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/callouts-1_7.gold-html b/src/boost/tools/quickbook/test/callouts-1_7.gold-html new file mode 100644 index 000000000..4ca439bb2 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_7.gold-html @@ -0,0 +1,302 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Callout Tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#callout_tests.test_section">Try callouts in a section</a> + </li> + <li> + <a href="#callout_tests.blocks">Callouts in code blocks</a> + </li> + </ul> + </div> + <p> + Example 1: + </p> + <p> + Now we can define a function that simulates an ordinary six-sided die. + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c1">(1)</a> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.c1"> + <a href="#callout_tests.c0">(1)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> + Example 2: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c3">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.c3"> + <a href="#callout_tests.c2">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c5">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.c5"> + <a href="#callout_tests.c4">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3 (again!): + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c7">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.c7"> + <a href="#callout_tests.c6">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 4: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.c9">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> + <a href="#callout_tests.c11">(2)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c13">(3)</a> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.c9"> + <a href="#callout_tests.c8">(1)</a> + <p> + callout 1 + </p> + </div> + <div id="callout_tests.c11"> + <a href="#callout_tests.c10">(2)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.c13"> + <a href="#callout_tests.c12">(3)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> +<pre class="programlisting"><a href="#callout_tests.c15">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.c17">(2)</a> +</pre> + <div> + <div id="callout_tests.c15"> + <a href="#callout_tests.c14">(1)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.c17"> + <a href="#callout_tests.c16">(2)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <div id="callout_tests.test_section"> + <h3> + Try callouts in a section + </h3> + <div id="callout_tests.test_section"> + <p> + Example 1: + </p> + <p> + Now we can define a function that simulates an ordinary six-sided die. + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c1">(1)</a> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.test_section.c1"> + <a href="#callout_tests.test_section.c0">(1)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + <p> + Example 2: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c3">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.test_section.c3"> + <a href="#callout_tests.test_section.c2">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c5">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.test_section.c5"> + <a href="#callout_tests.test_section.c4">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 3 (again!): + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c7">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.test_section.c7"> + <a href="#callout_tests.test_section.c6">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + Example 4: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.test_section.c9">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> + <a href="#callout_tests.test_section.c11">(2)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c13">(3)</a> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.test_section.c9"> + <a href="#callout_tests.test_section.c8">(1)</a> + <p> + callout 1 + </p> + </div> + <div id="callout_tests.test_section.c11"> + <a href="#callout_tests.test_section.c10">(2)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.test_section.c13"> + <a href="#callout_tests.test_section.c12">(3)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> +<pre class="programlisting"><a href="#callout_tests.test_section.c15">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.test_section.c17">(2)</a> +</pre> + <div> + <div id="callout_tests.test_section.c15"> + <a href="#callout_tests.test_section.c14">(1)</a> + <p> + callout 2 + </p> + </div> + <div id="callout_tests.test_section.c17"> + <a href="#callout_tests.test_section.c16">(2)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> + </div> + </div> + <div id="callout_tests.blocks"> + <h3> + Callouts in code blocks + </h3> + <div id="callout_tests.blocks"> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="identifier">dist</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">6</span><span class="special">);</span> <a href="#callout_tests.blocks.c1">(1)</a> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.blocks.c1"> + <a href="#callout_tests.blocks.c0">(1)</a> + <p> + create a uniform_int distribution + </p> + </div> + </div> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">roll_die</span><span class="special">()</span> <span class="special">{</span> + <a href="#callout_tests.blocks.c3">(1)</a><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_int</span><span class="special"><></span> <span class="special">></span> <span class="identifier">die</span><span class="special">(</span><span class="identifier">gen</span><span class="special">,</span> <span class="identifier">dist</span><span class="special">);</span> +<span class="special">}</span> +</pre> + <div> + <div id="callout_tests.blocks.c3"> + <a href="#callout_tests.blocks.c2">(1)</a> + <div class="important"> + <p> + test + </p> + </div> + </div> + </div> + <p> + <code><span class="comment">/*< This shouldn't be a callout >*/</span></code> + </p> + <p> + Silly test<a href="#silly-callout">(1)</a> + </p> + <div> + <div id="silly-callout"> + (1) + <p> + silly + </p> + </div> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/callouts-1_7.quickbook b/src/boost/tools/quickbook/test/callouts-1_7.quickbook new file mode 100644 index 000000000..5361ba900 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts-1_7.quickbook @@ -0,0 +1,73 @@ +[article Callout Tests + [quickbook 1.7] +] + +[import callouts.cpp] + +Example 1: + +[example1] + +Example 2: + +[example2] + +Example 3: + +[example3] + +Example 3 (again!): + +[example3] + +Example 4: + +[example4] +[example4a] + +[section:test_section Try callouts in a section] + +Example 1: + +[example1] + +Example 2: + +[example2] + +Example 3: + +[example3] + +Example 3 (again!): + +[example3] + +Example 4: + +[example4] +[example4a] + +[endsect] + +[section:blocks Callouts in code blocks] + + int roll_die() { + boost::uniform_int<> dist(1, 6); /*< create a uniform_int distribution >*/ + } + +``` +int roll_die() { + /*<< [important test] >>*/ + boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} +``` + +`/*< This shouldn't be a callout >*/` + +[block''' +<para>Silly test<co linkends="silly-callout"/></para> +<calloutlist><callout id="silly-callout"><para>silly</para></callout></calloutlist> +'''] + +[endsect] diff --git a/src/boost/tools/quickbook/test/callouts.cpp b/src/boost/tools/quickbook/test/callouts.cpp new file mode 100644 index 000000000..8506a93f1 --- /dev/null +++ b/src/boost/tools/quickbook/test/callouts.cpp @@ -0,0 +1,52 @@ + +// Copyright 2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or move at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off + +/*< This shouldn't be used. >*/ + +//[ example1 + +/*` + Now we can define a function that simulates an ordinary + six-sided die. +*/ +int roll_die() { + boost::uniform_int<> dist(1, 6); /*< create a uniform_int distribution >*/ +} + +//] + +//[ example2 + +int roll_die() { + /*<< [important test] >>*/ + boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} + +//] + +//[ example3 + +int roll_die() { + /*<< [important test] + >>*/ + boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} + +//] + +//[ example4 + +int roll_die() { + /*<< callout 1 >>*/ + boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +//[ example4a + /*<< callout 2 >>*/ + boost::uniform_int<> dist(1, 6); /*< create a uniform_int distribution >*/ +//] +} + +//] diff --git a/src/boost/tools/quickbook/test/code-1_1.gold b/src/boost/tools/quickbook/test/code-1_1.gold new file mode 100644 index 000000000..d7382593b --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_1.gold @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="code_block" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Code Block</title> + <section id="code_block.test_1"> + <title>Test 1</title> + <para> + A code block with proper indentation ;-) + </para> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> + <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </section> + <section id="code_block.test_2"> + <title>Test 2</title> + <para> + A code block with proper indentation ;-) + </para> + <para> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> + <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + </section> + <section id="code_block.test_3"> + <title>Test 3</title> + <para> +<programlisting><phrase role="keyword">print</phrase> <phrase role="string">"\xfabln\xeck"</phrase> +</programlisting> + </para> + </section> + <section id="code_block.test_4"> + <title>Test 4</title> + <para> + This isn't valid C++ but I think we should accept it; + </para> + <para> +<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase><phrase role="special"><<</phrase><phrase role="string">"\xfabln\xeck"</phrase><phrase role="special"><<</phrase><phrase role="string">"\n"</phrase><phrase role="special">;</phrase> +</programlisting> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/code-1_1.gold-html b/src/boost/tools/quickbook/test/code-1_1.gold-html new file mode 100644 index 000000000..3c676ecc2 --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_1.gold-html @@ -0,0 +1,91 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Code Block + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#code_block.test_1">Test 1</a> + </li> + <li> + <a href="#code_block.test_2">Test 2</a> + </li> + <li> + <a href="#code_block.test_3">Test 3</a> + </li> + <li> + <a href="#code_block.test_4">Test 4</a> + </li> + </ul> + </div> + <div id="code_block.test_1"> + <h3> + Test 1 + </h3> + <div id="code_block.test_1"> + <p> + A code block with proper indentation ;-) + </p> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello, World!"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> + <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </div> + </div> + <div id="code_block.test_2"> + <h3> + Test 2 + </h3> + <div id="code_block.test_2"> + <p> + A code block with proper indentation ;-) + </p> + <p> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello, World!"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> + <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + </div> + </div> + <div id="code_block.test_3"> + <h3> + Test 3 + </h3> + <div id="code_block.test_3"> + <p> +<pre class="programlisting"><span class="keyword">print</span> <span class="string">"\xfabln\xeck"</span> +</pre> + </p> + </div> + </div> + <div id="code_block.test_4"> + <h3> + Test 4 + </h3> + <div id="code_block.test_4"> + <p> + This isn't valid C++ but I think we should accept it; + </p> + <p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="string">"\xfabln\xeck"</span><span class="special"><<</span><span class="string">"\n"</span><span class="special">;</span> +</pre> + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code-1_1.quickbook b/src/boost/tools/quickbook/test/code-1_1.quickbook new file mode 100644 index 000000000..8c800911a --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_1.quickbook @@ -0,0 +1,51 @@ +[article Code Block] + +[section Test 1] + +A code block with proper indentation ;-) + + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + +[endsect] + +[section Test 2] + +A code block with proper indentation ;-) + +`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } +`` + +[endsect] + +[section Test 3] + +[python] +`` + print "\xfabln\xeck" +`` + +[endsect] + +[section Test 4] + +This isn't valid C++ but I think we should accept it; + +[c++] +`` + std::cout<<"\xfabln\xeck"<<"\n"; +`` + +[endsect] diff --git a/src/boost/tools/quickbook/test/code-1_5.gold b/src/boost/tools/quickbook/test/code-1_5.gold new file mode 100644 index 000000000..8ca228126 --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_5.gold @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="indented_code_blocks" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Indented code blocks</title> + <para> + In a paragraph. Still in a paragraph. + </para> +<programlisting>In a code block. +</programlisting> + <para> + Back in a paragraph. + </para> +<programlisting> Code block line 1. +Code block line 2. + Code block line 3. +</programlisting> + <para> + Paragraph. + </para> +<programlisting>Code block with no trailing blank lines. +</programlisting> + <para> + Paragraph. + </para> + <bridgehead renderas="sect2" id="indented_code_blocks.h0"> + <phrase id="indented_code_blocks.code_blocks_separated_by_comment"/><link linkend="indented_code_blocks.code_blocks_separated_by_comment">Code + blocks separated by comment</link> + </bridgehead> +<programlisting>First code block. +</programlisting> +<programlisting>Second code block. +[/ Comment in second code block] +Still second code block. +[/ Comment trailing second code block] +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/code-1_5.gold-html b/src/boost/tools/quickbook/test/code-1_5.gold-html new file mode 100644 index 000000000..02164d1b9 --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_5.gold-html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Indented code blocks + </h3> + <p> + In a paragraph. Still in a paragraph. + </p> +<pre class="programlisting">In a code block. +</pre> + <p> + Back in a paragraph. + </p> +<pre class="programlisting"> Code block line 1. +Code block line 2. + Code block line 3. +</pre> + <p> + Paragraph. + </p> +<pre class="programlisting">Code block with no trailing blank lines. +</pre> + <p> + Paragraph. + </p> + <h2 id="indented_code_blocks.code_blocks_separated_by_comment"> + Code blocks separated by comment + </h2> +<pre class="programlisting">First code block. +</pre> +<pre class="programlisting">Second code block. +[/ Comment in second code block] +Still second code block. +[/ Comment trailing second code block] +</pre> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code-1_5.quickbook b/src/boost/tools/quickbook/test/code-1_5.quickbook new file mode 100644 index 000000000..de377a64f --- /dev/null +++ b/src/boost/tools/quickbook/test/code-1_5.quickbook @@ -0,0 +1,29 @@ +[article Indented code blocks + [quickbook 1.5] + [source-mode teletype] +] + +In a paragraph. + Still in a paragraph. + + In a code block. + +Back in a paragraph. + + Code block line 1. + Code block line 2. + Code block line 3. + +Paragraph. + + Code block with no trailing blank lines. +Paragraph. + +[heading Code blocks separated by comment] + + First code block. +[/ Comment] + Second code block. + [/ Comment in second code block] + Still second code block. + [/ Comment trailing second code block] diff --git a/src/boost/tools/quickbook/test/code_cpp-1_5.gold b/src/boost/tools/quickbook/test/code_cpp-1_5.gold new file mode 100644 index 000000000..d0bc79a3f --- /dev/null +++ b/src/boost/tools/quickbook/test/code_cpp-1_5.gold @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="c___code_blocks" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>C++ Code Blocks</title> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">some_header</phrase><phrase role="special">></phrase> + <phrase role="preprocessor">#include</phrase> <phrase role="string">"another_header.hpp"</phrase> +<phrase role="preprocessor"># define</phrase> <phrase role="identifier">A_MACRO</phrase> <phrase role="identifier">value</phrase> +<phrase role="preprocessor">#define</phrase> <phrase role="identifier">stringize</phrase><phrase role="special">(</phrase><phrase role="identifier">hello</phrase><phrase role="special">)</phrase> <phrase role="special">#</phrase><phrase role="identifier">hello</phrase> +<phrase role="comment">// No escape</phrase> +<phrase role="comment">/* No escape */</phrase> +<phrase role="comment">/* No escape + * with newlines + */</phrase> +<phrase role="comment">// In Header: <<ulink url="boost:/boost/optional/optional.hpp">boost/optional/optional.hpp</ulink>></phrase> +<phrase role="comment">/* In Header: <<ulink url="boost:/boost/optional/optional.hpp">boost/optional/optional.hpp</ulink>> */</phrase> +<phrase role="comment">/* Multiple escapes: <emphasis>italic</emphasis> + * <emphasis role="underline">underline</emphasis><emphasis role="bold">bold</emphasis> + */</phrase> +<phrase role="comment">/* Token pasting: */</phrase> <phrase role="identifier">a</phrase><phrase role="special">##</phrase><phrase role="identifier">b</phrase> +</programlisting> + <para> + A badly formed comment: + </para> +<programlisting><phrase role="comment">/* Oh dear +</phrase></programlisting> + <para> + A badly formed comment with an escape: + </para> +<programlisting><phrase role="comment">/* Oh dear <emphasis role="bold">bold</emphasis> +</phrase></programlisting> + <para> + Just some code: + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase> + <phrase role="keyword">constexpr</phrase> <phrase role="keyword">char32_t</phrase> <phrase role="identifier">x</phrase> <phrase role="special">=</phrase> <phrase role="char">'a'</phrase><phrase role="special">;</phrase> + <phrase role="keyword">const</phrase> <phrase role="keyword">auto</phrase> <phrase role="identifier">y</phrase> <phrase role="special">=</phrase> <phrase role="identifier">x</phrase> <phrase role="special">-</phrase> <phrase role="char">' '</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/code_cpp-1_5.gold-html b/src/boost/tools/quickbook/test/code_cpp-1_5.gold-html new file mode 100644 index 000000000..9fd45cd28 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_cpp-1_5.gold-html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + C++ Code Blocks + </h3> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">some_header</span><span class="special">></span> + <span class="preprocessor">#include</span> <span class="string">"another_header.hpp"</span> +<span class="preprocessor"># define</span> <span class="identifier">A_MACRO</span> <span class="identifier">value</span> +<span class="preprocessor">#define</span> <span class="identifier">stringize</span><span class="special">(</span><span class="identifier">hello</span><span class="special">)</span> <span class="special">#</span><span class="identifier">hello</span> +<span class="comment">// No escape</span> +<span class="comment">/* No escape */</span> +<span class="comment">/* No escape + * with newlines + */</span> +<span class="comment">// In Header: <<a href="http://www.boost.org/doc/libs/release/boost/optional/optional.hpp">boost/optional/optional.hpp</a>></span> +<span class="comment">/* In Header: <<a href="http://www.boost.org/doc/libs/release/boost/optional/optional.hpp">boost/optional/optional.hpp</a>> */</span> +<span class="comment">/* Multiple escapes: <span class="emphasis"><em>italic</em></span> + * <span class="underline">underline</span><span class="bold"><strong>bold</strong></span> + */</span> +<span class="comment">/* Token pasting: */</span> <span class="identifier">a</span><span class="special">##</span><span class="identifier">b</span> +</pre> + <p> + A badly formed comment: + </p> +<pre class="programlisting"><span class="comment">/* Oh dear +</span></pre> + <p> + A badly formed comment with an escape: + </p> +<pre class="programlisting"><span class="comment">/* Oh dear <span class="bold"><strong>bold</strong></span> +</span></pre> + <p> + Just some code: + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span> + <span class="keyword">constexpr</span> <span class="keyword">char32_t</span> <span class="identifier">x</span> <span class="special">=</span> <span class="char">'a'</span><span class="special">;</span> + <span class="keyword">const</span> <span class="keyword">auto</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">x</span> <span class="special">-</span> <span class="char">' '</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code_cpp-1_5.quickbook b/src/boost/tools/quickbook/test/code_cpp-1_5.quickbook new file mode 100644 index 000000000..fdaa926bb --- /dev/null +++ b/src/boost/tools/quickbook/test/code_cpp-1_5.quickbook @@ -0,0 +1,34 @@ +[article C++ Code Blocks +[quickbook 1.5] +] + + #include <some_header> + #include "another_header.hpp" + # define A_MACRO value + #define stringize(hello) #hello + // No escape + /* No escape */ + /* No escape + * with newlines + */ + // In Header: <``[@boost:/boost/optional/optional.hpp boost/optional/optional.hpp]``> + /* In Header: <``[@boost:/boost/optional/optional.hpp boost/optional/optional.hpp]``> */ + /* Multiple escapes: ``/italic/`` + * ``_underline_````*bold*`` + */ + /* Token pasting: */ a##b + +A badly formed comment: + + /* Oh dear + +A badly formed comment with an escape: + + /* Oh dear ``*bold*`` + +Just some code: + + int main() { + constexpr char32_t x = 'a'; + const auto y = x - ' '; + } diff --git a/src/boost/tools/quickbook/test/code_cpp_mismatched_escape-1_4-fail.quickbook b/src/boost/tools/quickbook/test/code_cpp_mismatched_escape-1_4-fail.quickbook new file mode 100644 index 000000000..d5d332c17 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_cpp_mismatched_escape-1_4-fail.quickbook @@ -0,0 +1,5 @@ +[article Odd code markup. [quickbook 1.4] ] + +[c++] + + `` int main() {} diff --git a/src/boost/tools/quickbook/test/code_python-1_5.gold b/src/boost/tools/quickbook/test/code_python-1_5.gold new file mode 100644 index 000000000..239d1470a --- /dev/null +++ b/src/boost/tools/quickbook/test/code_python-1_5.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="python_code_blocks" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Python Code Blocks</title> +<programlisting><phrase role="comment"># No escape</phrase> +<phrase role="comment"># Escape: <emphasis role="bold">bold</emphasis></phrase> +<phrase role="comment"># Escape: <emphasis role="underline">underline</emphasis><emphasis>italic</emphasis></phrase> +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/code_python-1_5.gold-html b/src/boost/tools/quickbook/test/code_python-1_5.gold-html new file mode 100644 index 000000000..15a7739b1 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_python-1_5.gold-html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Python Code Blocks + </h3> +<pre class="programlisting"><span class="comment"># No escape</span> +<span class="comment"># Escape: <span class="bold"><strong>bold</strong></span></span> +<span class="comment"># Escape: <span class="underline">underline</span><span class="emphasis"><em>italic</em></span></span> +</pre> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code_python-1_5.quickbook b/src/boost/tools/quickbook/test/code_python-1_5.quickbook new file mode 100644 index 000000000..45e700ecb --- /dev/null +++ b/src/boost/tools/quickbook/test/code_python-1_5.quickbook @@ -0,0 +1,8 @@ +[article Python Code Blocks +[quickbook 1.5] +[source-mode python] +] + + # No escape + # Escape: ``*bold*`` + # Escape: ``_underline_````/italic/`` diff --git a/src/boost/tools/quickbook/test/code_python_mismatched_escape-1_4-fail.quickbook b/src/boost/tools/quickbook/test/code_python_mismatched_escape-1_4-fail.quickbook new file mode 100644 index 000000000..e93cf13f1 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_python_mismatched_escape-1_4-fail.quickbook @@ -0,0 +1,5 @@ +[article Odd code markup. [quickbook 1.4] ] + +[python] + + print "Hello World." `` diff --git a/src/boost/tools/quickbook/test/code_snippet-1_1.gold b/src/boost/tools/quickbook/test/code_snippet-1_1.gold new file mode 100644 index 000000000..1badf4bab --- /dev/null +++ b/src/boost/tools/quickbook/test/code_snippet-1_1.gold @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="code_snippets" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Code Snippets</title> + <section id="code_snippets.a_code_snippet"> + <title>A code snippet</title> + <para> + Code snippets inlined in text, as in <code><phrase role="keyword">namespace</phrase> + <phrase role="identifier">quickbook</phrase> <phrase role="special">{</phrase> + <phrase role="keyword">static</phrase> <phrase role="keyword">const</phrase> + <phrase role="keyword">int</phrase> <phrase role="identifier">value</phrase> + <phrase role="special">=</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> + <phrase role="special">}</phrase></code>, should be properly formatted and + not glued to the surrounding text. + </para> + <para> + There shoud be no spacees around (<code><phrase role="keyword">this</phrase></code>), + and spaces around <code><phrase role="keyword">this</phrase></code> code. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/code_snippet-1_1.gold-html b/src/boost/tools/quickbook/test/code_snippet-1_1.gold-html new file mode 100644 index 000000000..a3738bf37 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_snippet-1_1.gold-html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Code Snippets + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#code_snippets.a_code_snippet">A code snippet</a> + </li> + </ul> + </div> + <div id="code_snippets.a_code_snippet"> + <h3> + A code snippet + </h3> + <div id="code_snippets.a_code_snippet"> + <p> + Code snippets inlined in text, as in <code><span class="keyword">namespace</span> + <span class="identifier">quickbook</span> <span class="special">{</span> + <span class="keyword">static</span> <span class="keyword">const</span> + <span class="keyword">int</span> <span class="identifier">value</span> + <span class="special">=</span> <span class="number">0</span><span class="special">;</span> + <span class="special">}</span></code>, should be properly formatted and + not glued to the surrounding text. + </p> + <p> + There shoud be no spacees around (<code><span class="keyword">this</span></code>), + and spaces around <code><span class="keyword">this</span></code> code. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code_snippet-1_1.quickbook b/src/boost/tools/quickbook/test/code_snippet-1_1.quickbook new file mode 100644 index 000000000..875162708 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_snippet-1_1.quickbook @@ -0,0 +1,12 @@ +[article Code Snippets +] + +[section A code snippet] + +Code snippets inlined in text, as in `namespace quickbook { static const int +value = 0; }`, should be properly formatted and not glued to the surrounding +text. + +There shoud be no spacees around (`this`), and spaces around `this` code. + +[endsect] diff --git a/src/boost/tools/quickbook/test/code_teletype-1_5.gold b/src/boost/tools/quickbook/test/code_teletype-1_5.gold new file mode 100644 index 000000000..e36fb11bb --- /dev/null +++ b/src/boost/tools/quickbook/test/code_teletype-1_5.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="code_block_teletype_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Code Block Teletype 1</title> + <section id="code_block_teletype_1.a_code_block"> + <title><link linkend="code_block_teletype_1.a_code_block">A code block</link></title> +<programlisting>Just some plain text. +With some <emphasis role="bold">quickbook</emphasis> thrown in? +</programlisting> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/code_teletype-1_5.gold-html b/src/boost/tools/quickbook/test/code_teletype-1_5.gold-html new file mode 100644 index 000000000..a038a4b6c --- /dev/null +++ b/src/boost/tools/quickbook/test/code_teletype-1_5.gold-html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Code Block Teletype 1 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#code_block_teletype_1.a_code_block">A code block</a> + </li> + </ul> + </div> + <div id="code_block_teletype_1.a_code_block"> + <h3> + A code block + </h3> + <div id="code_block_teletype_1.a_code_block"> +<pre class="programlisting">Just some plain text. +With some <span class="bold"><strong>quickbook</strong></span> thrown in? +</pre> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/code_teletype-1_5.quickbook b/src/boost/tools/quickbook/test/code_teletype-1_5.quickbook new file mode 100644 index 000000000..841de3e54 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_teletype-1_5.quickbook @@ -0,0 +1,13 @@ +[article Code Block Teletype 1 + [quickbook 1.5] + [source-mode teletype] +] + +[section A code block] + +[def __text__ text] + + Just some plain __text__. + ``With some *quickbook* thrown in?`` + +[endsect] diff --git a/src/boost/tools/quickbook/test/code_unclosed_block-1_6-fail.quickbook b/src/boost/tools/quickbook/test/code_unclosed_block-1_6-fail.quickbook new file mode 100644 index 000000000..f02887c44 --- /dev/null +++ b/src/boost/tools/quickbook/test/code_unclosed_block-1_6-fail.quickbook @@ -0,0 +1,4 @@ +[article Odd code markup. [quickbook 1.6] ] + +`` +int main() {} diff --git a/src/boost/tools/quickbook/test/command-line/Jamfile.v2 b/src/boost/tools/quickbook/test/command-line/Jamfile.v2 new file mode 100644 index 000000000..9e838e0a4 --- /dev/null +++ b/src/boost/tools/quickbook/test/command-line/Jamfile.v2 @@ -0,0 +1,28 @@ + +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/tests/command-line ; + +import quickbook-testing : quickbook-test quickbook-fail-test quickbook-error-test ; + +test-suite command-line.test : + # Check that expect-errors works as advertised. + [ quickbook-fail-test error-fail : : <testing.arg>--expect-errors ] + [ quickbook-error-test error1 ] + [ quickbook-error-test error2 ] + + [ quickbook-error-test + non_existent_output : + basic-1_6.quickbook : + <testing.arg>--output-file=non-existent/basic.xml ] + [ quickbook-error-test + output_nested_in_file : + basic-1_6.quickbook : + <testing.arg>--output-file=basic-1_6.quickbook/basic.xml ] + ; diff --git a/src/boost/tools/quickbook/test/command-line/basic-1_6.quickbook b/src/boost/tools/quickbook/test/command-line/basic-1_6.quickbook new file mode 100644 index 000000000..fa8c8a693 --- /dev/null +++ b/src/boost/tools/quickbook/test/command-line/basic-1_6.quickbook @@ -0,0 +1,5 @@ +[article Basic quickbook file +[quickbook 1.5] +] + +Just used for running command line tests.
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/command-line/error-fail.quickbook b/src/boost/tools/quickbook/test/command-line/error-fail.quickbook new file mode 100644 index 000000000..835f01ad5 --- /dev/null +++ b/src/boost/tools/quickbook/test/command-line/error-fail.quickbook @@ -0,0 +1,5 @@ +[article Valid file to just that expect errors fails +[quickbook 1.5] +] + +No errors.
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/command-line/error1.quickbook b/src/boost/tools/quickbook/test/command-line/error1.quickbook new file mode 100644 index 000000000..5f76a444e --- /dev/null +++ b/src/boost/tools/quickbook/test/command-line/error1.quickbook @@ -0,0 +1,3 @@ +[article A file with an error in the docinfo +[quickbook 0.8] +] diff --git a/src/boost/tools/quickbook/test/command-line/error2.quickbook b/src/boost/tools/quickbook/test/command-line/error2.quickbook new file mode 100644 index 000000000..2eea16285 --- /dev/null +++ b/src/boost/tools/quickbook/test/command-line/error2.quickbook @@ -0,0 +1,7 @@ +[article A file with an error in the body +[quickbook 1.5] +] + +[table +[x] +]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/command_line_macro-1_1.gold b/src/boost/tools/quickbook/test/command_line_macro-1_1.gold new file mode 100644 index 000000000..423b5cbba --- /dev/null +++ b/src/boost/tools/quickbook/test/command_line_macro-1_1.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="command_line_macro" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Command Line Macro</title> + <para> + <emphasis role="bold">bold</emphasis> + </para> + <para> + empty is defined + </para> +</article> diff --git a/src/boost/tools/quickbook/test/command_line_macro-1_1.gold-html b/src/boost/tools/quickbook/test/command_line_macro-1_1.gold-html new file mode 100644 index 000000000..7e90fe4dd --- /dev/null +++ b/src/boost/tools/quickbook/test/command_line_macro-1_1.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Command Line Macro + </h3> + <p> + <span class="bold"><strong>bold</strong></span> + </p> + <p> + empty is defined + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/command_line_macro-1_1.quickbook b/src/boost/tools/quickbook/test/command_line_macro-1_1.quickbook new file mode 100644 index 000000000..5b19fc006 --- /dev/null +++ b/src/boost/tools/quickbook/test/command_line_macro-1_1.quickbook @@ -0,0 +1,10 @@ +[article Command Line Macro +] + +[/ This test relies on __macro__ being defined at the command line.] + +__macro__ + +__empty__ + +[?__empty__ empty is defined]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_5.gold b/src/boost/tools/quickbook/test/cond_phrase-1_5.gold new file mode 100644 index 000000000..95a1d35d7 --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_5.gold @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="coniditional_phrase_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Coniditional Phrase Test</title> + <para> + This should show + </para> + <para> + The should be no space inserted. + </para> + <para> + <emphasis role="bold">Bold text</emphasis> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_5.gold-html b/src/boost/tools/quickbook/test/cond_phrase-1_5.gold-html new file mode 100644 index 000000000..c9256b0cb --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_5.gold-html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Coniditional Phrase Test + </h3> + <p> + This should show + </p> + <p> + The should be no space inserted. + </p> + <p> + <span class="bold"><strong>Bold text</strong></span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_5.quickbook b/src/boost/tools/quickbook/test/cond_phrase-1_5.quickbook new file mode 100644 index 000000000..e158a251b --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_5.quickbook @@ -0,0 +1,12 @@ +[article Coniditional Phrase Test + [quickbook 1.5] +] + +[def __defined__] + +[? __defined__ This should show] +[? __undefined__ This should not show] + +The should be no sp[?__undefined__ just some junk]ace inserted. + +[? __defined__ [*Bold text]]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_7.gold b/src/boost/tools/quickbook/test/cond_phrase-1_7.gold new file mode 100644 index 000000000..34ba8a0bd --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_7.gold @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="coniditional_phrase_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Coniditional Phrase Test</title> + <para> + This should show + </para> + <para> + But this should show + </para> + <para> + Weird macro is defined + </para> + <para> + The should be no space inserted. + </para> + <para> + <emphasis role="bold">Bold text</emphasis> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_7.gold-html b/src/boost/tools/quickbook/test/cond_phrase-1_7.gold-html new file mode 100644 index 000000000..6c0117935 --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_7.gold-html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Coniditional Phrase Test + </h3> + <p> + This should show + </p> + <p> + But this should show + </p> + <p> + Weird macro is defined + </p> + <p> + The should be no space inserted. + </p> + <p> + <span class="bold"><strong>Bold text</strong></span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/cond_phrase-1_7.quickbook b/src/boost/tools/quickbook/test/cond_phrase-1_7.quickbook new file mode 100644 index 000000000..ebf356bf0 --- /dev/null +++ b/src/boost/tools/quickbook/test/cond_phrase-1_7.quickbook @@ -0,0 +1,20 @@ +[article Coniditional Phrase Test + [quickbook 1.7] +] + +[def __defined__] + +[? __defined__ This should show] +[? __undefined__ This should not show] + +[?! __defined__ This should also not show] +[?! __undefined__ But this should show] + +[? ! __undefined__ This shouldn't show] + +[def !weird_macro!] +[? !weird_macro! Weird macro is defined] + +The should be no sp[?__undefined__ just some junk]ace inserted. + +[? __defined__ [*Bold text]] diff --git a/src/boost/tools/quickbook/test/doc-info/Jamfile.v2 b/src/boost/tools/quickbook/test/doc-info/Jamfile.v2 new file mode 100644 index 000000000..a35229c09 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/Jamfile.v2 @@ -0,0 +1,38 @@ +# +# Copyright (c) 2005 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/tests/doc-info ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test escape-1.6 ] + [ quickbook-test encode-1.5 ] + [ quickbook-test author1 ] + [ quickbook-test author2 ] + [ quickbook-test empty-attributes ] + [ quickbook-test escaped_attributes1-1_7 ] + [ quickbook-test escaped_attributes2-1_7 ] + [ quickbook-test duplicates-1.1 ] + [ quickbook-test duplicates-1.5 ] + [ quickbook-test macros1-1_5 ] + [ quickbook-test macros1-1_6 ] + [ quickbook-test source-mode-1.4 ] + [ quickbook-test source-mode-1.5 ] + [ quickbook-test source-mode-1.6 ] + [ quickbook-test copyright1 ] + [ quickbook-error-test copyright-fail1 ] + [ quickbook-error-test copyright-fail2 ] + [ quickbook-test id1-1.5 ] + [ quickbook-test title_trailing_space-1_1 ] + [ quickbook-test title_trailing_space-1_6 ] + [ quickbook-test empty_title-1_1 ] + [ quickbook-test empty_title-1_5 ] + [ quickbook-test empty_title-1_6 ] + [ quickbook-error-test missing_doc_info-1_6-fail ] + ; diff --git a/src/boost/tools/quickbook/test/doc-info/author1.gold b/src/boost/tools/quickbook/test/doc-info/author1.gold new file mode 100644 index 000000000..613fa83ef --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author1.gold @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE appendix PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<appendix id="document_information_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Document Information 4</title> + <appendixinfo> + <authorgroup> + <author> + <firstname>Joe</firstname> <surname>Blow</surname> + </author> + </authorgroup> + </appendixinfo> +</appendix> diff --git a/src/boost/tools/quickbook/test/doc-info/author1.gold-html b/src/boost/tools/quickbook/test/doc-info/author1.gold-html new file mode 100644 index 000000000..9d39657f3 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author1.gold-html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Document Information 4 + </h3> + <div class="authorgroup"> + <h3 class="author"> + Joe Blow + </h3> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/author1.quickbook b/src/boost/tools/quickbook/test/doc-info/author1.quickbook new file mode 100644 index 000000000..4505b4091 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author1.quickbook @@ -0,0 +1,5 @@ +[appendix Document Information 4 +[quickbook 1.5] +[authors [Blow, Joe]] +] +[/ Some comment]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/author2.gold b/src/boost/tools/quickbook/test/doc-info/author2.gold new file mode 100644 index 000000000..766d8f68b --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author2.gold @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<chapter id="document_information_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Document Information 4</title> + <chapterinfo> + <authorgroup> + <author> + <firstname>Joe</firstname> <surname>Blow</surname> + </author> + <author> + <firstname>Jane</firstname> <surname>Doe</surname> + </author> + <author> + <firstname>John</firstname> <surname>Coe</surname> + </author> + </authorgroup> + </chapterinfo> +</chapter> diff --git a/src/boost/tools/quickbook/test/doc-info/author2.gold-html b/src/boost/tools/quickbook/test/doc-info/author2.gold-html new file mode 100644 index 000000000..59b9b7e5c --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author2.gold-html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Document Information 4 + </h3> + <div class="authorgroup"> + <h3 class="author"> + Joe Blow + </h3> + <h3 class="author"> + Jane Doe + </h3> + <h3 class="author"> + John Coe + </h3> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/author2.quickbook b/src/boost/tools/quickbook/test/doc-info/author2.quickbook new file mode 100644 index 000000000..c4737e0ac --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/author2.quickbook @@ -0,0 +1,4 @@ +[chapter Document Information 4 +[quickbook 1.5] +[authors [Blow, Joe], [Doe, Jane] [Coe, John]] +]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/copyright-fail1.quickbook b/src/boost/tools/quickbook/test/doc-info/copyright-fail1.quickbook new file mode 100644 index 000000000..20738cb91 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/copyright-fail1.quickbook @@ -0,0 +1,4 @@ +[article Invalid copyright years +[quickbook 1.5] +[copyright 2010-2001 Timequake man] +]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/copyright-fail2.quickbook b/src/boost/tools/quickbook/test/doc-info/copyright-fail2.quickbook new file mode 100644 index 000000000..607c3a789 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/copyright-fail2.quickbook @@ -0,0 +1,6 @@ +[article Invalid copyright +[quickbook 1.5] +[copyright No year] +] + +Maybe this should pass?
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/copyright1.gold b/src/boost/tools/quickbook/test/doc-info/copyright1.gold new file mode 100644 index 000000000..3c6d40668 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/copyright1.gold @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="copyright_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Copyright Test</title> + <articleinfo> + <copyright> + <year>1963</year> <year>1964</year> <year>1965</year> <holder>Jane Doe</holder> + </copyright> + <copyright> + <year>2018</year> <holder>Joe Blow, John Coe</holder> + </copyright> + <copyright> + <year>1977</year> <year>1985</year> <holder>Someone else</holder> + </copyright> + </articleinfo> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/copyright1.gold-html b/src/boost/tools/quickbook/test/doc-info/copyright1.gold-html new file mode 100644 index 000000000..61b05b472 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/copyright1.gold-html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Copyright Test + </h3> + <p class="copyright"> + 1963, 1964, 1965 Jane Doe + </p> + <p class="copyright"> + 2018 Joe Blow, John Coe + </p> + <p class="copyright"> + 1977, 1985 Someone else + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/copyright1.quickbook b/src/boost/tools/quickbook/test/doc-info/copyright1.quickbook new file mode 100644 index 000000000..4dff125fe --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/copyright1.quickbook @@ -0,0 +1,5 @@ +[article Copyright Test +[quickbook 1.5] +[copyright 1963-1965 Jane Doe, 2018 Joe Blow, John Coe] +[copyright 1977,1985 Someone else] +]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold new file mode 100644 index 000000000..7ff1fa4b9 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="thing2" name="Duplicates 1.1" dirname="thing2" last-revision="Tomorrow" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <authorgroup> + <author> + <firstname>Joe</firstname> <surname>Blow</surname> + </author> + <author> + <firstname>Jane</firstname> <surname>Doe</surname> + </author> + </authorgroup> + <copyright> + <year>2018</year> <holder>Joe Blow</holder> + </copyright> + <copyright> + <year>1963</year> <holder>Jane Doe</holder> + </copyright> + <legalnotice id="thing2.legal"> + <para> + Public Domain + </para> + </legalnotice> + <librarypurpose> + Another Duplicate + </librarypurpose> + <librarycategory name="category:Category 1"></librarycategory> <librarycategory + name="category:Category 2"></librarycategory> + </libraryinfo> + <title>Duplicates 1.1 2</title> + <para> + Content + </para> +</library> diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold-html b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold-html new file mode 100644 index 000000000..cd1eb53d6 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.gold-html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Duplicates 1.1 2 + </h3> + <div class="authorgroup"> + <h3 class="author"> + Joe Blow + </h3> + <h3 class="author"> + Jane Doe + </h3> + </div> + <p class="copyright"> + 2018 Joe Blow + </p> + <p class="copyright"> + 1963 Jane Doe + </p> + <div class="legalnotice"> + <p> + Public Domain + </p> + </div> + <p> + Content + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.quickbook b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.quickbook new file mode 100644 index 000000000..d5daa2158 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.1.quickbook @@ -0,0 +1,23 @@ +[library Duplicates 1.1 + +[id thing1] +[id thing2] +[dirname thing1] +[dirname thing2] +[last-revision Yesterday] +[last-revision Tomorrow] +[purpose Test Duplicates] +[purpose Another Duplicate] +[category Category 1] +[category Category 2] +[version 1] +[version 2] +[authors [Blow, Joe]] +[authors [Doe, Jane]] +[copyright 2018 Joe Blow] +[copyright 1963 Jane Doe] +[license Some license] +[license Public Domain] +] + +Content
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold new file mode 100644 index 000000000..71a58a8d1 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="thing2" lang="de" dirname="thing2" last-revision="Tomorrow" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Duplicates 1.5 2</title> + <articleinfo> + <authorgroup> + <author> + <firstname>Joe</firstname> <surname>Blow</surname> + </author> + <author> + <firstname>Jane</firstname> <surname>Doe</surname> + </author> + </authorgroup> + <copyright> + <year>2018</year> <holder>Joe Blow</holder> + </copyright> + <copyright> + <year>1963</year> <holder>Jane Doe</holder> + </copyright> + <legalnotice id="thing2.legal"> + <para> + Public Domain + </para> + </legalnotice> + <articlepurpose> + Another Duplicate + </articlepurpose> + <articlecategory name="category:Category 1"></articlecategory> <articlecategory + name="category:Category 2"></articlecategory> <biblioid class="uri">http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook</biblioid> + <biblioid class="isbn">0-937383-18-X</biblioid> + </articleinfo> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold-html b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold-html new file mode 100644 index 000000000..1c448e7f2 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.gold-html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Duplicates 1.5 2 + </h3> + <div class="authorgroup"> + <h3 class="author"> + Joe Blow + </h3> + <h3 class="author"> + Jane Doe + </h3> + </div> + <p class="copyright"> + 2018 Joe Blow + </p> + <p class="copyright"> + 1963 Jane Doe + </p> + <div class="legalnotice"> + <p> + Public Domain + </p> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.quickbook b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.quickbook new file mode 100644 index 000000000..ed8f5da22 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/duplicates-1.5.quickbook @@ -0,0 +1,27 @@ +[article Duplicates 1.5 +[quickbook 1.5] +[quickbook 1.5] + +[id thing1] +[id thing2] +[dirname thing1] +[dirname thing2] +[last-revision Yesterday] +[last-revision Tomorrow] +[purpose Test Duplicates] +[purpose Another Duplicate] +[category Category 1] +[category Category 2] +[lang en] +[lang de] +[version 1] +[version 2] +[authors [Blow, Joe]] +[authors [Doe, Jane]] +[copyright 2018 Joe Blow] +[copyright 1963 Jane Doe] +[license Some license] +[license Public Domain] +[biblioid uri http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook] +[biblioid isbn 0-937383-18-X] +] diff --git a/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold b/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold new file mode 100644 index 000000000..a7f05f756 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="empty_attributes" name="Empty Attributes" dirname="empty_attributes" +last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <authorgroup> + <author> + <firstname></firstname> <surname></surname> + </author> + </authorgroup> + <copyright> + <year>2011</year> <holder></holder> + </copyright> + </libraryinfo> + <title>Empty Attributes</title> + <para> + <literal>biblioid</literal> and <literal>source-mode</literal> can't be empty. + </para> +</library> diff --git a/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold-html b/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold-html new file mode 100644 index 000000000..07d23c0b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty-attributes.gold-html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Empty Attributes + </h3> + <div class="authorgroup"> + <h3 class="author"> + </h3> + </div> + <p class="copyright"> + 2011 + </p> + <p> + <tt>biblioid</tt> and <tt>source-mode</tt> can't be empty. + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/empty-attributes.quickbook b/src/boost/tools/quickbook/test/doc-info/empty-attributes.quickbook new file mode 100644 index 000000000..a31dc7199 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty-attributes.quickbook @@ -0,0 +1,16 @@ +[library Empty Attributes +[version] +[id] +[dirname] +[copyright] +[copyright 2011] +[purpose] +[category] +[authors] +[authors [,]] +[license] +[last-revision] +[lang] +] + +=biblioid= and =source-mode= can't be empty. diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold new file mode 100644 index 000000000..01bc60673 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <section id=".test"> + <title>Test</title> + <para> + Hello + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold-html b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold-html new file mode 100644 index 000000000..359cf1546 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#.test">Test</a> + </li> + </ul> + </div> + <div id=".test"> + <h3> + Test + </h3> + <div id=".test"> + <p> + Hello + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.quickbook b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.quickbook new file mode 100644 index 000000000..45769a983 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_1.quickbook @@ -0,0 +1,8 @@ +[article +] + +[section Test] + +Hello + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold new file mode 100644 index 000000000..034482798 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <section id=".test"> + <title><link linkend=".test">Test</link></title> + <para> + Hello + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold-html b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold-html new file mode 100644 index 000000000..359cf1546 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#.test">Test</a> + </li> + </ul> + </div> + <div id=".test"> + <h3> + Test + </h3> + <div id=".test"> + <p> + Hello + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.quickbook b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.quickbook new file mode 100644 index 000000000..99cbf6b79 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_5.quickbook @@ -0,0 +1,7 @@ +[article +[quickbook 1.5] +] + +[section Test] +Hello +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold new file mode 100644 index 000000000..1dce22ef0 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="doc0" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold-html b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold-html new file mode 100644 index 000000000..ce2d4462e --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.gold-html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.quickbook b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.quickbook new file mode 100644 index 000000000..bf310afd3 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/empty_title-1_6.quickbook @@ -0,0 +1 @@ +[quickbook 1.6][article]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold b/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold new file mode 100644 index 000000000..83870c7c9 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="karel_vom__xe1___x10d_ka_and_tom__xe1___x161__martin__xed_k" name="Karel Vomáčka and Tomáš Martiník" +dirname="karel_vom__xe1___x10d_ka_and_tom__xe1___x161__martin__xed_k" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <authorgroup> + <author> + <firstname>Matti</firstname> <surname>Meikäläinen</surname> + </author> + <author> + <firstname>Pero</firstname> <surname>Perić</surname> + </author> + </authorgroup> + <copyright> + <year>2010</year> <holder>Meðal-Jón and Jóna Jónsdóttir</holder> + </copyright> + <librarypurpose> + Inline code test: <code>1 + 2</code> + </librarypurpose> + <librarycategory name="category:tests"></librarycategory> <librarycategory name="category:irrelevance"></librarycategory> + <biblioid class="uri">http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook</biblioid> + <biblioid class="isbn">0-937383-18-X</biblioid> + </libraryinfo> + <title>Karel Vomáčka and Tomáš Martiník</title> +</library> diff --git a/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold-html b/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold-html new file mode 100644 index 000000000..62ce95f86 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/encode-1.5.gold-html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Karel Vomáčka and Tomáš Martiník + </h3> + <div class="authorgroup"> + <h3 class="author"> + Matti Meikäläinen + </h3> + <h3 class="author"> + Pero Perić + </h3> + </div> + <p class="copyright"> + 2010 Meðal-Jón and Jóna Jónsdóttir + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/encode-1.5.quickbook b/src/boost/tools/quickbook/test/doc-info/encode-1.5.quickbook new file mode 100644 index 000000000..c1928c6a8 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/encode-1.5.quickbook @@ -0,0 +1,14 @@ +[library Karel Vomáčka and Tomáš Martiník +[quickbook 1.5] +[authors [Meikäläinen, Matti],[Perić, Pero]] +[copyright 2010 Meðal-Jón and Jóna Jónsdóttir] +[source-mode teletype] +[purpose Inline code test: `1 + 2`] +[category tests] +[category irrelevance] +[/ [category commented out] ] +[biblioid uri http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook] +[biblioid isbn 0-937383-18-X] +] + +[/ Some comment] diff --git a/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold b/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold new file mode 100644 index 000000000..630398679 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="karel_vom_u00e1_u010dka_and_tom_" lang="en" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Karel Vomáčka and Tomáš Martiník</title> + <articleinfo> + <authorgroup> + <author> + <firstname>Matti</firstname> <surname>Meikäläinen</surname> + </author> + <author> + <firstname>Pero</firstname> <surname>Perić</surname> + </author> + </authorgroup> + <copyright> + <year>2010</year> <holder>Meðal-Jón and Jóna Jónsdóttir</holder> + </copyright> + <articlepurpose> + Inline code test: <code>1 + 2</code> + </articlepurpose> + <articlecategory name="category:tests"></articlecategory> <articlecategory name="category:irrelevance"></articlecategory> + <biblioid class="uri">http://www.boost.org/tools/quickbook/test/doc-info-1.quickbook</biblioid> + </articleinfo> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold-html b/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold-html new file mode 100644 index 000000000..62ce95f86 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escape-1.6.gold-html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Karel Vomáčka and Tomáš Martiník + </h3> + <div class="authorgroup"> + <h3 class="author"> + Matti Meikäläinen + </h3> + <h3 class="author"> + Pero Perić + </h3> + </div> + <p class="copyright"> + 2010 Meðal-Jón and Jóna Jónsdóttir + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/escape-1.6.quickbook b/src/boost/tools/quickbook/test/doc-info/escape-1.6.quickbook new file mode 100644 index 000000000..7ae3e7003 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escape-1.6.quickbook @@ -0,0 +1,12 @@ +[article Karel Vom\u00E1\u010Dka and Tom\u00E1\u0161 Martin\u00EDk +[quickbook 1.6] +[authors [Meik\u00E4l\u00E4inen, Matti][Peri\u0107, Pero]] +[copyright 2010 Me\u00F0al-J\u00F3n and J\u00F3na J\u00F3nsd\u00F3ttir] +[source-mode teletype] +[purpose Inline code test: `1 + 2`] +[category tests] +[category irrelevance] +[/ [category commented out] ] +[biblioid uri http://www.boost.org/tools/quickbook/test/doc-info-1.quickbook] +[lang en] +] diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold new file mode 100644 index 000000000..b6425d910 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="escaped_name" name="Escaped name" dirname="escaped_name" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <copyright> + <year>1325</year> <holder>John Doe</holder> + </copyright> + <librarycategory name="category:test"></librarycategory> <author> + <firstname>John</firstname> + <surname>Doe</surname> + <email>john.doe@example.com</email> +</author> + </libraryinfo> + <title>Escaped name</title> +</library> diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold-html b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold-html new file mode 100644 index 000000000..73d9655ce --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.gold-html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Escaped name + </h3> + <div class="authorgroup"> + <h3 class="author"> + John Doe + </h3> + </div> + <p class="copyright"> + 1325 John Doe + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.quickbook b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.quickbook new file mode 100644 index 000000000..e70161375 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes1-1_7.quickbook @@ -0,0 +1,11 @@ +[library Escaped name +[quickbook 1.7] +[copyright 1325 John Doe] +'''<author> + <firstname>John</firstname> + <surname>Doe</surname> + <email>john.doe@example.com</email> +</author>''' +[category test] +] + diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold new file mode 100644 index 000000000..259111ac4 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="multiple_escaped_attributes" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Multiple escaped attributes</title> + <articleinfo> + <author> + <firstname>John</firstname> + <surname>Doe</surname> + <email>john.doe@example.com</email> +</author><orgname>Acme Corporation</orgname></articleinfo> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold-html b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold-html new file mode 100644 index 000000000..359094610 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.gold-html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Multiple escaped attributes + </h3> + <div class="authorgroup"> + <h3 class="author"> + John Doe + </h3> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.quickbook b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.quickbook new file mode 100644 index 000000000..70676f8a1 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/escaped_attributes2-1_7.quickbook @@ -0,0 +1,10 @@ +[article Multiple escaped attributes +[quickbook 1.7] +'''<author> + <firstname>John</firstname> + <surname>Doe</surname> + <email>john.doe@example.com</email> +</author>''' +'''<orgname>Acme Corporation</orgname>''' +] + diff --git a/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold b/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold new file mode 100644 index 000000000..5b55391e2 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="missing_id_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Missing Id test</title> + <section id="missing_id_test.missing_id_test_1"> + <title><link linkend="missing_id_test.missing_id_test_1">Missing Id test 1</link></title> + </section> + <section id="missing_id_test.no_docinfo_test_1"> + <title><link linkend="missing_id_test.no_docinfo_test_1">No docinfo test 1</link></title> + </section> + <section id="missing_id_test.missing_id_test_2"> + <title><link linkend="missing_id_test.missing_id_test_2">Missing Id test 2</link></title> + </section> + <section id="docinfo_no_id.docinfo_no_id_1"> + <title><link linkend="docinfo_no_id.docinfo_no_id_1">Docinfo no id 1</link></title> + </section> + <section id="missing_id_test.missing_id_test_3"> + <title><link linkend="missing_id_test.missing_id_test_3">Missing Id test 3</link></title> + </section> + <section id="docinfo_no_id.no_docinfo_test_1"> + <title><link linkend="docinfo_no_id.no_docinfo_test_1">No docinfo test 1</link></title> + </section> + <section id="missing_id_test.missing_id_test_4"> + <title><link linkend="missing_id_test.missing_id_test_4">Missing Id test 4</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold-html b/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold-html new file mode 100644 index 000000000..c6fbb841a --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/id1-1.5.gold-html @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Missing Id test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#missing_id_test.missing_id_test_1">Missing Id test 1</a> + </li> + <li> + <a href="#missing_id_test.no_docinfo_test_1">No docinfo test 1</a> + </li> + <li> + <a href="#missing_id_test.missing_id_test_2">Missing Id test 2</a> + </li> + <li> + <a href="#docinfo_no_id.docinfo_no_id_1">Docinfo no id 1</a> + </li> + <li> + <a href="#missing_id_test.missing_id_test_3">Missing Id test 3</a> + </li> + <li> + <a href="#docinfo_no_id.no_docinfo_test_1">No docinfo test 1</a> + </li> + <li> + <a href="#missing_id_test.missing_id_test_4">Missing Id test 4</a> + </li> + </ul> + </div> + <div id="missing_id_test.missing_id_test_1"> + <h3> + Missing Id test 1 + </h3> + <div id="missing_id_test.missing_id_test_1"> + </div> + </div> + <div id="missing_id_test.no_docinfo_test_1"> + <h3> + No docinfo test 1 + </h3> + <div id="missing_id_test.no_docinfo_test_1"> + </div> + </div> + <div id="missing_id_test.missing_id_test_2"> + <h3> + Missing Id test 2 + </h3> + <div id="missing_id_test.missing_id_test_2"> + </div> + </div> + <div id="docinfo_no_id.docinfo_no_id_1"> + <h3> + Docinfo no id 1 + </h3> + <div id="docinfo_no_id.docinfo_no_id_1"> + </div> + </div> + <div id="missing_id_test.missing_id_test_3"> + <h3> + Missing Id test 3 + </h3> + <div id="missing_id_test.missing_id_test_3"> + </div> + </div> + <div id="docinfo_no_id.no_docinfo_test_1"> + <h3> + No docinfo test 1 + </h3> + <div id="docinfo_no_id.no_docinfo_test_1"> + </div> + </div> + <div id="missing_id_test.missing_id_test_4"> + <h3> + Missing Id test 4 + </h3> + <div id="missing_id_test.missing_id_test_4"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/id1-1.5.quickbook b/src/boost/tools/quickbook/test/doc-info/id1-1.5.quickbook new file mode 100644 index 000000000..c7065d0c5 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/id1-1.5.quickbook @@ -0,0 +1,21 @@ +[article Missing Id test +[quickbook 1.5] +] + +[section Missing Id test 1] +[endsect] + +[include id1-no-docinfo.quickbook] + +[section Missing Id test 2] +[endsect] + +[include id1-docinfo-no-id.quickbook] + +[section Missing Id test 3] +[endsect] + +[include id1-no-docinfo.quickbook] + +[section Missing Id test 4] +[endsect] diff --git a/src/boost/tools/quickbook/test/doc-info/id1-docinfo-no-id.quickbook b/src/boost/tools/quickbook/test/doc-info/id1-docinfo-no-id.quickbook new file mode 100644 index 000000000..d5e954826 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/id1-docinfo-no-id.quickbook @@ -0,0 +1,5 @@ +[article Docinfo no id +] + +[section Docinfo no id 1] +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/id1-no-docinfo.quickbook b/src/boost/tools/quickbook/test/doc-info/id1-no-docinfo.quickbook new file mode 100644 index 000000000..4dbaf2dea --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/id1-no-docinfo.quickbook @@ -0,0 +1,2 @@ +[section No docinfo test 1] +[endsect] diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold new file mode 100644 index 000000000..0b76b9da1 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="macro_shouldn_t_expand____date__" last-revision="__DATE__" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Macro shouldn't expand: __DATE__</title> + <articleinfo> + <articlepurpose> + Unfortunately this does expand: 2000-Dec-20, but I'm not fixing it, as I don't + think it'll cause any real problems. + </articlepurpose> + </articleinfo> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold-html b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold-html new file mode 100644 index 000000000..7df921e6b --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Macro shouldn't expand: __DATE__ + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_5.quickbook b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.quickbook new file mode 100644 index 000000000..c66a1de6d --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_5.quickbook @@ -0,0 +1,6 @@ +[article Macro shouldn't expand: __DATE__ + [quickbook 1.5] + [last-revision __DATE__] + [purpose Unfortunately this does expand: __DATE__, but I'm not fixing it, + as I don't think it'll cause any real problems.] +] diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold new file mode 100644 index 000000000..92ac1a191 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="testing_date_date" last-revision="2000-Dec-20" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Testing date: 2000-Dec-20</title> + <chapter id="testing_macro_date_nested_macro" last-revision="5 May 2013" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Testing macro date: 5 May 2013</title> + </chapter> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold-html b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold-html new file mode 100644 index 000000000..57b673755 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.gold-html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Testing date: 2000-Dec-20 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#testing_macro_date_nested_macro">Testing macro date: 5 May 2013</a> + </li> + </ul> + </div> + <div id="testing_macro_date_nested_macro"> + <h3> + Testing macro date: 5 May 2013 + </h3> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-1_6.quickbook b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.quickbook new file mode 100644 index 000000000..058c34954 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-1_6.quickbook @@ -0,0 +1,7 @@ +[article Testing date: __DATE__ + [quickbook 1.6] + [last-revision __DATE__] +] + +[def NESTED_MACRO 5 May 2013] +[include macros1-inc_1_6.quickbook] diff --git a/src/boost/tools/quickbook/test/doc-info/macros1-inc_1_6.quickbook b/src/boost/tools/quickbook/test/doc-info/macros1-inc_1_6.quickbook new file mode 100644 index 000000000..47fc84a81 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/macros1-inc_1_6.quickbook @@ -0,0 +1,4 @@ +[chapter Testing macro date: NESTED_MACRO + [quickbook 1.6] + [last-revision NESTED_MACRO] +] diff --git a/src/boost/tools/quickbook/test/doc-info/missing_doc_info-1_6-fail.quickbook b/src/boost/tools/quickbook/test/doc-info/missing_doc_info-1_6-fail.quickbook new file mode 100644 index 000000000..6f0b2cdbe --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/missing_doc_info-1_6-fail.quickbook @@ -0,0 +1,3 @@ +[quickbook 1.6] + +Hello! diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold new file mode 100644 index 000000000..f7fea9a71 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="c___test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>C++ test</title> + <articleinfo> + <legalnotice id="c___test.legal"> + <para> + <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase + role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase> + <phrase role="keyword">print</phrase> <phrase role="string">"Hello"</phrase></code> + </para> + </legalnotice> + <articlepurpose> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code> + </articlepurpose> + </articleinfo> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold-html b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold-html new file mode 100644 index 000000000..e1237d1fd --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.gold-html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + C++ test + </h3> + <div class="legalnotice"> + <p> + <code><span class="keyword">def</span> <span class="identifier">foo</span><span + class="special">(</span><span class="identifier">x</span><span class="special">):</span> + <span class="keyword">print</span> <span class="string">"Hello"</span></code> + </p> + </div> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">():</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">(</span><span class="identifier">x</span><span class="special">):</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.quickbook new file mode 100644 index 000000000..a04bca741 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.4.quickbook @@ -0,0 +1,17 @@ +[article C++ test +[quickbook 1.5] +[source-mode python] +[license `def foo(x): print "Hello"`] +[source-mode c++] +[purpose `int main() {}`] +] + +```int main() {}``` + +[include source-mode-python-include.quickbook] + +```def foo(x):``` + +[include source-mode-cpp-include.quickbook] + +```int main() {}``` diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold new file mode 100644 index 000000000..340c5d2e9 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="c___test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>C++ test</title> + <articleinfo> + <legalnotice id="c___test.legal"> + <para> + <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase + role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase> + <phrase role="keyword">print</phrase> <phrase role="string">"Hello"</phrase></code> + </para> + </legalnotice> + <articlepurpose> + <code>This shouldn't be highlighted</code> + </articlepurpose> + </articleinfo> + <para> +<programlisting>This shouldn't be highlighted.</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase></programlisting> + </para> + <para> +<programlisting>This shouldn't be highlighted</programlisting> + </para> + <para> +<programlisting>This shouldn't be highlighted.</programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold-html b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold-html new file mode 100644 index 000000000..4eacbb674 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.gold-html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + C++ test + </h3> + <div class="legalnotice"> + <p> + <code><span class="keyword">def</span> <span class="identifier">foo</span><span + class="special">(</span><span class="identifier">x</span><span class="special">):</span> + <span class="keyword">print</span> <span class="string">"Hello"</span></code> + </p> + </div> + <p> +<pre class="programlisting">This shouldn't be highlighted.</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">():</span></pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">(</span><span class="identifier">x</span><span class="special">):</span></pre> + </p> + <p> +<pre class="programlisting">This shouldn't be highlighted</pre> + </p> + <p> +<pre class="programlisting">This shouldn't be highlighted.</pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.quickbook new file mode 100644 index 000000000..78e20b7c0 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.5.quickbook @@ -0,0 +1,21 @@ +[article C++ test +[quickbook 1.5] +[source-mode python] +[license `def foo(x): print "Hello"`] +[source-mode teletype] +[purpose `This shouldn't be highlighted`] +] + +```This shouldn't be highlighted.``` + +[include source-mode-cpp-include.quickbook] + +```int main() {}``` + +[include source-mode-python-include.quickbook] + +```def foo(x):``` + +[include source-mode-teletype-include.quickbook] + +```This shouldn't be highlighted.``` diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold new file mode 100644 index 000000000..02496673a --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="c_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>C++ test</title> + <articleinfo> + <legalnotice id="c_test.legal"> + <para> + <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase + role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase> + <phrase role="keyword">print</phrase> <phrase role="string">"Hello"</phrase></code> + </para> + </legalnotice> + <articlepurpose> + <code>This shouldn't be highlighted</code> + </articlepurpose> + </articleinfo> +<programlisting>This shouldn't be highlighted.</programlisting> + <article id="c___source_mode_include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>C++ source mode include</title> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </para> + </article> +<programlisting>This shouldn't be highlighted.</programlisting> + <article id="python_source_mode_include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Python source mode include</title> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting> + </para> + </article> +<programlisting>This shouldn't be highlighted.</programlisting> + <article id="teletype_source_mode_include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Teletype source mode include</title> + <para> +<programlisting>This shouldn't be highlighted</programlisting> + </para> + </article> +<programlisting>This shouldn't be highlighted.</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold-html b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold-html new file mode 100644 index 000000000..79390c04b --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.gold-html @@ -0,0 +1,60 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + C++ test + </h3> + <div class="legalnotice"> + <p> + <code><span class="keyword">def</span> <span class="identifier">foo</span><span + class="special">(</span><span class="identifier">x</span><span class="special">):</span> + <span class="keyword">print</span> <span class="string">"Hello"</span></code> + </p> + </div> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#c___source_mode_include">C++ source mode include</a> + </li> + <li> + <a href="#python_source_mode_include">Python source mode include</a> + </li> + <li> + <a href="#teletype_source_mode_include">Teletype source mode include</a> + </li> + </ul> + </div> +<pre class="programlisting">This shouldn't be highlighted.</pre> +<pre class="programlisting">This shouldn't be highlighted.</pre> +<pre class="programlisting">This shouldn't be highlighted.</pre> +<pre class="programlisting">This shouldn't be highlighted.</pre> + <div id="c___source_mode_include"> + <h3> + C++ source mode include + </h3> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </p> + </div> + <div id="python_source_mode_include"> + <h3> + Python source mode include + </h3> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">():</span></pre> + </p> + </div> + <div id="teletype_source_mode_include"> + <h3> + Teletype source mode include + </h3> + <p> +<pre class="programlisting">This shouldn't be highlighted</pre> + </p> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.quickbook new file mode 100644 index 000000000..02f7ee4c4 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-1.6.quickbook @@ -0,0 +1,21 @@ +[article C++ test +[quickbook 1.6] +[source-mode python] +[license `def foo(x): print "Hello"`] +[source-mode teletype] +[purpose `This shouldn't be highlighted`] +] + +```This shouldn't be highlighted.``` + +[include source-mode-cpp-include.quickbook] + +```This shouldn't be highlighted.``` + +[include source-mode-python-include.quickbook] + +```This shouldn't be highlighted.``` + +[include source-mode-teletype-include.quickbook] + +```This shouldn't be highlighted.``` diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook new file mode 100644 index 000000000..1ff2b94cd --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook @@ -0,0 +1,4 @@ +[source-mode c++] +[article C++ source mode include] + +```int main() {}```
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-python-include.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-python-include.quickbook new file mode 100644 index 000000000..31ac531d0 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-python-include.quickbook @@ -0,0 +1,5 @@ +[article Python source mode include +[source-mode python] +] + +```def foo():```
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook b/src/boost/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook new file mode 100644 index 000000000..c7908fb76 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook @@ -0,0 +1,5 @@ +[article Teletype source mode include +[source-mode teletype] +] + +```This shouldn't be highlighted```
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold new file mode 100644 index 000000000..17e4add73 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="trailing_space_____" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Trailing Space</title> + <section id="trailing_space_____.body"> + <title>Body</title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold-html b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold-html new file mode 100644 index 000000000..187ba4271 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Trailing Space + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#trailing_space_____.body">Body</a> + </li> + </ul> + </div> + <div id="trailing_space_____.body"> + <h3> + Body + </h3> + <div id="trailing_space_____.body"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook new file mode 100644 index 000000000..27305f719 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook @@ -0,0 +1,5 @@ +[article Trailing Space ] + +[section Body] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold new file mode 100644 index 000000000..45231b6d1 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="trailing_space" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Trailing Space</title> + <section id="trailing_space.body"> + <title><link linkend="trailing_space.body">Body</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold-html b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold-html new file mode 100644 index 000000000..1b3cb4e23 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Trailing Space + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#trailing_space.body">Body</a> + </li> + </ul> + </div> + <div id="trailing_space.body"> + <h3> + Body + </h3> + <div id="trailing_space.body"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook new file mode 100644 index 000000000..b1b8cd5d2 --- /dev/null +++ b/src/boost/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook @@ -0,0 +1,5 @@ +[article Trailing Space [quickbook 1.6]] + +[section Body] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/elements-1_5.gold b/src/boost/tools/quickbook/test/elements-1_5.gold new file mode 100644 index 000000000..e5bb24a27 --- /dev/null +++ b/src/boost/tools/quickbook/test/elements-1_5.gold @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="1_5_elements" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>1.5 Elements</title> + <para> + [ordered_list [item1][item2]] + </para> + <para> + [itemized_list [item1][item2]] + </para> + <para> + [block<simplesect><title>A <emphasis role="bold">simplesect</emphasis>!</title>] + </para> + <para> + [block</simplesect>] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/elements-1_5.quickbook b/src/boost/tools/quickbook/test/elements-1_5.quickbook new file mode 100644 index 000000000..df8f10aa7 --- /dev/null +++ b/src/boost/tools/quickbook/test/elements-1_5.quickbook @@ -0,0 +1,13 @@ +[article 1.5 Elements +[quickbook 1.5] +] + +[/ elements from 1.6] + +[ordered_list [item1][item2]] + +[itemized_list [item1][item2]] + +[block'''<simplesect><title>'''A *simplesect*!'''</title>'''] + +[block'''</simplesect>''']
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/elements-1_6.gold b/src/boost/tools/quickbook/test/elements-1_6.gold new file mode 100644 index 000000000..59a90af5c --- /dev/null +++ b/src/boost/tools/quickbook/test/elements-1_6.gold @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="1_6_elements" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>1.6 Elements</title> + <orderedlist> + <listitem> + <simpara> + item1 + </simpara> + </listitem> + <listitem> + <simpara> + item2 + </simpara> + </listitem> + </orderedlist> + <itemizedlist> + <listitem> + <simpara> + item1 + </simpara> + </listitem> + <listitem> + <simpara> + item2 + </simpara> + </listitem> + </itemizedlist> + <orderedlist> + <listitem> + <simpara> + Check that <emphasis role="bold">bold text</emphasis> isn't confused with + a list. + </simpara> + </listitem> + </orderedlist> + <simplesect><title>A <emphasis role="bold">simplesect</emphasis>!</title></simplesect> + +</article> diff --git a/src/boost/tools/quickbook/test/elements-1_6.gold-html b/src/boost/tools/quickbook/test/elements-1_6.gold-html new file mode 100644 index 000000000..17566749c --- /dev/null +++ b/src/boost/tools/quickbook/test/elements-1_6.gold-html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + 1.6 Elements + </h3> + <ol> + <li> + <div> + item1 + </div> + </li> + <li> + <div> + item2 + </div> + </li> + </ol> + <ul> + <li> + <div> + item1 + </div> + </li> + <li> + <div> + item2 + </div> + </li> + </ul> + <ol> + <li> + <div> + Check that <span class="bold"><strong>bold text</strong></span> isn't confused + with a list. + </div> + </li> + </ol> + <h3> + A <span class="bold"><strong>simplesect</strong></span>! + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/elements-1_6.quickbook b/src/boost/tools/quickbook/test/elements-1_6.quickbook new file mode 100644 index 000000000..e313cd98d --- /dev/null +++ b/src/boost/tools/quickbook/test/elements-1_6.quickbook @@ -0,0 +1,21 @@ +[article 1.6 Elements +[quickbook 1.6] +] + +[/ elements from 1.6] + +[ordered_list [item1][item2]] + +[itemized_list [item1][item2]] + +[ordered_list + [ + Check that + *bold text* + isn't confused with a list. + ] +] + +[block'''<simplesect><title>'''A *simplesect*!'''</title>'''] + +[block'''</simplesect>'''] diff --git a/src/boost/tools/quickbook/test/empty-inc.quickbook b/src/boost/tools/quickbook/test/empty-inc.quickbook new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/boost/tools/quickbook/test/empty-inc.quickbook diff --git a/src/boost/tools/quickbook/test/endsect-unopened-1_7-fail.quickbook b/src/boost/tools/quickbook/test/endsect-unopened-1_7-fail.quickbook new file mode 100644 index 000000000..50125d967 --- /dev/null +++ b/src/boost/tools/quickbook/test/endsect-unopened-1_7-fail.quickbook @@ -0,0 +1,6 @@ +[article Endsect with wrong id 1.7 + [quickbook 1.7] + [id something] +] + +[endsect:something] diff --git a/src/boost/tools/quickbook/test/endsect-wrong-id-1_4-fail.quickbook b/src/boost/tools/quickbook/test/endsect-wrong-id-1_4-fail.quickbook new file mode 100644 index 000000000..ea833323c --- /dev/null +++ b/src/boost/tools/quickbook/test/endsect-wrong-id-1_4-fail.quickbook @@ -0,0 +1,6 @@ +[article Endsect with wrong id 1.4 + [quickbook 1.4] +] + +[section Quickbook section id test] +[endsect:id_test] diff --git a/src/boost/tools/quickbook/test/endsect-wrong-id-1_7-fail.quickbook b/src/boost/tools/quickbook/test/endsect-wrong-id-1_7-fail.quickbook new file mode 100644 index 000000000..9ef2fc925 --- /dev/null +++ b/src/boost/tools/quickbook/test/endsect-wrong-id-1_7-fail.quickbook @@ -0,0 +1,6 @@ +[article Endsect with wrong id 1.7 + [quickbook 1.7] +] + +[section:id_test1 Quickbook section id test] +[endsect:id_test] diff --git a/src/boost/tools/quickbook/test/escape-1_1.gold b/src/boost/tools/quickbook/test/escape-1_1.gold new file mode 100644 index 000000000..0c600e0dc --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_1.gold @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="escape" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Escape</title> + <section id="escape.escape"> + <title>Escape</title> + <para> + <emphasis>Da do do do. Da da da da. That's all I have to say to you.</emphasis> + </para> + <para> + This letter α should have a space either side of it. + </para> + <para> + These should be properly encoded: > < " + </para> + <para> + This <link linkend="$0">link</link> shouldn't be changed. + </para> + <para> + Some other problematic links: +<link linkend="$157">one</link>, +<link linkend="$-256">two</link>, +<link linkend="$text">three</link>. + </para> + <para> + <emphasis>This will be escaped</emphasis> + </para> + <para> + \[ generates [. \] generates ]. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/escape-1_1.gold-html b/src/boost/tools/quickbook/test/escape-1_1.gold-html new file mode 100644 index 000000000..61cd98261 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_1.gold-html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Escape + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#escape.escape">Escape</a> + </li> + </ul> + </div> + <div id="escape.escape"> + <h3> + Escape + </h3> + <div id="escape.escape"> + <p> + <span class="emphasis"><em>Da do do do. Da da da da. That's all I have + to say to you.</em></span> + </p> + <p> + This letter α should have a space either side of it. + </p> + <p> + These should be properly encoded: > < " + </p> + <p> + This <a>link</a> shouldn't be changed. + </p> + <p> + Some other problematic links: <a>one</a>, <a>two</a>, <a>three</a>. + </p> + <p> + <span class="emphasis"><em>This will be escaped</em></span> + </p> + <p> + \[ generates [. \] generates ]. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/escape-1_1.quickbook b/src/boost/tools/quickbook/test/escape-1_1.quickbook new file mode 100644 index 000000000..3536ae5d5 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_1.quickbook @@ -0,0 +1,34 @@ +[article Escape +] + +[section Escape] + +''' +<emphasis>Da do do do. Da da da da. That's all I have to say to you.</emphasis> +''' + +This letter '''α''' should have a space either side of it. + +These should be properly encoded: \> \< \" + +[/ The following tests are based on internal knowledge of + how quickbook's id generator works. They make sure it + doesn't mess up escaped docbook. ] + +'''This <link linkend="$0">link</link> shouldn't be changed.''' + +''' +Some other problematic links: +<link linkend="$157">one</link>, +<link linkend="$-256">two</link>, +<link linkend="$text">three</link>. +''' + +[template escapedtemplate <emphasis>This will be escaped</emphasis>] + +[`escapedtemplate] + +\\\[ generates \[. +\\\] generates \]. + +[endsect] diff --git a/src/boost/tools/quickbook/test/escape-1_6.gold b/src/boost/tools/quickbook/test/escape-1_6.gold new file mode 100644 index 000000000..54056a7d8 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_6.gold @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="escape" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Escape</title> + <section id="escape.escape"> + <title><link linkend="escape.escape">Escape</link></title> + <para> + <emphasis>Da do do do. Da da da da. That's all I have to say to you.</emphasis> + </para> + <para> + This letter α should have a space either side of it. + </para> + <para> + These should be properly encoded: > < " + </para> + <para> + This <link linkend="$0">link</link> shouldn't be changed. + </para> + <para> + Some other problematic links: +<link linkend="$157">one</link>, +<link linkend="$-256">two</link>, +<link linkend="$text">three</link>. + </para> + <para> + <emphasis>This will be escaped</emphasis> + </para> + <para> + \[ generates [. \] generates ]. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/escape-1_6.gold-html b/src/boost/tools/quickbook/test/escape-1_6.gold-html new file mode 100644 index 000000000..61cd98261 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_6.gold-html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Escape + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#escape.escape">Escape</a> + </li> + </ul> + </div> + <div id="escape.escape"> + <h3> + Escape + </h3> + <div id="escape.escape"> + <p> + <span class="emphasis"><em>Da do do do. Da da da da. That's all I have + to say to you.</em></span> + </p> + <p> + This letter α should have a space either side of it. + </p> + <p> + These should be properly encoded: > < " + </p> + <p> + This <a>link</a> shouldn't be changed. + </p> + <p> + Some other problematic links: <a>one</a>, <a>two</a>, <a>three</a>. + </p> + <p> + <span class="emphasis"><em>This will be escaped</em></span> + </p> + <p> + \[ generates [. \] generates ]. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/escape-1_6.quickbook b/src/boost/tools/quickbook/test/escape-1_6.quickbook new file mode 100644 index 000000000..0df903808 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-1_6.quickbook @@ -0,0 +1,35 @@ +[article Escape +[quickbook 1.6] +] + +[section Escape] + +''' +<emphasis>Da do do do. Da da da da. That's all I have to say to you.</emphasis> +''' + +This letter '''α''' should have a space either side of it. + +These should be properly encoded: \> \< \" + +[/ The following tests are based on internal knowledge of + how quickbook's id generator works. They make sure it + doesn't mess up escaped docbook. ] + +'''This <link linkend="$0">link</link> shouldn't be changed.''' + +''' +Some other problematic links: +<link linkend="$157">one</link>, +<link linkend="$-256">two</link>, +<link linkend="$text">three</link>. +''' + +[template escapedtemplate <emphasis>This will be escaped</emphasis>] + +[`escapedtemplate] + +\\\[ generates \[. +\\\] generates \]. + +[endsect] diff --git a/src/boost/tools/quickbook/test/escape-mismatched-1_5-fail.quickbook b/src/boost/tools/quickbook/test/escape-mismatched-1_5-fail.quickbook new file mode 100644 index 000000000..1f9d0c0a4 --- /dev/null +++ b/src/boost/tools/quickbook/test/escape-mismatched-1_5-fail.quickbook @@ -0,0 +1,5 @@ +[article Badly escaped boostbook +[quickbook 1.5] +] + +'''<emphasis>something</emphasis>
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/footnotes-1_7.gold b/src/boost/tools/quickbook/test/footnotes-1_7.gold new file mode 100644 index 000000000..9b9e9c15e --- /dev/null +++ b/src/boost/tools/quickbook/test/footnotes-1_7.gold @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="footnotes" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Footnotes</title> + <section id="footnotes.first"> + <title><link linkend="footnotes.first">First Section</link></title> + <para> + Some<footnote id="footnotes.first.f0"> + <para> + First footnote + </para> + </footnote> normal<footnote id="footnotes.first.f1"> + <para> + Second footnote + </para> + </footnote> footnotes<footnote id="footnotes.first.f2"> + <para> + Third footnote + </para> + </footnote>. + </para> + </section> + <section id="footnotes.second"> + <title><link linkend="footnotes.second">Second Section</link></title> + <para> + Some<footnote id="f1"><para>Boostbook footnote</para></footnote> +boostbook<footnote><para>Footnote without id</para></footnote> +footnotes<footnote><para>Another footnote without an id</para></footnote>. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/footnotes-1_7.gold-html b/src/boost/tools/quickbook/test/footnotes-1_7.gold-html new file mode 100644 index 000000000..d8a0743d9 --- /dev/null +++ b/src/boost/tools/quickbook/test/footnotes-1_7.gold-html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Footnotes + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#footnotes.first">First Section</a> + </li> + <li> + <a href="#footnotes.second">Second Section</a> + </li> + </ul> + </div> + <div id="footnotes.first"> + <h3> + First Section + </h3> + <div id="footnotes.first"> + <p> + Some<a id="footnotes.first.f0" href="#footnote-1"><sup class="footnote">[1]</sup></a> + normal<a id="footnotes.first.f1" href="#footnote-2"><sup class="footnote">[2]</sup></a> + footnotes<a id="footnotes.first.f2" href="#footnote-3"><sup class="footnote">[3]</sup></a>. + </p> + </div> + </div> + <div id="footnotes.second"> + <h3> + Second Section + </h3> + <div id="footnotes.second"> + <p> + Some<a id="f1" href="#footnote-4"><sup class="footnote">[4]</sup></a> boostbook<a + id="footnote-6" href="#footnote-5"><sup class="footnote">[5]</sup></a> + footnotes<a id="footnote-8" href="#footnote-7"><sup class="footnote">[6]</sup></a>. + </p> + </div> + </div> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#footnotes.first.f0"><sup>[1]</sup></a> First footnote + </p> + </div> + <div id="footnote-2" class="footnote"> + <p> + <a href="#footnotes.first.f1"><sup>[2]</sup></a> Second footnote + </p> + </div> + <div id="footnote-3" class="footnote"> + <p> + <a href="#footnotes.first.f2"><sup>[3]</sup></a> Third footnote + </p> + </div> + <div id="footnote-4" class="footnote"> + <p> + <a href="#f1"><sup>[4]</sup></a> Boostbook footnote + </p> + </div> + <div id="footnote-5" class="footnote"> + <p> + <a href="#footnote-6"><sup>[5]</sup></a> Footnote without id + </p> + </div> + <div id="footnote-7" class="footnote"> + <p> + <a href="#footnote-8"><sup>[6]</sup></a> Another footnote without an id + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/footnotes-1_7.quickbook b/src/boost/tools/quickbook/test/footnotes-1_7.quickbook new file mode 100644 index 000000000..ac3dc91f9 --- /dev/null +++ b/src/boost/tools/quickbook/test/footnotes-1_7.quickbook @@ -0,0 +1,16 @@ +[quickbook 1.7] +[article Footnotes] + +[section:first First Section] + +Some[footnote First footnote] normal[footnote Second footnote] footnotes[footnote Third footnote]. + +[endsect] + +[section:second Second Section] + +Some'''<footnote id="f1"><para>Boostbook footnote</para></footnote>''' +boostbook'''<footnote><para>Footnote without id</para></footnote>''' +footnotes'''<footnote><para>Another footnote without an id</para></footnote>'''. + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/heading-1_1.gold b/src/boost/tools/quickbook/test/heading-1_1.gold new file mode 100644 index 000000000..334d20bc1 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_1.gold @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="heading_test_1_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Heading Test 1.1</title> + <bridgehead renderas="sect2" id="heading_test_1_1.h0"> + <phrase id="heading_test_1_1.generic_header"/><link linkend="heading_test_1_1.generic_header">Generic + header</link> + </bridgehead> + <bridgehead renderas="sect1" id=".level_1"> + Level 1 + </bridgehead> + <bridgehead renderas="sect2" id=".level_2"> + Level 2 + </bridgehead> + <bridgehead renderas="sect3" id=".level_3"> + Level 3 + </bridgehead> + <bridgehead renderas="sect4" id=".level_4"> + Level 4 + </bridgehead> + <bridgehead renderas="sect5" id=".level_5"> + Level 5 + </bridgehead> + <bridgehead renderas="sect6" id=".level_6"> + Level 6 + </bridgehead> + <bridgehead renderas="sect1" id="._emphasis_role__bold__bold__emphasis_"> + <emphasis role="bold">Bold</emphasis> + </bridgehead> + <bridgehead renderas="sect1" id=".comment"> + Comment + </bridgehead> + <bridgehead renderas="sect1" id="._notanid"> + :notanid + </bridgehead> + <bridgehead renderas="sect1" id="._also_not_an_id"> + :also not an id + </bridgehead> + <bridgehead renderas="sect1" id="._anchor_id__anchor___anchor_heading"> + <anchor id="anchor"/>Anchor heading + </bridgehead> + <bridgehead renderas="sect1" id="._link_linkend__anchor__link_heading__link_"> + <link linkend="anchor">Link heading</link> + </bridgehead> + <bridgehead renderas="sect1" id=".h1"> + H1 + </bridgehead> + <section id="heading_test_1_1.s1"> + <title>S1</title> + <bridgehead renderas="sect2" id="s1.h2"> + H2 + </bridgehead> + <section id="heading_test_1_1.s2"> + <title>S2</title> + <bridgehead renderas="sect3" id="s2.h3"> + H3 + </bridgehead> + </section> + <bridgehead renderas="sect3" id="heading_test_1_1.s1.h0"> + <phrase id="heading_test_1_1.s1.h4"/><link linkend="heading_test_1_1.s1.h4">H4</link> + </bridgehead> + <section id="heading_test_1_1.s3"> + <title>S3</title> + <bridgehead renderas="sect3" id="s3.h5"> + H5 + </bridgehead> + </section> + <bridgehead renderas="sect3" id="heading_test_1_1.s1.h1"> + <phrase id="heading_test_1_1.s1.h6"/><link linkend="heading_test_1_1.s1.h6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="s3.h7"> + H7 + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/heading-1_1.gold-html b/src/boost/tools/quickbook/test/heading-1_1.gold-html new file mode 100644 index 000000000..9da607a93 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_1.gold-html @@ -0,0 +1,100 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Heading Test 1.1 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#heading_test_1_1.s1">S1</a> + </li> + </ul> + </div> + <h2 id="heading_test_1_1.generic_header"> + Generic header + </h2> + <h1 id=".level_1"> + Level 1 + </h1> + <h2 id=".level_2"> + Level 2 + </h2> + <h3 id=".level_3"> + Level 3 + </h3> + <h4 id=".level_4"> + Level 4 + </h4> + <h5 id=".level_5"> + Level 5 + </h5> + <h6 id=".level_6"> + Level 6 + </h6> + <h1 id="._emphasis_role__bold__bold__emphasis_"> + <span class="bold"><strong>Bold</strong></span> + </h1> + <h1 id=".comment"> + Comment + </h1> + <h1 id="._notanid"> + :notanid + </h1> + <h1 id="._also_not_an_id"> + :also not an id + </h1> + <h1 id="._anchor_id__anchor___anchor_heading"> + <span id="anchor"></span>Anchor heading + </h1> + <h1 id="._link_linkend__anchor__link_heading__link_"> + <a href="#anchor">Link heading</a> + </h1> + <h1 id=".h1"> + H1 + </h1> + <h1 id="s3.h7"> + H7 + </h1> + <div id="heading_test_1_1.s1"> + <h3> + S1 + </h3> + <div id="heading_test_1_1.s1"> + <h2 id="s1.h2"> + H2 + </h2> + <h3 id="heading_test_1_1.s1.h4"> + H4 + </h3> + <h3 id="heading_test_1_1.s1.h6"> + H6 + </h3> + </div> + <div id="heading_test_1_1.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_1.s2"> + <h3 id="s2.h3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_1.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_1.s3"> + <h3 id="s3.h5"> + H5 + </h3> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/heading-1_1.quickbook b/src/boost/tools/quickbook/test/heading-1_1.quickbook new file mode 100644 index 000000000..f7b2286f4 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_1.quickbook @@ -0,0 +1,55 @@ +[article Heading Test 1.1] + +[/ Basic headers ] + +[heading Generic header] +[h1 Level 1] +[h2 Level 2] +[h3 Level 3] +[h4 Level 4] +[h5 Level 5] +[h6 Level 6] + +[/ Test how heading ids are generated when different types of markup are present] + +[h1 *Bold*] +[h1 [/]Comment[/]] + +[/ Headings that look like ids] + +[h1:notanid] +[h1:also not an id] + +[/ Test how ids are generated for headings containing things like anchors + and links ] + +[h1 [#anchor]Anchor heading] +[h1 [link anchor Link heading]] + +[/ Test how heading ids are generated inside sections] + +[h1 H1] + +[section:s1 S1] + +[h2 H2] + +[section:s2 S2] + +[h3 H3] + +[endsect] + +[heading H4] + +[section:s3 S3] + +[h3 H5] + +[endsect] + +[heading H6] + +[endsect] + +[h1 H7] diff --git a/src/boost/tools/quickbook/test/heading-1_3.gold b/src/boost/tools/quickbook/test/heading-1_3.gold new file mode 100644 index 000000000..f883a6037 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_3.gold @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="header" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Header</title> + <bridgehead renderas="sect2" id="header.h0"> + <phrase id="header.header_test"/><link linkend="header.header_test">Header Test</link> + </bridgehead> + <para> + Testing headers without sections. + </para> + <bridgehead renderas="sect2" id="header.h1"> + <phrase id="header._not_an_id"/><link linkend="header._not_an_id">:Not an Id</link> + </bridgehead> + <para> + Paragraph. + </para> + <bridgehead renderas="sect3" id="header.h2"> + <phrase id="header._not_an_id_again"/><link linkend="header._not_an_id_again">:Not + an Id again</link> + </bridgehead> + <para> + Paragraph. + </para> +</article> diff --git a/src/boost/tools/quickbook/test/heading-1_3.gold-html b/src/boost/tools/quickbook/test/heading-1_3.gold-html new file mode 100644 index 000000000..a46543b63 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_3.gold-html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Header + </h3> + <h2 id="header.header_test"> + Header Test + </h2> + <p> + Testing headers without sections. + </p> + <h2 id="header._not_an_id"> + :Not an Id + </h2> + <p> + Paragraph. + </p> + <h3 id="header._not_an_id_again"> + :Not an Id again + </h3> + <p> + Paragraph. + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/heading-1_3.quickbook b/src/boost/tools/quickbook/test/heading-1_3.quickbook new file mode 100644 index 000000000..19de3a49a --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_3.quickbook @@ -0,0 +1,16 @@ +[article Header + [quickbook 1.3] + [id header] +] + +[heading Header Test] + +Testing headers without sections. + +[heading:Not an Id] + +Paragraph. + +[h3:Not an Id again] + +Paragraph.
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/heading-1_5.gold b/src/boost/tools/quickbook/test/heading-1_5.gold new file mode 100644 index 000000000..03fe46491 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_5.gold @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="heading_test_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Heading Test 1.5</title> + <bridgehead renderas="sect2" id="heading_test_1_5.h0"> + <phrase id="heading_test_1_5.generic_header"/><link linkend="heading_test_1_5.generic_header">Generic + header</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h2"> + <phrase id="heading_test_1_5.level_1"/><link linkend="heading_test_1_5.level_1">Level + 1</link> + </bridgehead> + <bridgehead renderas="sect2" id="heading_test_1_5.h3"> + <phrase id="heading_test_1_5.level_2"/><link linkend="heading_test_1_5.level_2">Level + 2</link> + </bridgehead> + <bridgehead renderas="sect3" id="heading_test_1_5.h4"> + <phrase id="heading_test_1_5.level_3"/><link linkend="heading_test_1_5.level_3">Level + 3</link> + </bridgehead> + <bridgehead renderas="sect4" id="heading_test_1_5.h5"> + <phrase id="heading_test_1_5.level_4"/><link linkend="heading_test_1_5.level_4">Level + 4</link> + </bridgehead> + <bridgehead renderas="sect5" id="heading_test_1_5.h6"> + <phrase id="heading_test_1_5.level_5"/><link linkend="heading_test_1_5.level_5">Level + 5</link> + </bridgehead> + <bridgehead renderas="sect6" id="heading_test_1_5.h8"> + <phrase id="heading_test_1_5.level_6"/><link linkend="heading_test_1_5.level_6">Level + 6</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h9"> + <phrase id="heading_test_1_5._emphasis_role__bold__bold__emphasis_"/><link linkend="heading_test_1_5._emphasis_role__bold__bold__emphasis_"><emphasis + role="bold">Bold</emphasis></link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h10"> + <phrase id="heading_test_1_5.comment"/><link linkend="heading_test_1_5.comment">Comment</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h11"> + <phrase id="heading_test_1_5._notanid"/><link linkend="heading_test_1_5._notanid">:notanid</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h12"> + <phrase id="heading_test_1_5._also_not_an_id"/><link linkend="heading_test_1_5._also_not_an_id">:also + not an id</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h13"> + <phrase id="heading_test_1_5._anchor_id__anchor___anchor_heading"/><link linkend="heading_test_1_5._anchor_id__anchor___anchor_heading"><anchor + id="anchor"/>Anchor heading</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_5.h14"> + <phrase id="heading_test_1_5._link_linkend__anchor__link_heading__link_"/><link + linkend="heading_test_1_5._link_linkend__anchor__link_heading__link_"><link linkend="anchor">Link + heading</link></link> + </bridgehead> + <bridgehead renderas="sect2" id="heading_test_1_5.h15"> + <phrase id="heading_test_1_5.h1"/><link linkend="heading_test_1_5.h1">H1</link> + </bridgehead> + <section id="heading_test_1_5.s1"> + <title><link linkend="heading_test_1_5.s1">S1</link></title> + <bridgehead renderas="sect2" id="heading_test_1_5.s1.h0"> + <phrase id="heading_test_1_5.s1.h2"/><link linkend="heading_test_1_5.s1.h2">H2</link> + </bridgehead> + <section id="heading_test_1_5.s1.s2"> + <title><link linkend="heading_test_1_5.s1.s2">S2</link></title> + <bridgehead renderas="sect3" id="heading_test_1_5.s1.s2.h0"> + <phrase id="heading_test_1_5.s1.s2.h3"/><link linkend="heading_test_1_5.s1.s2.h3">H3</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_5.s1.h1"> + <phrase id="heading_test_1_5.s1.h4"/><link linkend="heading_test_1_5.s1.h4">H4</link> + </bridgehead> + <section id="heading_test_1_5.s1.s3"> + <title><link linkend="heading_test_1_5.s1.s3">S3</link></title> + <bridgehead renderas="sect4" id="heading_test_1_5.s1.s3.h0"> + <phrase id="heading_test_1_5.s1.s3.h5"/><link linkend="heading_test_1_5.s1.s3.h5">H5</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_5.s1.h3"> + <phrase id="heading_test_1_5.s1.h6"/><link linkend="heading_test_1_5.s1.h6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="heading_test_1_5.h16"> + <phrase id="heading_test_1_5.h7"/><link linkend="heading_test_1_5.h7">H7</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/heading-1_5.gold-html b/src/boost/tools/quickbook/test/heading-1_5.gold-html new file mode 100644 index 000000000..cad0e0311 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_5.gold-html @@ -0,0 +1,100 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Heading Test 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#heading_test_1_5.s1">S1</a> + </li> + </ul> + </div> + <h2 id="heading_test_1_5.generic_header"> + Generic header + </h2> + <h1 id="heading_test_1_5.level_1"> + Level 1 + </h1> + <h2 id="heading_test_1_5.level_2"> + Level 2 + </h2> + <h3 id="heading_test_1_5.level_3"> + Level 3 + </h3> + <h4 id="heading_test_1_5.level_4"> + Level 4 + </h4> + <h5 id="heading_test_1_5.level_5"> + Level 5 + </h5> + <h6 id="heading_test_1_5.level_6"> + Level 6 + </h6> + <h1 id="heading_test_1_5._emphasis_role__bold__bold__emphasis_"> + <span class="bold"><strong>Bold</strong></span> + </h1> + <h1 id="heading_test_1_5.comment"> + Comment + </h1> + <h1 id="heading_test_1_5._notanid"> + :notanid + </h1> + <h1 id="heading_test_1_5._also_not_an_id"> + :also not an id + </h1> + <h1 id="heading_test_1_5._anchor_id__anchor___anchor_heading"> + <span id="anchor"></span>Anchor heading + </h1> + <h1 id="heading_test_1_5._link_linkend__anchor__link_heading__link_"> + <a href="#anchor">Link heading</a> + </h1> + <h2 id="heading_test_1_5.h1"> + H1 + </h2> + <h1 id="heading_test_1_5.h7"> + H7 + </h1> + <div id="heading_test_1_5.s1"> + <h3> + S1 + </h3> + <div id="heading_test_1_5.s1"> + <h2 id="heading_test_1_5.s1.h2"> + H2 + </h2> + <h2 id="heading_test_1_5.s1.h4"> + H4 + </h2> + <h2 id="heading_test_1_5.s1.h6"> + H6 + </h2> + </div> + <div id="heading_test_1_5.s1.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_5.s1.s2"> + <h3 id="heading_test_1_5.s1.s2.h3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_5.s1.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_5.s1.s3"> + <h4 id="heading_test_1_5.s1.s3.h5"> + H5 + </h4> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/heading-1_5.quickbook b/src/boost/tools/quickbook/test/heading-1_5.quickbook new file mode 100644 index 000000000..572b184cd --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_5.quickbook @@ -0,0 +1,57 @@ +[article Heading Test 1.5 +[quickbook 1.5] +] + +[/ Basic headers ] + +[heading Generic header] +[h1 Level 1] +[h2 Level 2] +[h3 Level 3] +[h4 Level 4] +[h5 Level 5] +[h6 Level 6] + +[/ Test how heading ids are generated when different types of markup are present] + +[h1 *Bold*] +[h1 [/]Comment[/]] + +[/ Headings that look like ids] + +[h1:notanid] +[h1:also not an id] + +[/ Test how ids are generated for headings containing things like anchors + and links ] + +[h1 [#anchor]Anchor heading] +[h1 [link anchor Link heading]] + +[/ Test how heading ids are generated inside sections] + +[heading H1] + +[section:s1 S1] + +[h2 H2] + +[section:s2 S2] + +[h3 H3] + +[endsect] + +[h2 H4] + +[section:s3 S3] + +[heading H5] + +[endsect] + +[h2 H6] + +[endsect] + +[h1 H7] diff --git a/src/boost/tools/quickbook/test/heading-1_6.gold b/src/boost/tools/quickbook/test/heading-1_6.gold new file mode 100644 index 000000000..008115d72 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_6.gold @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="heading_test_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Heading Test 1.6</title> + <bridgehead renderas="sect2" id="heading_test_1_6.h0"> + <phrase id="heading_test_1_6.generic_header"/><link linkend="heading_test_1_6.generic_header">Generic + header</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h2"> + <phrase id="heading_test_1_6.level_1"/><link linkend="heading_test_1_6.level_1">Level + 1</link> + </bridgehead> + <bridgehead renderas="sect2" id="heading_test_1_6.h3"> + <phrase id="heading_test_1_6.level_2"/><link linkend="heading_test_1_6.level_2">Level + 2</link> + </bridgehead> + <bridgehead renderas="sect3" id="heading_test_1_6.h4"> + <phrase id="heading_test_1_6.level_3"/><link linkend="heading_test_1_6.level_3">Level + 3</link> + </bridgehead> + <bridgehead renderas="sect4" id="heading_test_1_6.h5"> + <phrase id="heading_test_1_6.level_4"/><link linkend="heading_test_1_6.level_4">Level + 4</link> + </bridgehead> + <bridgehead renderas="sect5" id="heading_test_1_6.h6"> + <phrase id="heading_test_1_6.level_5"/><link linkend="heading_test_1_6.level_5">Level + 5</link> + </bridgehead> + <bridgehead renderas="sect6" id="heading_test_1_6.h8"> + <phrase id="heading_test_1_6.level_6"/><link linkend="heading_test_1_6.level_6">Level + 6</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h9"> + <phrase id="heading_test_1_6.bold"/><link linkend="heading_test_1_6.bold"><emphasis + role="bold">Bold</emphasis></link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h10"> + <phrase id="heading_test_1_6.comment"/><link linkend="heading_test_1_6.comment">Comment</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h11"> + <phrase id="heading_test_1_6.anchor_anchor_heading"/><link linkend="heading_test_1_6.anchor_anchor_heading"><anchor + id="anchor"/>Anchor heading</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h12"> + <phrase id="heading_test_1_6.link_anchor_link_heading"/><link linkend="heading_test_1_6.link_anchor_link_heading"><link + linkend="anchor">Link heading</link></link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h13"> + <phrase id="heading_test_1_6.h1"/><link linkend="heading_test_1_6.h1">H1</link> + </bridgehead> + <section id="heading_test_1_6.s1"> + <title><link linkend="heading_test_1_6.s1">S1</link></title> + <bridgehead renderas="sect3" id="heading_test_1_6.s1.h0"> + <phrase id="heading_test_1_6.s1.h2"/><link linkend="heading_test_1_6.s1.h2">H2</link> + </bridgehead> + <section id="heading_test_1_6.s1.s2"> + <title><link linkend="heading_test_1_6.s1.s2">S2</link></title> + <bridgehead renderas="sect3" id="heading_test_1_6.s1.s2.h0"> + <phrase id="heading_test_1_6.s1.s2.h3"/><link linkend="heading_test_1_6.s1.s2.h3">H3</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_6.s1.h1"> + <phrase id="heading_test_1_6.s1.h4"/><link linkend="heading_test_1_6.s1.h4">H4</link> + </bridgehead> + <section id="heading_test_1_6.s1.s3"> + <title><link linkend="heading_test_1_6.s1.s3">S3</link></title> + <bridgehead renderas="sect4" id="heading_test_1_6.s1.s3.h0"> + <phrase id="heading_test_1_6.s1.s3.h5"/><link linkend="heading_test_1_6.s1.s3.h5">H5</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_6.s1.h3"> + <phrase id="heading_test_1_6.s1.h6"/><link linkend="heading_test_1_6.s1.h6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="heading_test_1_6.h14"> + <phrase id="heading_test_1_6.h7"/><link linkend="heading_test_1_6.h7">H7</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_6.h15"> + <phrase id="heading_test_1_6.a1"/><link linkend="heading_test_1_6.a1">H1</link> + </bridgehead> + <section id="heading_test_1_6.s1_0"> + <title><link linkend="heading_test_1_6.s1_0">S1</link></title> + <bridgehead renderas="sect2" id="heading_test_1_6.s1_0.h0"> + <phrase id="heading_test_1_6.s1_0.a2"/><link linkend="heading_test_1_6.s1_0.a2">H2</link> + </bridgehead> + <section id="heading_test_1_6.s1_0.s2"> + <title><link linkend="heading_test_1_6.s1_0.s2">S2</link></title> + <bridgehead renderas="sect3" id="heading_test_1_6.s1_0.s2.h0"> + <phrase id="heading_test_1_6.s1_0.s2.a3"/><link linkend="heading_test_1_6.s1_0.s2.a3">H3</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_6.s1_0.h1"> + <phrase id="heading_test_1_6.s1_0.a4"/><link linkend="heading_test_1_6.s1_0.a4">H4</link> + </bridgehead> + <section id="heading_test_1_6.s1_0.s3"> + <title><link linkend="heading_test_1_6.s1_0.s3">S3</link></title> + <bridgehead renderas="sect3" id="heading_test_1_6.s1_0.s3.h0"> + <phrase id="heading_test_1_6.s1_0.s3.a5"/><link linkend="heading_test_1_6.s1_0.s3.a5">H5</link> + </bridgehead> + </section> + <bridgehead renderas="sect3" id="heading_test_1_6.s1_0.h2"> + <phrase id="heading_test_1_6.s1_0.a6"/><link linkend="heading_test_1_6.s1_0.a6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="heading_test_1_6.h16"> + <phrase id="heading_test_1_6.a7"/><link linkend="heading_test_1_6.a7">H7</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/heading-1_6.gold-html b/src/boost/tools/quickbook/test/heading-1_6.gold-html new file mode 100644 index 000000000..ce826d66b --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_6.gold-html @@ -0,0 +1,139 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Heading Test 1.6 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#heading_test_1_6.s1">S1</a> + </li> + <li> + <a href="#heading_test_1_6.s1_0">S1</a> + </li> + </ul> + </div> + <h2 id="heading_test_1_6.generic_header"> + Generic header + </h2> + <h1 id="heading_test_1_6.level_1"> + Level 1 + </h1> + <h2 id="heading_test_1_6.level_2"> + Level 2 + </h2> + <h3 id="heading_test_1_6.level_3"> + Level 3 + </h3> + <h4 id="heading_test_1_6.level_4"> + Level 4 + </h4> + <h5 id="heading_test_1_6.level_5"> + Level 5 + </h5> + <h6 id="heading_test_1_6.level_6"> + Level 6 + </h6> + <h1 id="heading_test_1_6.bold"> + <span class="bold"><strong>Bold</strong></span> + </h1> + <h1 id="heading_test_1_6.comment"> + Comment + </h1> + <h1 id="heading_test_1_6.anchor_anchor_heading"> + <span id="anchor"></span>Anchor heading + </h1> + <h1 id="heading_test_1_6.link_anchor_link_heading"> + <a href="#anchor">Link heading</a> + </h1> + <h1 id="heading_test_1_6.h1"> + H1 + </h1> + <h1 id="heading_test_1_6.h7"> + H7 + </h1> + <h1 id="heading_test_1_6.a1"> + H1 + </h1> + <h1 id="heading_test_1_6.a7"> + H7 + </h1> + <div id="heading_test_1_6.s1"> + <h3> + S1 + </h3> + <div id="heading_test_1_6.s1"> + <h3 id="heading_test_1_6.s1.h2"> + H2 + </h3> + <h2 id="heading_test_1_6.s1.h4"> + H4 + </h2> + <h2 id="heading_test_1_6.s1.h6"> + H6 + </h2> + </div> + <div id="heading_test_1_6.s1.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_6.s1.s2"> + <h3 id="heading_test_1_6.s1.s2.h3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_6.s1.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_6.s1.s3"> + <h4 id="heading_test_1_6.s1.s3.h5"> + H5 + </h4> + </div> + </div> + </div> + <div id="heading_test_1_6.s1_0"> + <h3> + S1 + </h3> + <div id="heading_test_1_6.s1_0"> + <h2 id="heading_test_1_6.s1_0.a2"> + H2 + </h2> + <h2 id="heading_test_1_6.s1_0.a4"> + H4 + </h2> + <h3 id="heading_test_1_6.s1_0.a6"> + H6 + </h3> + </div> + <div id="heading_test_1_6.s1_0.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_6.s1_0.s2"> + <h3 id="heading_test_1_6.s1_0.s2.a3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_6.s1_0.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_6.s1_0.s3"> + <h3 id="heading_test_1_6.s1_0.s3.a5"> + H5 + </h3> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/heading-1_6.quickbook b/src/boost/tools/quickbook/test/heading-1_6.quickbook new file mode 100644 index 000000000..b8f668694 --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_6.quickbook @@ -0,0 +1,80 @@ +[article Heading Test 1.6 +[quickbook 1.6] +] + +[/ Basic headers ] + +[heading Generic header] +[h1 Level 1] +[h2 Level 2] +[h3 Level 3] +[h4 Level 4] +[h5 Level 5] +[h6 Level 6] + +[/ Test how heading ids are generated when different types of markup are present] + +[h1 *Bold*] +[h1 [/]Comment[/]] + +[/ Test how ids are generated for headings containing things like anchors + and links ] + +[h1 [#anchor]Anchor heading] +[h1 [link anchor Link heading]] + +[/ Test how heading ids are generated inside sections] + +[h1 H1] + +[section:s1 S1] + +[heading H2] + +[section:s2 S2] + +[h3 H3] + +[endsect] + +[h2 H4] + +[section:s3 S3] + +[heading H5] + +[endsect] + +[h2 H6] + +[endsect] + +[h1 H7] + +[/ Repeat with explicit ids] + +[h1:a1 H1] + +[section:s1 S1] + +[h2:a2 H2] + +[section:s2 S2] + +[h3:a3 H3] + +[endsect] + +[h2:a4 H4] + +[section:s3 S3] + +[h3:a5 H5] + +[endsect] + +[heading:a6 H6] + +[endsect] + +[h1:a7 H7] diff --git a/src/boost/tools/quickbook/test/heading-1_7.gold b/src/boost/tools/quickbook/test/heading-1_7.gold new file mode 100644 index 000000000..52f8291ab --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_7.gold @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="heading_test_1_7" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Heading Test 1.7</title> + <bridgehead renderas="sect2" id="heading_test_1_7.h0"> + <phrase id="heading_test_1_7.generic_header"/><link linkend="heading_test_1_7.generic_header">Generic + header</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h2"> + <phrase id="heading_test_1_7.level_1"/><link linkend="heading_test_1_7.level_1">Level + 1</link> + </bridgehead> + <bridgehead renderas="sect2" id="heading_test_1_7.h3"> + <phrase id="heading_test_1_7.level_2"/><link linkend="heading_test_1_7.level_2">Level + 2</link> + </bridgehead> + <bridgehead renderas="sect3" id="heading_test_1_7.h4"> + <phrase id="heading_test_1_7.level_3"/><link linkend="heading_test_1_7.level_3">Level + 3</link> + </bridgehead> + <bridgehead renderas="sect4" id="heading_test_1_7.h5"> + <phrase id="heading_test_1_7.level_4"/><link linkend="heading_test_1_7.level_4">Level + 4</link> + </bridgehead> + <bridgehead renderas="sect5" id="heading_test_1_7.h6"> + <phrase id="heading_test_1_7.level_5"/><link linkend="heading_test_1_7.level_5">Level + 5</link> + </bridgehead> + <bridgehead renderas="sect6" id="heading_test_1_7.h8"> + <phrase id="heading_test_1_7.level_6"/><link linkend="heading_test_1_7.level_6">Level + 6</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h9"> + <phrase id="heading_test_1_7.bold"/><link linkend="heading_test_1_7.bold"><emphasis + role="bold">Bold</emphasis></link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h10"> + <phrase id="heading_test_1_7.comment"/><link linkend="heading_test_1_7.comment">Comment</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h11"> + <phrase id="heading_test_1_7.anchor_anchor_heading"/><link linkend="heading_test_1_7.anchor_anchor_heading"><anchor + id="anchor"/>Anchor heading</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h12"> + <phrase id="heading_test_1_7.link_anchor_link_heading"/><link linkend="heading_test_1_7.link_anchor_link_heading"><link + linkend="anchor">Link heading</link></link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h13"> + <phrase id="heading_test_1_7.h1"/><link linkend="heading_test_1_7.h1">H1</link> + </bridgehead> + <section id="heading_test_1_7.s1"> + <title><link linkend="heading_test_1_7.s1">S1</link></title> + <bridgehead renderas="sect3" id="heading_test_1_7.s1.h0"> + <phrase id="heading_test_1_7.s1.h2"/><link linkend="heading_test_1_7.s1.h2">H2</link> + </bridgehead> + <section id="heading_test_1_7.s1.s2"> + <title><link linkend="heading_test_1_7.s1.s2">S2</link></title> + <bridgehead renderas="sect3" id="heading_test_1_7.s1.s2.h0"> + <phrase id="heading_test_1_7.s1.s2.h3"/><link linkend="heading_test_1_7.s1.s2.h3">H3</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_7.s1.h1"> + <phrase id="heading_test_1_7.s1.h4"/><link linkend="heading_test_1_7.s1.h4">H4</link> + </bridgehead> + <section id="heading_test_1_7.s1.s3"> + <title><link linkend="heading_test_1_7.s1.s3">S3</link></title> + <bridgehead renderas="sect4" id="heading_test_1_7.s1.s3.h0"> + <phrase id="heading_test_1_7.s1.s3.h5"/><link linkend="heading_test_1_7.s1.s3.h5">H5</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_7.s1.h3"> + <phrase id="heading_test_1_7.s1.h6"/><link linkend="heading_test_1_7.s1.h6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="heading_test_1_7.h14"> + <phrase id="heading_test_1_7.h7"/><link linkend="heading_test_1_7.h7">H7</link> + </bridgehead> + <bridgehead renderas="sect1" id="heading_test_1_7.h15"> + <phrase id="heading_test_1_7.a1"/><link linkend="heading_test_1_7.a1">H1</link> + </bridgehead> + <section id="heading_test_1_7.s1_0"> + <title><link linkend="heading_test_1_7.s1_0">S1</link></title> + <bridgehead renderas="sect2" id="heading_test_1_7.s1_0.h0"> + <phrase id="heading_test_1_7.s1_0.a2"/><link linkend="heading_test_1_7.s1_0.a2">H2</link> + </bridgehead> + <section id="heading_test_1_7.s1_0.s2"> + <title><link linkend="heading_test_1_7.s1_0.s2">S2</link></title> + <bridgehead renderas="sect3" id="heading_test_1_7.s1_0.s2.h0"> + <phrase id="heading_test_1_7.s1_0.s2.a3"/><link linkend="heading_test_1_7.s1_0.s2.a3">H3</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="heading_test_1_7.s1_0.h1"> + <phrase id="heading_test_1_7.s1_0.a4"/><link linkend="heading_test_1_7.s1_0.a4">H4</link> + </bridgehead> + <section id="heading_test_1_7.s1_0.s3"> + <title><link linkend="heading_test_1_7.s1_0.s3">S3</link></title> + <bridgehead renderas="sect3" id="heading_test_1_7.s1_0.s3.h0"> + <phrase id="heading_test_1_7.s1_0.s3.a5"/><link linkend="heading_test_1_7.s1_0.s3.a5">H5</link> + </bridgehead> + </section> + <bridgehead renderas="sect3" id="heading_test_1_7.s1_0.h2"> + <phrase id="heading_test_1_7.s1_0.a6"/><link linkend="heading_test_1_7.s1_0.a6">H6</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="heading_test_1_7.h16"> + <phrase id="heading_test_1_7.a7"/><link linkend="heading_test_1_7.a7">H7</link> + </bridgehead> + <bridgehead renderas="sect2" id="heading_test_1_7.h17"> + <phrase id="heading_test_1_7.abc-2"/><link linkend="heading_test_1_7.abc-2">Template + Id</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/heading-1_7.gold-html b/src/boost/tools/quickbook/test/heading-1_7.gold-html new file mode 100644 index 000000000..b0e21997b --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_7.gold-html @@ -0,0 +1,142 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Heading Test 1.7 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#heading_test_1_7.s1">S1</a> + </li> + <li> + <a href="#heading_test_1_7.s1_0">S1</a> + </li> + </ul> + </div> + <h2 id="heading_test_1_7.generic_header"> + Generic header + </h2> + <h1 id="heading_test_1_7.level_1"> + Level 1 + </h1> + <h2 id="heading_test_1_7.level_2"> + Level 2 + </h2> + <h3 id="heading_test_1_7.level_3"> + Level 3 + </h3> + <h4 id="heading_test_1_7.level_4"> + Level 4 + </h4> + <h5 id="heading_test_1_7.level_5"> + Level 5 + </h5> + <h6 id="heading_test_1_7.level_6"> + Level 6 + </h6> + <h1 id="heading_test_1_7.bold"> + <span class="bold"><strong>Bold</strong></span> + </h1> + <h1 id="heading_test_1_7.comment"> + Comment + </h1> + <h1 id="heading_test_1_7.anchor_anchor_heading"> + <span id="anchor"></span>Anchor heading + </h1> + <h1 id="heading_test_1_7.link_anchor_link_heading"> + <a href="#anchor">Link heading</a> + </h1> + <h1 id="heading_test_1_7.h1"> + H1 + </h1> + <h1 id="heading_test_1_7.h7"> + H7 + </h1> + <h1 id="heading_test_1_7.a1"> + H1 + </h1> + <h1 id="heading_test_1_7.a7"> + H7 + </h1> + <h2 id="heading_test_1_7.abc-2"> + Template Id + </h2> + <div id="heading_test_1_7.s1"> + <h3> + S1 + </h3> + <div id="heading_test_1_7.s1"> + <h3 id="heading_test_1_7.s1.h2"> + H2 + </h3> + <h2 id="heading_test_1_7.s1.h4"> + H4 + </h2> + <h2 id="heading_test_1_7.s1.h6"> + H6 + </h2> + </div> + <div id="heading_test_1_7.s1.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_7.s1.s2"> + <h3 id="heading_test_1_7.s1.s2.h3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_7.s1.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_7.s1.s3"> + <h4 id="heading_test_1_7.s1.s3.h5"> + H5 + </h4> + </div> + </div> + </div> + <div id="heading_test_1_7.s1_0"> + <h3> + S1 + </h3> + <div id="heading_test_1_7.s1_0"> + <h2 id="heading_test_1_7.s1_0.a2"> + H2 + </h2> + <h2 id="heading_test_1_7.s1_0.a4"> + H4 + </h2> + <h3 id="heading_test_1_7.s1_0.a6"> + H6 + </h3> + </div> + <div id="heading_test_1_7.s1_0.s2"> + <h3> + S2 + </h3> + <div id="heading_test_1_7.s1_0.s2"> + <h3 id="heading_test_1_7.s1_0.s2.a3"> + H3 + </h3> + </div> + </div> + <div id="heading_test_1_7.s1_0.s3"> + <h3> + S3 + </h3> + <div id="heading_test_1_7.s1_0.s3"> + <h3 id="heading_test_1_7.s1_0.s3.a5"> + H5 + </h3> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/heading-1_7.quickbook b/src/boost/tools/quickbook/test/heading-1_7.quickbook new file mode 100644 index 000000000..47f878add --- /dev/null +++ b/src/boost/tools/quickbook/test/heading-1_7.quickbook @@ -0,0 +1,83 @@ +[article Heading Test 1.7 +[quickbook 1.7] +] + +[/ Basic headers ] + +[heading Generic header] +[h1 Level 1] +[h2 Level 2] +[h3 Level 3] +[h4 Level 4] +[h5 Level 5] +[h6 Level 6] + +[/ Test how heading ids are generated when different types of markup are present] + +[h1 *Bold*] +[h1 [/]Comment[/]] + +[/ Test how ids are generated for headings containing things like anchors + and links ] + +[h1 [#anchor]Anchor heading] +[h1 [link anchor Link heading]] + +[/ Test how heading ids are generated inside sections] + +[h1 H1] + +[section:s1 S1] + +[heading H2] + +[section:s2 S2] + +[h3 H3] + +[endsect] + +[h2 H4] + +[section:s3 S3] + +[heading H5] + +[endsect] + +[h2 H6] + +[endsect] + +[h1 H7] + +[/ Repeat with explicit ids] + +[h1:a1 H1] + +[section:s1 S1] + +[h2:a2 H2] + +[section:s2 S2] + +[h3:a3 H3] + +[endsect] + +[h2:a4 H4] + +[section:s3 S3] + +[h3:a5 H5] + +[endsect] + +[heading:a6 H6] + +[endsect] + +[h1:a7 H7] + +[template thing[] abc] +[heading:[thing]-2 Template Id] diff --git a/src/boost/tools/quickbook/test/heading_unclosed-1_4-fail.quickbook b/src/boost/tools/quickbook/test/heading_unclosed-1_4-fail.quickbook new file mode 100644 index 000000000..79bf3d79a --- /dev/null +++ b/src/boost/tools/quickbook/test/heading_unclosed-1_4-fail.quickbook @@ -0,0 +1,3 @@ +[article Parse error [quickbook 1.4]] + +[heading Incomplete heading diff --git a/src/boost/tools/quickbook/test/hr-1_5.gold b/src/boost/tools/quickbook/test/hr-1_5.gold new file mode 100644 index 000000000..8da9aa4d0 --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_5.gold @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="horizontal_rule" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Horizontal Rule</title> + <para/> + <para> + This should be displayed. + </para> + <para/> + <para/> + <para> + * This shouldn't be a list + </para> + <para/> + <itemizedlist> + <listitem> + <simpara> + This should be a list + </simpara> + </listitem> + </itemizedlist> + <para/> + <itemizedlist> + <listitem> + <simpara> + This should be a list + </simpara> + </listitem> + </itemizedlist> + <para/> + <para/> + <para/> +</article> diff --git a/src/boost/tools/quickbook/test/hr-1_5.gold-html b/src/boost/tools/quickbook/test/hr-1_5.gold-html new file mode 100644 index 000000000..14c24c067 --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_5.gold-html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Horizontal Rule + </h3> + <p> + </p> + <p> + This should be displayed. + </p> + <p> + </p> + <p> + </p> + <p> + * This shouldn't be a list + </p> + <p> + </p> + <ul> + <li> + <div> + This should be a list + </div> + </li> + </ul> + <p> + </p> + <ul> + <li> + <div> + This should be a list + </div> + </li> + </ul> + <p> + </p> + <p> + </p> + <p> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/hr-1_5.quickbook b/src/boost/tools/quickbook/test/hr-1_5.quickbook new file mode 100644 index 000000000..27df9f537 --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_5.quickbook @@ -0,0 +1,27 @@ +[article Horizontal Rule +[quickbook 1.5] +] + +---- [/ +This should be a comment. +] This should be displayed. + +---- [/ ] This shouldn't be displayed. + +---- [/ +This should be a comment. +] * This shouldn't be a list + +---- [/ +This should be a comment. +] +* This should be a list + +---- [/ This should be a comment] +* This should be a list + +---- [* This shouldn't be displayed.] + +---- This doesn't have an open bracket.] + +---- [ This doesn't have a close bracket. diff --git a/src/boost/tools/quickbook/test/hr-1_6.gold b/src/boost/tools/quickbook/test/hr-1_6.gold new file mode 100644 index 000000000..b9ef17a47 --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_6.gold @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="horizontal_rule" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Horizontal Rule</title> + <para/> + <para> + This should be displayed. + </para> + <para/> + <para/> + <para> + * This shouldn't be a list + </para> + <para/> + <itemizedlist> + <listitem> + <simpara> + This should be a list + </simpara> + </listitem> + </itemizedlist> + <para/> + <itemizedlist> + <listitem> + <simpara> + This should be a list + </simpara> + </listitem> + </itemizedlist> + <para/> + <para> + <emphasis role="bold">This should be displayed. Maybe that's wrong?</emphasis> + </para> + <para/> + <para> + Odd way to get text displayed. + </para> +</article> diff --git a/src/boost/tools/quickbook/test/hr-1_6.gold-html b/src/boost/tools/quickbook/test/hr-1_6.gold-html new file mode 100644 index 000000000..11e670228 --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_6.gold-html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Horizontal Rule + </h3> + <p> + </p> + <p> + This should be displayed. + </p> + <p> + </p> + <p> + </p> + <p> + * This shouldn't be a list + </p> + <p> + </p> + <ul> + <li> + <div> + This should be a list + </div> + </li> + </ul> + <p> + </p> + <ul> + <li> + <div> + This should be a list + </div> + </li> + </ul> + <p> + </p> + <p> + <span class="bold"><strong>This should be displayed. Maybe that's wrong?</strong></span> + </p> + <p> + </p> + <p> + Odd way to get text displayed. + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/hr-1_6.quickbook b/src/boost/tools/quickbook/test/hr-1_6.quickbook new file mode 100644 index 000000000..0ed38c93e --- /dev/null +++ b/src/boost/tools/quickbook/test/hr-1_6.quickbook @@ -0,0 +1,26 @@ +[article Horizontal Rule +[quickbook 1.6] +] + +---- [/ +This should be a comment. +] This should be displayed. + +---- [/ ] This shouldn't be displayed. + +---- [/ +This should be a comment. +] * This shouldn't be a list + +---- [/ +This should be a comment. +] +* This should be a list + +---- [/ This should be a comment] +* This should be a list + +---- [* This should be displayed. Maybe that's wrong?] + +[template nothing] +---- [nothing] Odd way to get text displayed. diff --git a/src/boost/tools/quickbook/test/html/images/open_clipart_library_logo.svg b/src/boost/tools/quickbook/test/html/images/open_clipart_library_logo.svg new file mode 100644 index 000000000..9a4521f3a --- /dev/null +++ b/src/boost/tools/quickbook/test/html/images/open_clipart_library_logo.svg @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.0" + x="0.00000000" + y="0.00000000" + id="svg6221" + width="745.60706" + height="513.25690" + sodipodi:version="0.32" + inkscape:version="0.42" + sodipodi:docname="Open_Clipart_Library_logo.svg"> + <sodipodi:namedview + inkscape:cy="893.36713" + inkscape:cx="305.25953" + inkscape:zoom="0.86831670" + inkscape:window-height="913" + inkscape:window-width="1272" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:window-x="0" + inkscape:window-y="30" + inkscape:current-layer="svg6221" /> + <metadata + id="metadata4"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>Open Clip Art Logo</dc:title> + <dc:date>10-01-2004</dc:date> + <dc:creator> + <cc:Agent> + <dc:title>Andreas Nilsson</dc:title> + </cc:Agent> + </dc:creator> + <cc:license + rdf:resource="http://web.resource.org/cc/PublicDomain" /> + <dc:contributor> + <cc:Agent> + <dc:title>Jon Phillips, Tobias Jakobs</dc:title> + </cc:Agent> + </dc:contributor> + <dc:description>This is one version of the official Open Clip Art Library logo.</dc:description> + <dc:subject>logo, open clip art library logo, logotype</dc:subject> + </cc:Work> + <cc:License + rdf:about="http://web.resource.org/cc/PublicDomain"> + <cc:permits + rdf:resource="http://web.resource.org/cc/Reproduction" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/Distribution" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> + </cc:License> + </rdf:RDF> + </metadata> + <defs + id="defs3" /> + <path + d="M 405.82430,48.494855 C 396.10958,45.870336 386.13966,51.583653 383.51514,61.298370 L 298.15838,376.92441 C 295.53385,386.63914 301.24717,396.41506 310.96188,399.03957 L 626.58791,484.39635 C 636.30255,487.02086 646.27253,481.30755 648.89705,471.59283 L 734.25375,155.96679 C 735.49097,151.38725 734.71475,146.85751 732.70181,142.96928 L 732.70181,142.77528 L 732.50782,142.38730 L 732.50782,142.19331 C 732.46276,142.11490 732.36008,142.07704 732.31383,141.99931 L 717.76438,111.93045 L 651.80695,114.84034 L 405.82430,48.494855 z " + style="fill:#000000;fill-opacity:0.20000000;fill-rule:evenodd;stroke:none;stroke-width:1.6789947;stroke-miterlimit:4.0000000;stroke-opacity:0.20000000" + id="rect6080" /> + <rect + width="363.28452" + height="363.28452" + rx="2.9260478" + ry="2.9260478" + x="363.42282" + y="-78.837021" + transform="matrix(0.965391,0.260807,-0.260807,0.965391,0.000000,0.000000)" + style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:7.7597070;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + id="rect911" /> + <rect + width="288.49521" + height="288.49521" + rx="2.3236644" + ry="2.3236644" + x="398.72931" + y="-39.355053" + transform="matrix(0.965391,0.260807,-0.260807,0.965391,0.000000,0.000000)" + style="fill:#f3e533;fill-opacity:1.0000000;fill-rule:evenodd;stroke-width:0.79413080pt" + id="rect912" /> + <path + d="M 552.48969,32.227283 L 486.13725,53.566475 L 486.71922,53.760468 L 235.30476,53.760468 C 225.24184,53.760468 217.26344,61.738811 217.26344,71.801785 L 217.26344,398.87339 C 217.26344,408.93643 225.24178,416.91471 235.30476,416.91471 L 562.37636,416.91471 C 572.43940,416.91471 580.41768,408.93637 580.41768,398.87339 L 580.41768,71.801785 C 580.41768,66.612962 578.25806,62.108236 574.79189,58.804276 L 552.48969,32.227283 z " + style="fill:#000000;fill-opacity:0.20000000;fill-rule:evenodd;stroke:none;stroke-width:1.6789950;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + id="rect6079" /> + <rect + width="363.28418" + height="363.28418" + rx="2.9260466" + ry="2.9260466" + x="192.47523" + y="30.531385" + style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:7.7597060;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + id="rect913" /> + <rect + width="288.49512" + height="288.49512" + rx="2.3236635" + ry="2.3236635" + x="227.78207" + y="70.013809" + style="fill:#ff7f00;fill-rule:evenodd;stroke-width:0.79413080pt" + id="rect914" /> + <path + d="M 348.20848,28.541423 L 291.17463,66.563983 L 305.14211,68.115925 L 55.667554,157.15854 C 46.188236,160.53570 41.232826,170.76437 44.609974,180.24367 L 138.89040,445.04365 L 132.29465,444.84966 L 128.02682,485.39411 L 163.52746,498.58561 L 163.91546,498.58561 C 168.05181,500.44490 172.88654,501.00342 177.49494,499.36159 L 485.55528,389.56176 C 495.03452,386.18460 499.79600,375.76200 496.41886,366.28264 L 386.81301,58.416291 C 385.25785,54.051177 382.02384,50.975478 378.27734,48.910652 L 348.20848,28.541423 z " + style="fill:#000000;fill-opacity:0.20000000;fill-rule:evenodd;stroke:none;stroke-width:1.2500002;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + id="rect6078" /> + <rect + width="363.28326" + height="363.28326" + rx="2.9260383" + ry="2.9260383" + x="-41.716114" + y="142.20343" + transform="matrix(0.942003,-0.335604,0.335604,0.942003,0.000000,0.000000)" + style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:7.7596951;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + id="rect915" /> + <rect + width="288.49469" + height="288.49469" + rx="2.3236592" + ry="2.3236592" + x="-6.4090877" + y="181.68738" + transform="matrix(0.942003,-0.335604,0.335604,0.942003,0.000000,0.000000)" + style="fill:#bf0000;fill-rule:evenodd;stroke-width:0.79413080pt" + id="rect916" /> +</svg> diff --git a/src/boost/tools/quickbook/test/identifier-1_5.gold b/src/boost/tools/quickbook/test/identifier-1_5.gold new file mode 100644 index 000000000..0e3557b0a --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_5.gold @@ -0,0 +1,610 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="identifiers_in_quickbook_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Identifiers in quickbook 1.5</title> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h0"> + <phrase id="identifiers_in_quickbook_1_5.test_heading_with__code__phrase_role__identifier__code__phrase___code_"/><link + linkend="identifiers_in_quickbook_1_5.test_heading_with__code__phrase_role__identifier__code__phrase___code_">Test + heading with <code><phrase role="identifier">code</phrase></code></link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h1"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10_0"/><link linkend="identifiers_in_quickbook_1_5.identifier_10_0">Identifier + 10</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h2"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10_1"/><link linkend="identifiers_in_quickbook_1_5.identifier_10_1">Identifier + 10</link> + </bridgehead> + <table frame="all" id="identifiers_in_quickbook_1_5.identifier_10_2"> + <title>Identifier 10</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h3"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_several_headers"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_several_headers">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h4"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d0"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d0">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h5"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h6"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d1"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d1">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h7"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d2"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d2">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h8"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d3"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d3">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h9"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d5"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d5">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h10"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d6"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d6">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h11"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d7"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d7">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h12"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h13"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d8"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h14"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d9"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h15"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_0"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_0">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h16"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_1"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_1">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h17"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_2"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_2">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h18"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_3"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_3">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h19"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_4"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_4">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h20"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_5"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_5">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h21"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_6"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_6">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h22"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_7"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_7">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h23"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_8"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h24"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_9"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h25"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_10"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_10">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h26"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_11"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_11">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h27"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_12"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_12">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h28"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_13"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_13">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h29"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_14"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_14">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h30"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_16"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_16">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h31"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_17"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_17">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h32"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_18"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_18">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h33"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_19"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_19">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h34"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_20"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_20">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h35"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_21"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_21">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h36"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_22"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_22">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h37"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_23"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_23">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h38"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_24"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_24">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h39"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_25"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_25">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h40"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_26"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_26">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h41"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h42"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_27"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_27">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h43"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_28"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_28">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h44"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_29"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_29">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h45"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d4"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d4">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h46"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_15"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_15">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h47"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_30"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_30">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h48"> + <phrase id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_31"/><link + linkend="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_31">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h49"> + <phrase id="identifiers_in_quickbook_1_5.a2345678901234567890123456789012"/><link + linkend="identifiers_in_quickbook_1_5.a2345678901234567890123456789012">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h50"> + <phrase id="identifiers_in_quickbook_1_5.a0"/><link linkend="identifiers_in_quickbook_1_5.a0">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h51"> + <phrase id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcdef"/><link + linkend="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcdef">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h52"> + <phrase id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde0"/><link + linkend="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde0">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h53"> + <phrase id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde1"/><link + linkend="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde1">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h54"> + <phrase id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde2"/><link + linkend="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde2">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h55"> + <phrase id="identifiers_in_quickbook_1_5.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization"/><link + linkend="identifiers_in_quickbook_1_5.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h56"> + <phrase id="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden0"/><link + linkend="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden0">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_5.h57"> + <phrase id="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden1"/><link + linkend="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden1">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <section id="identifiers_in_quickbook_1_5.identifier_10"> + <title><link linkend="identifiers_in_quickbook_1_5.identifier_10">Identifier + 10</link></title> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h0"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_several_headers"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_several_headers">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h1"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d0"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d0">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h2"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h4"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d1"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d1">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h5"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d2"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d2">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h6"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d3"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d3">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h7"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d5"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d5">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h8"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d6"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d6">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h9"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d7"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d7">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h10"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h11"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d8"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h12"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d9"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h13"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_0"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_0">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h14"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_1"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_1">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h15"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_2"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_2">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h16"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_3"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_3">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h17"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_4"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_4">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h18"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_5"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_5">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h19"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_6"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_6">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h20"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_7"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_7">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h21"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_8"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h22"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_9"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h23"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_10"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_10">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h24"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_11"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_11">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h25"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_12"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_12">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h26"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_13"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_13">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h27"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_14"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_14">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h28"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_16"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_16">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h29"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_17"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_17">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h30"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_18"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_18">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h31"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_19"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_19">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h32"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_20"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_20">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h33"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_21"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_21">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h34"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_22"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_22">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h35"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_23"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_23">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h36"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_24"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_24">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h37"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_25"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_25">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h38"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_26"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_26">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h39"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h40"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_27"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_27">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h41"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_28"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_28">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h42"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_29"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_29">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h43"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d4"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d4">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h44"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_15"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_15">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h45"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_30"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_30">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h46"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_31"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_31">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h47"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.a2345678901234567890123456789012"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.a2345678901234567890123456789012">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h48"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.a0"/><link linkend="identifiers_in_quickbook_1_5.identifier_10.a0">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h49"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h50"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h51"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h52"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h53"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h54"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden0"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden0">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.identifier_10.h55"> + <phrase id="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden1"/><link + linkend="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden1">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <table frame="all" id="identifiers_in_quickbook_1_5.identifier_10.h3"> + <title>h3</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="identifiers_in_quickbook_1_5.identifier_10.h3_0"> + <title>h3</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="identifiers_in_quickbook_1_5.punctuation___stuff"> + <title><link linkend="identifiers_in_quickbook_1_5.punctuation___stuff">Punctuation + & stuff</link></title> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.punctuation___stuff.h0"> + <phrase id="identifiers_in_quickbook_1_5.punctuation___stuff.a___b"/><link + linkend="identifiers_in_quickbook_1_5.punctuation___stuff.a___b">A + B</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_5.punctuation___stuff.h1"> + <phrase id="identifiers_in_quickbook_1_5.punctuation___stuff.a_b0"/><link linkend="identifiers_in_quickbook_1_5.punctuation___stuff.a_b0">A + + B</link> + </bridgehead> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/identifier-1_5.gold-html b/src/boost/tools/quickbook/test/identifier-1_5.gold-html new file mode 100644 index 000000000..4628a436f --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_5.gold-html @@ -0,0 +1,421 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Identifiers in quickbook 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#identifiers_in_quickbook_1_5.identifier_10">Identifier 10</a> + </li> + <li> + <a href="#identifiers_in_quickbook_1_5.punctuation___stuff">Punctuation + & stuff</a> + </li> + </ul> + </div> + <h2 id="identifiers_in_quickbook_1_5.test_heading_with__code__phrase_role__identifier__code__phrase___code_"> + Test heading with <code><span class="identifier">code</span></code> + </h2> + <h2 id="identifiers_in_quickbook_1_5.identifier_10_0"> + Identifier 10 + </h2> + <h2 id="identifiers_in_quickbook_1_5.identifier_10_1"> + Identifier 10 + </h2> + <div id="identifiers_in_quickbook_1_5.identifier_10_2" class="table"> + <table> + <caption>Identifier 10</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_several_headers"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d0"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d1"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d2"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d3"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d5"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d6"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d7"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d8"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d9"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_0"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_1"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_2"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_3"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_4"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_5"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_6"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_7"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_8"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_9"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_10"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_11"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_12"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_13"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_14"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_16"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_17"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_18"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_19"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_20"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_21"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_22"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_23"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_24"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_25"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_26"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_27"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_28"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_29"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_d4"> + Generate a really long id and d4 + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_15"> + Generate a really long id and 15 + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_30"> + Generate a really long id and d4 + </h2> + <h2 id="identifiers_in_quickbook_1_5.generate_a_really_long_id_and_31"> + Generate a really long id and 15 + </h2> + <h2 id="identifiers_in_quickbook_1_5.a2345678901234567890123456789012"> + a2345678901234567890123456789012 + </h2> + <h2 id="identifiers_in_quickbook_1_5.a0"> + a2345678901234567890123456789012 + </h2> + <h2 id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcdef"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde0"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde1"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_5.abcdefghijklmnopqrstuvwxyzabcde2"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_5.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <h2 id="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden0"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <h2 id="identifiers_in_quickbook_1_5.markup_in_code_phrase_role_iden1"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <div id="identifiers_in_quickbook_1_5.identifier_10"> + <h3> + Identifier 10 + </h3> + <div id="identifiers_in_quickbook_1_5.identifier_10"> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_several_headers"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d0"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_lots_of_headers"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d1"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d2"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d3"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d5"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d6"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d7"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_too_many_headers"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d8"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d9"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_0"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_1"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_2"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_3"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_4"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_5"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_6"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_7"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_8"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_9"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_10"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_11"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_12"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_13"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_14"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_16"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_17"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_18"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_19"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_20"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_21"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_22"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_23"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_24"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_25"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_26"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_duplicate_it_by_having_even_more_headers"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_27"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_28"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_29"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_d4"> + Generate a really long id and d4 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_15"> + Generate a really long id and 15 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_30"> + Generate a really long id and d4 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.generate_a_really_long_id_and_31"> + Generate a really long id and 15 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.a2345678901234567890123456789012"> + a2345678901234567890123456789012 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.a0"> + a2345678901234567890123456789012 + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.markup_in__code__phrase_role__identifier__heading__phrase___code___in__emphasis_role__bold__order__emphasis__to_test_normalization"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden0"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <h3 id="identifiers_in_quickbook_1_5.identifier_10.markup_in_code_phrase_role_iden1"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <div id="identifiers_in_quickbook_1_5.identifier_10.h3" class="table"> + <table> + <caption>h3</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="identifiers_in_quickbook_1_5.identifier_10.h3_0" class="table"> + <table> + <caption>h3</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="identifiers_in_quickbook_1_5.punctuation___stuff"> + <h3> + Punctuation & stuff + </h3> + <div id="identifiers_in_quickbook_1_5.punctuation___stuff"> + <h3 id="identifiers_in_quickbook_1_5.punctuation___stuff.a___b"> + A + B + </h3> + <h3 id="identifiers_in_quickbook_1_5.punctuation___stuff.a_b0"> + A + B + </h3> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/identifier-1_5.quickbook b/src/boost/tools/quickbook/test/identifier-1_5.quickbook new file mode 100644 index 000000000..882d5df23 --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_5.quickbook @@ -0,0 +1,148 @@ +[article Identifiers in quickbook 1.5 + [quickbook 1.5] +] + +[heading Test heading with `code`] + +[heading Identifier 10] +[heading Identifier 10] +[table Identifier 10 +[[]] +] + +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having several headers] + +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] + +[heading a2345678901234567890123456789012] +[heading a2345678901234567890123456789012] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] + +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] + +[section Identifier 10] + +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having several headers] + +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] + +[heading a2345678901234567890123456789012] +[heading a2345678901234567890123456789012] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] + +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] + +[table h3 +[[]] +] + +[table h3 +[[]] +] + +[endsect] + +[section Punctuation & stuff] + +[heading A + B] +[heading A + B] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/identifier-1_6.gold b/src/boost/tools/quickbook/test/identifier-1_6.gold new file mode 100644 index 000000000..387204122 --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_6.gold @@ -0,0 +1,609 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="identifiers_in_quickbook_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Identifiers in quickbook 1.6</title> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h0"> + <phrase id="identifiers_in_quickbook_1_6.test_heading_with_code"/><link linkend="identifiers_in_quickbook_1_6.test_heading_with_code">Test + heading with <code><phrase role="identifier">code</phrase></code></link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h1"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10_0"/><link linkend="identifiers_in_quickbook_1_6.identifier_10_0">Identifier + 10</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h2"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10_1"/><link linkend="identifiers_in_quickbook_1_6.identifier_10_1">Identifier + 10</link> + </bridgehead> + <table frame="all" id="identifiers_in_quickbook_1_6.identifier_10_2"> + <title>Identifier 10</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h3"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_du"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_du">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h4"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d0"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d0">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h5"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d1"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d1">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h6"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d2"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d2">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h7"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d3"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d3">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h8"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d5"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d5">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h9"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d6"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d6">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h10"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d7"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d7">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h11"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d8"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d8">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h12"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d9"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h13"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_0"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_0">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h14"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_1"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_1">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h15"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_2"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_2">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h16"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_3"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_3">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h17"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_4"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_4">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h18"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_5"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_5">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h19"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_6"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_6">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h20"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_7"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_7">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h21"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_8"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h22"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_9"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h23"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_10"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_10">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h24"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_11"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_11">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h25"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_12"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_12">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h26"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_13"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_13">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h27"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_14"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_14">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h28"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_16"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_16">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h29"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_17"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_17">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h30"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_18"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_18">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h31"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_19"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_19">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h32"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_20"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_20">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h33"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_21"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_21">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h34"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_22"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_22">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h35"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_23"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_23">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h36"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_24"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_24">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h37"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_25"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_25">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h38"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_26"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_26">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h39"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_27"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_27">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h40"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_28"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_28">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h41"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_29"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_29">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h42"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_30"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_30">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h43"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_31"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_31">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h44"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_32"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_32">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h45"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d4"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d4">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h46"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_15"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_15">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h47"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_33"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_33">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h48"> + <phrase id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_34"/><link + linkend="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_34">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h49"> + <phrase id="identifiers_in_quickbook_1_6.a2345678901234567890123456789012"/><link + linkend="identifiers_in_quickbook_1_6.a2345678901234567890123456789012">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h50"> + <phrase id="identifiers_in_quickbook_1_6.a0"/><link linkend="identifiers_in_quickbook_1_6.a0">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h51"> + <phrase id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcdef"/><link + linkend="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcdef">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h52"> + <phrase id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde0"/><link + linkend="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde0">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h53"> + <phrase id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde1"/><link + linkend="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde1">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h54"> + <phrase id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde2"/><link + linkend="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde2">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h55"> + <phrase id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_te"/><link + linkend="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_te">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h56"> + <phrase id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t0"/><link + linkend="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t0">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect2" id="identifiers_in_quickbook_1_6.h57"> + <phrase id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t1"/><link + linkend="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t1">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <section id="identifiers_in_quickbook_1_6.identifier_10"> + <title><link linkend="identifiers_in_quickbook_1_6.identifier_10">Identifier + 10</link></title> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h0"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_du"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_du">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h1"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d0"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d0">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h2"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d1"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d1">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h4"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d2"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d2">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h5"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d3"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d3">Generate + a really long id and duplicate it by having lots of headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h6"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d5"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d5">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h7"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d6"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d6">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h8"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d7"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d7">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h9"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d8"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d8">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h10"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d9"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h11"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_0"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_0">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h12"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_1"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_1">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h13"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_2"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_2">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h14"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_3"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_3">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h15"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_4"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_4">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h16"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_5"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_5">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h17"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_6"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_6">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h18"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_7"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_7">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h19"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_8"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_8">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h20"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_9"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_9">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h21"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_10"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_10">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h22"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_11"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_11">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h23"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_12"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_12">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h24"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_13"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_13">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h25"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_14"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_14">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h26"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_16"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_16">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h27"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_17"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_17">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h28"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_18"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_18">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h29"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_19"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_19">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h30"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_20"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_20">Generate + a really long id and duplicate it by having too many headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h31"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_21"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_21">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h32"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_22"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_22">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h33"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_23"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_23">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h34"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_24"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_24">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h35"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_25"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_25">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h36"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_26"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_26">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h37"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_27"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_27">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h38"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_28"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_28">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h39"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_29"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_29">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h40"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_30"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_30">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h41"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_31"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_31">Generate + a really long id and duplicate it by having even more headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h42"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_32"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_32">Generate + a really long id and duplicate it by having several headers</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h43"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d4"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d4">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h44"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_15"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_15">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h45"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_33"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_33">Generate + a really long id and d4</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h46"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_34"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_34">Generate + a really long id and 15</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h47"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.a2345678901234567890123456789012"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.a2345678901234567890123456789012">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h48"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.a0"/><link linkend="identifiers_in_quickbook_1_6.identifier_10.a0">a2345678901234567890123456789012</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h49"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h50"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h51"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h52"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2">abcdefghijklmnopqrstuvwxyzabcdef</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h53"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_te"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_te">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h54"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t0"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t0">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.identifier_10.h55"> + <phrase id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t1"/><link + linkend="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t1">Markup + in <code><phrase role="identifier">heading</phrase></code> in <emphasis role="bold">order</emphasis> + to test normalization</link> + </bridgehead> + <table frame="all" id="identifiers_in_quickbook_1_6.identifier_10.h3"> + <title>h3</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="identifiers_in_quickbook_1_6.identifier_10.h3_0"> + <title>h3</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="identifiers_in_quickbook_1_6.punctuation_stuff"> + <title><link linkend="identifiers_in_quickbook_1_6.punctuation_stuff">Punctuation + & stuff</link></title> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.punctuation_stuff.h0"> + <phrase id="identifiers_in_quickbook_1_6.punctuation_stuff.a_b"/><link linkend="identifiers_in_quickbook_1_6.punctuation_stuff.a_b">A + + B</link> + </bridgehead> + <bridgehead renderas="sect3" id="identifiers_in_quickbook_1_6.punctuation_stuff.h1"> + <phrase id="identifiers_in_quickbook_1_6.punctuation_stuff.a_b0"/><link linkend="identifiers_in_quickbook_1_6.punctuation_stuff.a_b0">A + + B</link> + </bridgehead> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/identifier-1_6.gold-html b/src/boost/tools/quickbook/test/identifier-1_6.gold-html new file mode 100644 index 000000000..d9f67439d --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_6.gold-html @@ -0,0 +1,421 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Identifiers in quickbook 1.6 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#identifiers_in_quickbook_1_6.identifier_10">Identifier 10</a> + </li> + <li> + <a href="#identifiers_in_quickbook_1_6.punctuation_stuff">Punctuation & + stuff</a> + </li> + </ul> + </div> + <h2 id="identifiers_in_quickbook_1_6.test_heading_with_code"> + Test heading with <code><span class="identifier">code</span></code> + </h2> + <h2 id="identifiers_in_quickbook_1_6.identifier_10_0"> + Identifier 10 + </h2> + <h2 id="identifiers_in_quickbook_1_6.identifier_10_1"> + Identifier 10 + </h2> + <div id="identifiers_in_quickbook_1_6.identifier_10_2" class="table"> + <table> + <caption>Identifier 10</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_du"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d0"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d1"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d2"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d3"> + Generate a really long id and duplicate it by having lots of headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d5"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d6"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d7"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d8"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d9"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_0"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_1"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_2"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_3"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_4"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_5"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_6"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_7"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_8"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_9"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_10"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_11"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_12"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_13"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_14"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_16"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_17"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_18"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_19"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_20"> + Generate a really long id and duplicate it by having too many headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_21"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_22"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_23"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_24"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_25"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_26"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_27"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_28"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_29"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_30"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_31"> + Generate a really long id and duplicate it by having even more headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_32"> + Generate a really long id and duplicate it by having several headers + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_d4"> + Generate a really long id and d4 + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_15"> + Generate a really long id and 15 + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_33"> + Generate a really long id and d4 + </h2> + <h2 id="identifiers_in_quickbook_1_6.generate_a_really_long_id_and_34"> + Generate a really long id and 15 + </h2> + <h2 id="identifiers_in_quickbook_1_6.a2345678901234567890123456789012"> + a2345678901234567890123456789012 + </h2> + <h2 id="identifiers_in_quickbook_1_6.a0"> + a2345678901234567890123456789012 + </h2> + <h2 id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcdef"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde0"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde1"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_6.abcdefghijklmnopqrstuvwxyzabcde2"> + abcdefghijklmnopqrstuvwxyzabcdef + </h2> + <h2 id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_te"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <h2 id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t0"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <h2 id="identifiers_in_quickbook_1_6.markup_in_heading_in_order_to_t1"> + Markup in <code><span class="identifier">heading</span></code> in <span class="bold"><strong>order</strong></span> + to test normalization + </h2> + <div id="identifiers_in_quickbook_1_6.identifier_10"> + <h3> + Identifier 10 + </h3> + <div id="identifiers_in_quickbook_1_6.identifier_10"> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_du"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d0"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d1"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d2"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d3"> + Generate a really long id and duplicate it by having lots of headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d5"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d6"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d7"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d8"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d9"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_0"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_1"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_2"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_3"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_4"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_5"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_6"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_7"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_8"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_9"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_10"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_11"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_12"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_13"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_14"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_16"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_17"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_18"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_19"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_20"> + Generate a really long id and duplicate it by having too many headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_21"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_22"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_23"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_24"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_25"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_26"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_27"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_28"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_29"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_30"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_31"> + Generate a really long id and duplicate it by having even more headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_32"> + Generate a really long id and duplicate it by having several headers + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_d4"> + Generate a really long id and d4 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_15"> + Generate a really long id and 15 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_33"> + Generate a really long id and d4 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.generate_a_really_long_id_and_34"> + Generate a really long id and 15 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.a2345678901234567890123456789012"> + a2345678901234567890123456789012 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.a0"> + a2345678901234567890123456789012 + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcdef"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde0"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde1"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.abcdefghijklmnopqrstuvwxyzabcde2"> + abcdefghijklmnopqrstuvwxyzabcdef + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_te"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t0"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <h3 id="identifiers_in_quickbook_1_6.identifier_10.markup_in_heading_in_order_to_t1"> + Markup in <code><span class="identifier">heading</span></code> in <span + class="bold"><strong>order</strong></span> to test normalization + </h3> + <div id="identifiers_in_quickbook_1_6.identifier_10.h3" class="table"> + <table> + <caption>h3</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="identifiers_in_quickbook_1_6.identifier_10.h3_0" class="table"> + <table> + <caption>h3</caption> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="identifiers_in_quickbook_1_6.punctuation_stuff"> + <h3> + Punctuation & stuff + </h3> + <div id="identifiers_in_quickbook_1_6.punctuation_stuff"> + <h3 id="identifiers_in_quickbook_1_6.punctuation_stuff.a_b"> + A + B + </h3> + <h3 id="identifiers_in_quickbook_1_6.punctuation_stuff.a_b0"> + A + B + </h3> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/identifier-1_6.quickbook b/src/boost/tools/quickbook/test/identifier-1_6.quickbook new file mode 100644 index 000000000..1bbf0a1c4 --- /dev/null +++ b/src/boost/tools/quickbook/test/identifier-1_6.quickbook @@ -0,0 +1,148 @@ +[article Identifiers in quickbook 1.6 + [quickbook 1.6] +] + +[heading Test heading with `code`] + +[heading Identifier 10] +[heading Identifier 10] +[table Identifier 10 +[[]] +] + +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having several headers] + +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] + +[heading a2345678901234567890123456789012] +[heading a2345678901234567890123456789012] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] + +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] + +[section Identifier 10] + +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having lots of headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having too many headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having several headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having even more headers] +[heading Generate a really long id and duplicate it by having several headers] + +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] +[heading Generate a really long id and d4] +[heading Generate a really long id and 15] + +[heading a2345678901234567890123456789012] +[heading a2345678901234567890123456789012] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] +[heading abcdefghijklmnopqrstuvwxyzabcdef] + +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] +[heading Markup in `heading` in *order* to test normalization] + +[table h3 +[[]] +] + +[table h3 +[[]] +] + +[endsect] + +[section Punctuation & stuff] + +[heading A + B] +[heading A + B] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/image-1_5.gold b/src/boost/tools/quickbook/test/image-1_5.gold new file mode 100644 index 000000000..6364ded61 --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_5.gold @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="images_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Images 1.5</title> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>test</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject> + <textobject> + <phrase>test this</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test&this.gif"></imagedata></imageobject> + <textobject> + <phrase>test&this</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif" + height="10cm" width="10cm"></imagedata></imageobject> + <textobject> + <phrase>test</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foobie foobie foo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foo & bar</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif" + height="10cm" width="10cm"></imagedata></imageobject> + <textobject> + <phrase>Foo</phrase> + </textobject> + </inlinemediaobject> + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>test</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>test</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>comment</phrase> + </textobject> + </inlinemediaobject> + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject> + <textobject> + <phrase>test</phrase> + </textobject> + </inlinemediaobject> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/image-1_5.gold-html b/src/boost/tools/quickbook/test/image-1_5.gold-html new file mode 100644 index 000000000..23c8e6f16 --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_5.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Images 1.5 + </h3> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test this.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test&this.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img + src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img src="test.gif" + alt="[]"/></span> <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + </p> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img + src="test.gif" alt="[]"/></span> + </p> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/image-1_5.quickbook b/src/boost/tools/quickbook/test/image-1_5.quickbook new file mode 100644 index 000000000..0774fd447 --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_5.quickbook @@ -0,0 +1,19 @@ +[article Images 1.5 + [quickbook 1.5] +] + +[$test.gif] +[$test this.gif] +[$test&this.gif] +[$test.gif [width 10cm] [height 10cm]] +[$test.gif [alt Foo]] +[$test.gif [alt Foobie foobie foo]] +[$test.gif [alt Foo & bar]] +[$test.gif [alt Foo] [width 10cm] [height 10cm]] + +[$ [/comment] test.gif ] +[$ [/comment] test.gif [/comment] ] +[$ [/comment] test.gif [/comment] [alt comment] ] + +[/ This should warn about repeated attribute and then ignore it. ] +[$test.gif [width 10cm] [height 10cm] [width 20cm]] diff --git a/src/boost/tools/quickbook/test/image-1_6.gold b/src/boost/tools/quickbook/test/image-1_6.gold new file mode 100644 index 000000000..d26269ac4 --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_6.gold @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="images_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Images 1.6</title> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test&this.gif"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foobie foobie foo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>Foo & bar</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif" + height="10cm" width="10cm"></imagedata></imageobject> + <textobject> + <phrase>Foo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif" + height="10cm" width="10cm"></imagedata></imageobject> + <textobject> + <phrase>Foo[]</phrase> + </textobject> + </inlinemediaobject> + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject> + <textobject> + <phrase>comment</phrase> + </textobject> + </inlinemediaobject> + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject> + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="boost:/boost.png"></imagedata></imageobject></inlinemediaobject> + <inlinemediaobject><imageobject><imagedata fileref="boost:boost.png" height="10cm" + width="10cm"></imagedata></imageobject></inlinemediaobject> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/image-1_6.gold-html b/src/boost/tools/quickbook/test/image-1_6.gold-html new file mode 100644 index 000000000..2432d09b0 --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_6.gold-html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Images 1.6 + </h3> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test this.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test&this.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img + src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img src="test.gif" + alt="[]"/></span> <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + </p> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span + class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> <span class="inlinemediaobject"><img + src="test.gif" alt="[]"/></span> + </p> + <p> + <span class="inlinemediaobject"><img src="test.gif" alt="[]"/></span> + </p> + <p> + <span class="inlinemediaobject"><img src="http://www.boost.org/doc/libs/release/boost.png" + alt="[]"/></span> <span class="inlinemediaobject"><img src="http://www.boost.org/doc/libs/release/boost.png" + alt="[]"/></span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/image-1_6.quickbook b/src/boost/tools/quickbook/test/image-1_6.quickbook new file mode 100644 index 000000000..438c34f5d --- /dev/null +++ b/src/boost/tools/quickbook/test/image-1_6.quickbook @@ -0,0 +1,23 @@ +[article Images 1.6 + [quickbook 1.6] +] + +[$test.gif] +[$test this.gif] +[$test&this.gif] +[$test.gif [width 10cm] [height 10cm]] +[$test.gif [alt Foo]] +[$test.gif [alt Foobie foobie foo]] +[$test.gif [alt Foo & bar]] +[$test.gif [alt Foo] [width 10cm] [height 10cm]] +[$test.gif [alt Foo\[\]] [width 10cm] [height 10cm]] + +[$ [/comment] test.gif ] +[$ [/comment] test.gif [/comment] ] +[$ [/comment] test.gif [/comment] [alt comment] ] + +[/ This should warn about repeated attribute and then ignore it. ] +[$test.gif [width 10cm] [height 10cm] [width 20cm]] + +[$boost:/boost.png] +[$boost:boost.png [width 10cm] [height 10cm] [width 20cm]] diff --git a/src/boost/tools/quickbook/test/import-1_1-fail.quickbook b/src/boost/tools/quickbook/test/import-1_1-fail.quickbook new file mode 100644 index 000000000..ea60df84f --- /dev/null +++ b/src/boost/tools/quickbook/test/import-1_1-fail.quickbook @@ -0,0 +1,8 @@ +[article Expect import Fail +] + +[section Failure] + +[import this-is-not-a-file.cpp] + +[endsect] diff --git a/src/boost/tools/quickbook/test/include-1_1-fail.quickbook b/src/boost/tools/quickbook/test/include-1_1-fail.quickbook new file mode 100644 index 000000000..adb990e59 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_1-fail.quickbook @@ -0,0 +1,8 @@ +[article Expect xinclude Fail +] + +[section Failure] + +[include this-is-not-a-file.qbk] + +[endsect] diff --git a/src/boost/tools/quickbook/test/include-1_5.gold b/src/boost/tools/quickbook/test/include-1_5.gold new file mode 100644 index 000000000..f8a347e2e --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_5.gold @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Test</title> + <section id="include_test_sub_document.test"> + <title><link linkend="include_test_sub_document.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <section id="foo.test"> + <title><link linkend="foo.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + Just trying including in a conditional macro. + </para> + <section id="foo2.test"> + <title><link linkend="foo2.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + With some text around it. + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include-1_5.gold-html b/src/boost/tools/quickbook/test/include-1_5.gold-html new file mode 100644 index 000000000..5a92021b4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_5.gold-html @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_test_sub_document.test">Test</a> + </li> + <li> + <a href="#foo.test">Test</a> + </li> + <li> + <a href="#foo2.test">Test</a> + </li> + </ul> + </div> + <p> + Just trying including in a conditional macro. + </p> + <p> + With some text around it. + </p> + <div id="include_test_sub_document.test"> + <h3> + Test + </h3> + <div id="include_test_sub_document.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo.test"> + <h3> + Test + </h3> + <div id="foo.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo2.test"> + <h3> + Test + </h3> + <div id="foo2.test"> + <p> + Just testing. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include-1_5.quickbook b/src/boost/tools/quickbook/test/include-1_5.quickbook new file mode 100644 index 000000000..972012192 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_5.quickbook @@ -0,0 +1,17 @@ +[article Include Test + [quickbook 1.5] + [id include-test] +] + +[include include-inc-1_5.quickbook] +[include .\include-inc.quickbook] +[include:foo include-inc.quickbook] +[include empty-inc.quickbook] + +[def __defined__] + +[? __undefined__ [include:foo1 include-inc.quickbook] ] +[? __undefined__ [include:foo1 not_a_file.quickbook] ] +[? __defined__ + Just trying including in a conditional macro. [include:foo2 include-inc.quickbook] + With some text around it.] diff --git a/src/boost/tools/quickbook/test/include-1_6.gold b/src/boost/tools/quickbook/test/include-1_6.gold new file mode 100644 index 000000000..f5b5af358 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_6.gold @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Test</title> + <section id="include-test.test"> + <title><link linkend="include-test.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <section id="foo.test"> + <title><link linkend="foo.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + Just trying including in a conditional macro. + </para> + <section id="foo2.test"> + <title><link linkend="foo2.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + With some text around it. + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include-1_6.gold-html b/src/boost/tools/quickbook/test/include-1_6.gold-html new file mode 100644 index 000000000..f7f45f34a --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_6.gold-html @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include-test.test">Test</a> + </li> + <li> + <a href="#foo.test">Test</a> + </li> + <li> + <a href="#foo2.test">Test</a> + </li> + </ul> + </div> + <p> + Just trying including in a conditional macro. + </p> + <p> + With some text around it. + </p> + <div id="include-test.test"> + <h3> + Test + </h3> + <div id="include-test.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo.test"> + <h3> + Test + </h3> + <div id="foo.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo2.test"> + <h3> + Test + </h3> + <div id="foo2.test"> + <p> + Just testing. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include-1_6.quickbook b/src/boost/tools/quickbook/test/include-1_6.quickbook new file mode 100644 index 000000000..29a761192 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_6.quickbook @@ -0,0 +1,15 @@ +[article Include Test + [quickbook 1.6] + [id include-test] +] + +[include include-inc.quickbook] +[include:foo include-inc.quickbook] + +[def __defined__] + +[? __undefined__ [include:foo1 include-inc.quickbook] ] +[? __undefined__ [include:foo1 not-a-file.quickbook] ] +[? __defined__ + Just trying including in a conditional macro. [include:foo2 include-inc.quickbook] + With some text around it.] diff --git a/src/boost/tools/quickbook/test/include-1_7.gold b/src/boost/tools/quickbook/test/include-1_7.gold new file mode 100644 index 000000000..206509bf2 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_7.gold @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Test</title> + <section id="include-test.test"> + <title><link linkend="include-test.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <section id="foo.test"> + <title><link linkend="foo.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <section id="foo0.test"> + <title><link linkend="foo0.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + Just trying including in a conditional macro. + </para> + <section id="foo2.test"> + <title><link linkend="foo2.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <para> + With some text around it. + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include-1_7.gold-html b/src/boost/tools/quickbook/test/include-1_7.gold-html new file mode 100644 index 000000000..b92d56298 --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_7.gold-html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include-test.test">Test</a> + </li> + <li> + <a href="#foo.test">Test</a> + </li> + <li> + <a href="#foo0.test">Test</a> + </li> + <li> + <a href="#foo2.test">Test</a> + </li> + </ul> + </div> + <p> + Just trying including in a conditional macro. + </p> + <p> + With some text around it. + </p> + <div id="include-test.test"> + <h3> + Test + </h3> + <div id="include-test.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo.test"> + <h3> + Test + </h3> + <div id="foo.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo0.test"> + <h3> + Test + </h3> + <div id="foo0.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo2.test"> + <h3> + Test + </h3> + <div id="foo2.test"> + <p> + Just testing. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include-1_7.quickbook b/src/boost/tools/quickbook/test/include-1_7.quickbook new file mode 100644 index 000000000..481e4130a --- /dev/null +++ b/src/boost/tools/quickbook/test/include-1_7.quickbook @@ -0,0 +1,18 @@ +[article Include Test + [quickbook 1.7] + [id include-test] +] + +[include include-inc.quickbook] +[include:foo include-inc.quickbook] + +[template id2[] include-inc] +[include:foo0 [id2].quickbook] + +[def __defined__] + +[? __undefined__ [include:foo1 include-inc.quickbook] ] +[? __undefined__ [include:foo1 not-a-file.quickbook] ] +[? __defined__ + Just trying including in a conditional macro. [include:foo2 include-inc.quickbook] + With some text around it.] diff --git a/src/boost/tools/quickbook/test/include-inc-1_5.quickbook b/src/boost/tools/quickbook/test/include-inc-1_5.quickbook new file mode 100644 index 000000000..1dcbff9ff --- /dev/null +++ b/src/boost/tools/quickbook/test/include-inc-1_5.quickbook @@ -0,0 +1,6 @@ +[article Include Test Sub Document + [quickbook 1.5] + [id include-sub] +] + +[/ Empty. Shouldn't really need this comment.] diff --git a/src/boost/tools/quickbook/test/include-inc.quickbook b/src/boost/tools/quickbook/test/include-inc.quickbook new file mode 100644 index 000000000..1fa61608b --- /dev/null +++ b/src/boost/tools/quickbook/test/include-inc.quickbook @@ -0,0 +1,9 @@ +[/ I'm trying not to break existing behaviour even when buggy. + In this case, this section will get an id using the title from + the previous 'include'.] + +[section:test Test] + +Just testing. + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/Jamfile.v2 b/src/boost/tools/quickbook/test/include/Jamfile.v2 new file mode 100644 index 000000000..a40bf5543 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/Jamfile.v2 @@ -0,0 +1,48 @@ +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test/includes + : requirements + <toolset>msvc:<debug-symbols>off + ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test import-basic-1.6 ] + [ quickbook-test filename ] + [ quickbook-test filename-1_7 ] + [ quickbook-test filename-path : : : <quickbook-test-include>sub ] + [ quickbook-test filename_path-1_7 : : : <quickbook-test-include>sub ] + [ quickbook-test doc-title1-1.5 ] + [ quickbook-test doc-title1a-1.5 ] + [ quickbook-test section ] + [ quickbook-test section-unclosed ] + [ quickbook-test templates-1.5 ] + [ quickbook-test templates-1.6 ] + [ quickbook-test macros-1.5 ] + [ quickbook-test macros-1.6 ] + [ quickbook-test code-import ] + [ quickbook-test code-include ] + [ quickbook-test include-id-1.5 ] + [ quickbook-test include-id-1.6 ] + [ quickbook-test include_id_unbalanced-1_6 ] + [ quickbook-error-test section-fail1 ] + [ quickbook-error-test section-fail2 ] + [ quickbook-test in_section-1_5 ] + [ quickbook-test in_section-1_6 ] + [ quickbook-test compatibility-1_1 ] + [ quickbook-test compatibility-1_5 ] + [ quickbook-test compatibility-1_6 ] + [ quickbook-test source_mode-1_5 ] + [ quickbook-test source_mode-1_6 ] + [ quickbook-test nested_compatibility-1_5 ] + [ quickbook-test nested_compatibility-1_6 ] + [ quickbook-test template_include-1_7 ] + [ quickbook-test glob-1_7 ] + ; diff --git a/src/boost/tools/quickbook/test/include/code-import.gold b/src/boost/tools/quickbook/test/include/code-import.gold new file mode 100644 index 000000000..12089ece2 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-import.gold @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="import" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Import</title> + <para> + This is the <emphasis role="bold"><emphasis>foo</emphasis></emphasis> function. + </para> + <para> + This description can have paragraphs... + </para> + <itemizedlist> + <listitem> + <simpara> + lists + </simpara> + </listitem> + <listitem> + <simpara> + etc. + </simpara> + </listitem> + </itemizedlist> + <para> + And any quickbook block markup. + </para> + <para> +<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// return 'em, foo man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> + This is the Python <emphasis role="bold"><emphasis>foo</emphasis></emphasis> + function. + </para> + <para> + This description can have paragraphs... + </para> + <itemizedlist> + <listitem> + <simpara> + lists + </simpara> + </listitem> + <listitem> + <simpara> + etc. + </simpara> + </listitem> + </itemizedlist> + <para> + And any quickbook block markup. + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase> + <phrase role="comment"># return 'em, foo man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase> +</programlisting> + </para> + <para> + This is the C <emphasis role="bold"><emphasis>foo</emphasis></emphasis> function. + </para> + <para> + This description can have paragraphs... + </para> + <itemizedlist> + <listitem> + <simpara> + lists + </simpara> + </listitem> + <listitem> + <simpara> + etc. + </simpara> + </listitem> + </itemizedlist> + <para> + And any quickbook block markup. + </para> + <para> +<programlisting><phrase role="keyword">char</phrase><phrase role="special">*</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// return 'em, foo man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">class</phrase> <phrase role="identifier">x</phrase> +<phrase role="special">{</phrase> +<phrase role="keyword">public</phrase><phrase role="special">:</phrase> + + <co id="import.c0" linkends="import.c1" /><phrase role="identifier">x</phrase><phrase role="special">()</phrase> <phrase role="special">:</phrase> <phrase role="identifier">n</phrase><phrase role="special">(</phrase><phrase role="number">0</phrase><phrase role="special">)</phrase> + <phrase role="special">{</phrase> + <phrase role="special">}</phrase> + + <co id="import.c2" linkends="import.c3" /><phrase role="special">~</phrase><phrase role="identifier">x</phrase><phrase role="special">()</phrase> + <phrase role="special">{</phrase> + <phrase role="special">}</phrase> + + <co id="import.c4" linkends="import.c5" /><phrase role="keyword">int</phrase> <phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase> + <phrase role="special">{</phrase> + <phrase role="keyword">return</phrase> <phrase role="identifier">n</phrase><phrase role="special">;</phrase> + <phrase role="special">}</phrase> + + <co id="import.c6" linkends="import.c7" /><phrase role="keyword">void</phrase> <phrase role="identifier">set</phrase><phrase role="special">(</phrase><phrase role="keyword">int</phrase> <phrase role="identifier">n_</phrase><phrase role="special">)</phrase> + <phrase role="special">{</phrase> + <phrase role="identifier">n</phrase> <phrase role="special">=</phrase> <phrase role="identifier">n_</phrase><phrase role="special">;</phrase> + <phrase role="special">}</phrase> +<phrase role="special">};</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="import.c0" id="import.c1"> + <para> + Constructor + </para> + </callout> + <callout arearefs="import.c2" id="import.c3"> + <para> + Destructor + </para> + </callout> + <callout arearefs="import.c4" id="import.c5"> + <para> + Get the <code><phrase role="identifier">n</phrase></code> member variable + </para> + </callout> + <callout arearefs="import.c6" id="import.c7"> + <para> + Set the <code><phrase role="identifier">n</phrase></code> member variable + </para> + </callout> + </calloutlist> +</article> diff --git a/src/boost/tools/quickbook/test/include/code-import.gold-html b/src/boost/tools/quickbook/test/include/code-import.gold-html new file mode 100644 index 000000000..1fbe10557 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-import.gold-html @@ -0,0 +1,148 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Import + </h3> + <p> + This is the <span class="bold"><strong><span class="emphasis"><em>foo</em></span></strong></span> + function. + </p> + <p> + This description can have paragraphs... + </p> + <ul> + <li> + <div> + lists + </div> + </li> + <li> + <div> + etc. + </div> + </li> + </ul> + <p> + And any quickbook block markup. + </p> + <p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">foo</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// return 'em, foo man!</span> + <span class="keyword">return</span> <span class="string">"foo"</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> + This is the Python <span class="bold"><strong><span class="emphasis"><em>foo</em></span></strong></span> + function. + </p> + <p> + This description can have paragraphs... + </p> + <ul> + <li> + <div> + lists + </div> + </li> + <li> + <div> + etc. + </div> + </li> + </ul> + <p> + And any quickbook block markup. + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">():</span> + <span class="comment"># return 'em, foo man!</span> + <span class="keyword">return</span> <span class="string">"foo"</span> +</pre> + </p> + <p> + This is the C <span class="bold"><strong><span class="emphasis"><em>foo</em></span></strong></span> + function. + </p> + <p> + This description can have paragraphs... + </p> + <ul> + <li> + <div> + lists + </div> + </li> + <li> + <div> + etc. + </div> + </li> + </ul> + <p> + And any quickbook block markup. + </p> + <p> +<pre class="programlisting"><span class="keyword">char</span><span class="special">*</span> <span class="identifier">foo</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// return 'em, foo man!</span> + <span class="keyword">return</span> <span class="string">"foo"</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">x</span> +<span class="special">{</span> +<span class="keyword">public</span><span class="special">:</span> + + <a href="#import.c1">(1)</a><span class="identifier">x</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">n</span><span class="special">(</span><span class="number">0</span><span class="special">)</span> + <span class="special">{</span> + <span class="special">}</span> + + <a href="#import.c3">(2)</a><span class="special">~</span><span class="identifier">x</span><span class="special">()</span> + <span class="special">{</span> + <span class="special">}</span> + + <a href="#import.c5">(3)</a><span class="keyword">int</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span> + <span class="special">{</span> + <span class="keyword">return</span> <span class="identifier">n</span><span class="special">;</span> + <span class="special">}</span> + + <a href="#import.c7">(4)</a><span class="keyword">void</span> <span class="identifier">set</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n_</span><span class="special">)</span> + <span class="special">{</span> + <span class="identifier">n</span> <span class="special">=</span> <span class="identifier">n_</span><span class="special">;</span> + <span class="special">}</span> +<span class="special">};</span> +</pre> + </p> + <div> + <div id="import.c1"> + <a href="#import.c0">(1)</a> + <p> + Constructor + </p> + </div> + <div id="import.c3"> + <a href="#import.c2">(2)</a> + <p> + Destructor + </p> + </div> + <div id="import.c5"> + <a href="#import.c4">(3)</a> + <p> + Get the <code><span class="identifier">n</span></code> member variable + </p> + </div> + <div id="import.c7"> + <a href="#import.c6">(4)</a> + <p> + Set the <code><span class="identifier">n</span></code> member variable + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/code-import.quickbook b/src/boost/tools/quickbook/test/include/code-import.quickbook new file mode 100644 index 000000000..70faf0776 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-import.quickbook @@ -0,0 +1,13 @@ +[article Import] + +[import ../stub.c] +[import ../stub.py] +[import ../stub.cpp] + +[foo] + +[foo_py] + +[foo_c] + +[class_]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/code-include.gold b/src/boost/tools/quickbook/test/include/code-include.gold new file mode 100644 index 000000000..dfa697fd8 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-include.gold @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include</title> + <para> + This should appear when <literal>stub.c</literal> is included. + </para> + <para> + This is the C <emphasis role="bold"><emphasis>foo</emphasis></emphasis> function. + </para> + <para> + This description can have paragraphs... + </para> + <itemizedlist> + <listitem> + <simpara> + lists + </simpara> + </listitem> + <listitem> + <simpara> + etc. + </simpara> + </listitem> + </itemizedlist> + <para> + And any quickbook block markup. + </para> +<programlisting><phrase role="keyword">char</phrase><phrase role="special">*</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// return 'em, foo man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + This should appear when <literal>stub.py</literal> is included. + </para> + <para> + This should appear when <literal>stub.cpp</literal> is included. + </para> + <para> + [foo] + </para> + <para> + [foo_py] + </para> + <para> + [foo_c] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/code-include.gold-html b/src/boost/tools/quickbook/test/include/code-include.gold-html new file mode 100644 index 000000000..100e34a1b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-include.gold-html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include + </h3> + <p> + This should appear when <tt>stub.c</tt> is included. + </p> + <p> + This is the C <span class="bold"><strong><span class="emphasis"><em>foo</em></span></strong></span> + function. + </p> + <p> + This description can have paragraphs... + </p> + <ul> + <li> + <div> + lists + </div> + </li> + <li> + <div> + etc. + </div> + </li> + </ul> + <p> + And any quickbook block markup. + </p> +<pre class="programlisting"><span class="keyword">char</span><span class="special">*</span> <span class="identifier">foo</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// return 'em, foo man!</span> + <span class="keyword">return</span> <span class="string">"foo"</span><span class="special">;</span> +<span class="special">}</span> +</pre> + <p> + This should appear when <tt>stub.py</tt> is included. + </p> + <p> + This should appear when <tt>stub.cpp</tt> is included. + </p> + <p> + [foo] + </p> + <p> + [foo_py] + </p> + <p> + [foo_c] + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/code-include.quickbook b/src/boost/tools/quickbook/test/include/code-include.quickbook new file mode 100644 index 000000000..8a47538f1 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/code-include.quickbook @@ -0,0 +1,16 @@ +[article Include +[quickbook 1.6] +] + +[include ../stub.c] +[include ../stub.py] +[include ../stub.cpp] + +[/ These shouldn't expand ] + +[foo] + +[foo_py] + +[foo_c] + diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_1.gold b/src/boost/tools/quickbook/test/include/compatibility-1_1.gold new file mode 100644 index 000000000..961d6aa51 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_1.gold @@ -0,0 +1,362 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="compatibility" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Test Compatibility Mode</title> + <section id="compatibility.collision"> + <title>Outer</title> + <section id="test_compatibility_mode.inner"> + <title>Inner</title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h0"> + <phrase id="test_compatibility_mode.collision.inner.header"/><link linkend="test_compatibility_mode.collision.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="inner.heading1"> + Heading1 + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h1"> + <phrase id="test_compatibility_mode.collision.inner.x1"/><link linkend="test_compatibility_mode.collision.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h2"> + <phrase id="test_compatibility_mode.collision.inner.x2"/><link linkend="test_compatibility_mode.collision.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.t0"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.x"> + <title>Inner with id</title> + </section> + </section> + <section id="compatibility.collision0"> + <title>Include compatibility 1.1</title> + <section id="test_compatibility_mode.inner0"> + <title>Inner</title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h3"> + <phrase id="test_compatibility_mode.collision.inner.header0"/><link linkend="test_compatibility_mode.collision.inner.header0">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="inner.heading1_0"> + Heading1 + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h4"> + <phrase id="test_compatibility_mode.collision.inner.x1_0"/><link linkend="test_compatibility_mode.collision.inner.x1_0">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h5"> + <phrase id="test_compatibility_mode.collision.inner.x2_0"/><link linkend="test_compatibility_mode.collision.inner.x2_0">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid0"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.t1"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x0"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.x0"> + <title>Inner with id</title> + </section> + </section> + <section id="compatibility.collision1"> + <title>Include compatibility 1.5</title> + <section id="test_compatibility_mode.collision.inner"> + <title><link linkend="test_compatibility_mode.collision.inner">Inner</link></title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h6"> + <phrase id="test_compatibility_mode.collision.inner.header1"/><link linkend="test_compatibility_mode.collision.inner.header1">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h7"> + <phrase id="test_compatibility_mode.collision.inner.heading1"/><link linkend="test_compatibility_mode.collision.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h8"> + <phrase id="test_compatibility_mode.collision.inner.x1_1"/><link linkend="test_compatibility_mode.collision.inner.x1_1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h9"> + <phrase id="test_compatibility_mode.collision.inner.x2_1"/><link linkend="test_compatibility_mode.collision.inner.x2_1">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid1"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x3"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.collision.x"> + <title><link linkend="test_compatibility_mode.collision.x">Inner with id</link></title> + </section> + </section> + <section id="compatibility.collision2"> + <title>Include compatibility 1.6</title> + <section id="compatibility.collision.inner"> + <title><link linkend="compatibility.collision.inner">Inner</link></title> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h0"> + <phrase id="compatibility.collision.inner.header"/><link linkend="compatibility.collision.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h1"> + <phrase id="compatibility.collision.inner.heading1"/><link linkend="compatibility.collision.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h2"> + <phrase id="compatibility.collision.inner.x1"/><link linkend="compatibility.collision.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h3"> + <phrase id="compatibility.collision.inner.x2"/><link linkend="compatibility.collision.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision.x"> + <title><link linkend="compatibility.collision.x">Inner with id</link></title> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_1.gold-html b/src/boost/tools/quickbook/test/include/compatibility-1_1.gold-html new file mode 100644 index 000000000..6a811781a --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_1.gold-html @@ -0,0 +1,424 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test Compatibility Mode + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#compatibility.collision">Outer</a> + </li> + <li> + <a href="#compatibility.collision0">Include compatibility 1.1</a> + </li> + <li> + <a href="#compatibility.collision1">Include compatibility 1.5</a> + </li> + <li> + <a href="#compatibility.collision2">Include compatibility 1.6</a> + </li> + </ul> + </div> + <div id="compatibility.collision"> + <h3> + Outer + </h3> + <div id="compatibility.collision"> + </div> + <div id="test_compatibility_mode.inner"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.inner"> + <h4 id="test_compatibility_mode.collision.inner.header"> + Header + </h4> + <h1 id="inner.heading1"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.t0" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.x"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.x"> + </div> + </div> + </div> + <div id="compatibility.collision0"> + <h3> + Include compatibility 1.1 + </h3> + <div id="compatibility.collision0"> + </div> + <div id="test_compatibility_mode.inner0"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.inner0"> + <h4 id="test_compatibility_mode.collision.inner.header0"> + Header + </h4> + <h1 id="inner.heading1_0"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1_0"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2_0"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid0" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.t1" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x0" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.x0"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.x0"> + </div> + </div> + </div> + <div id="compatibility.collision1"> + <h3> + Include compatibility 1.5 + </h3> + <div id="compatibility.collision1"> + </div> + <div id="test_compatibility_mode.collision.inner"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.collision.inner"> + <h4 id="test_compatibility_mode.collision.inner.header1"> + Header + </h4> + <h1 id="test_compatibility_mode.collision.inner.heading1"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1_1"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2_1"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid1" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x3" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.collision.x"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.collision.x"> + </div> + </div> + </div> + <div id="compatibility.collision2"> + <h3> + Include compatibility 1.6 + </h3> + <div id="compatibility.collision2"> + </div> + <div id="compatibility.collision.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision.inner"> + <h4 id="compatibility.collision.inner.header"> + Header + </h4> + <h1 id="compatibility.collision.inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision.x"> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_1.quickbook b/src/boost/tools/quickbook/test/include/compatibility-1_1.quickbook new file mode 100644 index 000000000..afdd39dc4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_1.quickbook @@ -0,0 +1,18 @@ +[article Test Compatibility Mode +[quickbook 1.6] +[compatibility-mode 1.1] +[id compatibility] +] + +[section:collision Outer] +[include compatibility-inc.quickbook] +[endsect] +[section:collision Include compatibility 1.1] +[include compatibility-inc_1_1.quickbook] +[endsect] +[section:collision Include compatibility 1.5] +[include compatibility-inc_1_5.quickbook] +[endsect] +[section:collision Include compatibility 1.6] +[include compatibility-inc_1_6.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_5.gold b/src/boost/tools/quickbook/test/include/compatibility-1_5.gold new file mode 100644 index 000000000..79245caf1 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_5.gold @@ -0,0 +1,362 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="compatibility" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Test Compatibility Mode</title> + <section id="compatibility.collision"> + <title><link linkend="compatibility.collision">Outer</link></title> + <section id="test_compatibility_mode.collision.inner"> + <title><link linkend="test_compatibility_mode.collision.inner">Inner</link></title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h0"> + <phrase id="test_compatibility_mode.collision.inner.header"/><link linkend="test_compatibility_mode.collision.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h1"> + <phrase id="test_compatibility_mode.collision.inner.heading1"/><link linkend="test_compatibility_mode.collision.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h2"> + <phrase id="test_compatibility_mode.collision.inner.x1"/><link linkend="test_compatibility_mode.collision.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h3"> + <phrase id="test_compatibility_mode.collision.inner.x2"/><link linkend="test_compatibility_mode.collision.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.collision.x"> + <title><link linkend="test_compatibility_mode.collision.x">Inner with id</link></title> + </section> + </section> + <section id="compatibility.collision0"> + <title><link linkend="compatibility.collision0">Include compatibility 1.1</link></title> + <section id="test_compatibility_mode.inner"> + <title>Inner</title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h4"> + <phrase id="test_compatibility_mode.collision.inner.header0"/><link linkend="test_compatibility_mode.collision.inner.header0">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="inner.heading1"> + Heading1 + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h5"> + <phrase id="test_compatibility_mode.collision.inner.x1_0"/><link linkend="test_compatibility_mode.collision.inner.x1_0">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h6"> + <phrase id="test_compatibility_mode.collision.inner.x2_0"/><link linkend="test_compatibility_mode.collision.inner.x2_0">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid0"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.t0"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x0"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.x"> + <title>Inner with id</title> + </section> + </section> + <section id="compatibility.collision1"> + <title><link linkend="compatibility.collision1">Include compatibility 1.5</link></title> + <section id="test_compatibility_mode.collision.inner0"> + <title><link linkend="test_compatibility_mode.collision.inner0">Inner</link></title> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h7"> + <phrase id="test_compatibility_mode.collision.inner.header1"/><link linkend="test_compatibility_mode.collision.inner.header1">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h8"> + <phrase id="test_compatibility_mode.collision.inner.heading1_0"/><link linkend="test_compatibility_mode.collision.inner.heading1_0">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="test_compatibility_mode.collision.inner.h9"> + <phrase id="test_compatibility_mode.collision.inner.x1_1"/><link linkend="test_compatibility_mode.collision.inner.x1_1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="test_compatibility_mode.collision.inner.h10"> + <phrase id="test_compatibility_mode.collision.inner.x2_1"/><link linkend="test_compatibility_mode.collision.inner.x2_1">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="test_compatibility_mode.collision.inner.withid1"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="test_compatibility_mode.collision.inner.with_title0"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="test_compatibility_mode.collision.inner.x3"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="test_compatibility_mode.collision.x0"> + <title><link linkend="test_compatibility_mode.collision.x0">Inner with id</link></title> + </section> + </section> + <section id="compatibility.collision2"> + <title><link linkend="compatibility.collision2">Include compatibility 1.6</link></title> + <section id="compatibility.collision.inner"> + <title><link linkend="compatibility.collision.inner">Inner</link></title> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h0"> + <phrase id="compatibility.collision.inner.header"/><link linkend="compatibility.collision.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h1"> + <phrase id="compatibility.collision.inner.heading1"/><link linkend="compatibility.collision.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h2"> + <phrase id="compatibility.collision.inner.x1"/><link linkend="compatibility.collision.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h3"> + <phrase id="compatibility.collision.inner.x2"/><link linkend="compatibility.collision.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision.x"> + <title><link linkend="compatibility.collision.x">Inner with id</link></title> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_5.gold-html b/src/boost/tools/quickbook/test/include/compatibility-1_5.gold-html new file mode 100644 index 000000000..945b00f0b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_5.gold-html @@ -0,0 +1,424 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test Compatibility Mode + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#compatibility.collision">Outer</a> + </li> + <li> + <a href="#compatibility.collision0">Include compatibility 1.1</a> + </li> + <li> + <a href="#compatibility.collision1">Include compatibility 1.5</a> + </li> + <li> + <a href="#compatibility.collision2">Include compatibility 1.6</a> + </li> + </ul> + </div> + <div id="compatibility.collision"> + <h3> + Outer + </h3> + <div id="compatibility.collision"> + </div> + <div id="test_compatibility_mode.collision.inner"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.collision.inner"> + <h4 id="test_compatibility_mode.collision.inner.header"> + Header + </h4> + <h1 id="test_compatibility_mode.collision.inner.heading1"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.collision.x"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.collision.x"> + </div> + </div> + </div> + <div id="compatibility.collision0"> + <h3> + Include compatibility 1.1 + </h3> + <div id="compatibility.collision0"> + </div> + <div id="test_compatibility_mode.inner"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.inner"> + <h4 id="test_compatibility_mode.collision.inner.header0"> + Header + </h4> + <h1 id="inner.heading1"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1_0"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2_0"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid0" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.t0" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x0" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.x"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.x"> + </div> + </div> + </div> + <div id="compatibility.collision1"> + <h3> + Include compatibility 1.5 + </h3> + <div id="compatibility.collision1"> + </div> + <div id="test_compatibility_mode.collision.inner0"> + <h3> + Inner + </h3> + <div id="test_compatibility_mode.collision.inner0"> + <h4 id="test_compatibility_mode.collision.inner.header1"> + Header + </h4> + <h1 id="test_compatibility_mode.collision.inner.heading1_0"> + Heading1 + </h1> + <h4 id="test_compatibility_mode.collision.inner.x1_1"> + Header with id + </h4> + <h1 id="test_compatibility_mode.collision.inner.x2_1"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.withid1" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.with_title0" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="test_compatibility_mode.collision.inner.x3" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="test_compatibility_mode.collision.x0"> + <h3> + Inner with id + </h3> + <div id="test_compatibility_mode.collision.x0"> + </div> + </div> + </div> + <div id="compatibility.collision2"> + <h3> + Include compatibility 1.6 + </h3> + <div id="compatibility.collision2"> + </div> + <div id="compatibility.collision.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision.inner"> + <h4 id="compatibility.collision.inner.header"> + Header + </h4> + <h1 id="compatibility.collision.inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision.x"> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_5.quickbook b/src/boost/tools/quickbook/test/include/compatibility-1_5.quickbook new file mode 100644 index 000000000..9593df720 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_5.quickbook @@ -0,0 +1,18 @@ +[article Test Compatibility Mode +[compatibility-mode 1.5] +[id compatibility] +[quickbook 1.6] +] + +[section:collision Outer] +[include compatibility-inc.quickbook] +[endsect] +[section:collision Include compatibility 1.1] +[include compatibility-inc_1_1.quickbook] +[endsect] +[section:collision Include compatibility 1.5] +[include compatibility-inc_1_5.quickbook] +[endsect] +[section:collision Include compatibility 1.6] +[include compatibility-inc_1_6.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_6.gold b/src/boost/tools/quickbook/test/include/compatibility-1_6.gold new file mode 100644 index 000000000..b3e51277f --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_6.gold @@ -0,0 +1,362 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="compatibility" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Test Compatibility Mode</title> + <section id="compatibility.collision"> + <title><link linkend="compatibility.collision">Outer</link></title> + <section id="compatibility.collision.inner"> + <title><link linkend="compatibility.collision.inner">Inner</link></title> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h0"> + <phrase id="compatibility.collision.inner.header"/><link linkend="compatibility.collision.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h1"> + <phrase id="compatibility.collision.inner.heading1"/><link linkend="compatibility.collision.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision.inner.h2"> + <phrase id="compatibility.collision.inner.x1"/><link linkend="compatibility.collision.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision.inner.h3"> + <phrase id="compatibility.collision.inner.x2"/><link linkend="compatibility.collision.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision.x"> + <title><link linkend="compatibility.collision.x">Inner with id</link></title> + </section> + </section> + <section id="compatibility.collision0"> + <title><link linkend="compatibility.collision0">Include compatibility 1.1</link></title> + <section id="compatibility.collision0.inner"> + <title>Inner</title> + <bridgehead renderas="sect4" id="compatibility.collision0.inner.h0"> + <phrase id="compatibility.collision0.inner.header"/><link linkend="compatibility.collision0.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="inner.heading1"> + Heading1 + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision0.inner.h1"> + <phrase id="compatibility.collision0.inner.x1"/><link linkend="compatibility.collision0.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision0.inner.h2"> + <phrase id="compatibility.collision0.inner.x2"/><link linkend="compatibility.collision0.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision0.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision0.inner.t0"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision0.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision0.x"> + <title>Inner with id</title> + </section> + </section> + <section id="compatibility.collision1"> + <title><link linkend="compatibility.collision1">Include compatibility 1.5</link></title> + <section id="compatibility.collision1.inner"> + <title><link linkend="compatibility.collision1.inner">Inner</link></title> + <bridgehead renderas="sect4" id="compatibility.collision1.inner.h0"> + <phrase id="compatibility.collision1.inner.header"/><link linkend="compatibility.collision1.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision1.inner.h1"> + <phrase id="compatibility.collision1.inner.heading1"/><link linkend="compatibility.collision1.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision1.inner.h2"> + <phrase id="compatibility.collision1.inner.x1"/><link linkend="compatibility.collision1.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision1.inner.h3"> + <phrase id="compatibility.collision1.inner.x2"/><link linkend="compatibility.collision1.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision1.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision1.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision1.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision1.x"> + <title><link linkend="compatibility.collision1.x">Inner with id</link></title> + </section> + </section> + <section id="compatibility.collision2"> + <title><link linkend="compatibility.collision2">Include compatibility 1.6</link></title> + <section id="compatibility.collision2.inner"> + <title><link linkend="compatibility.collision2.inner">Inner</link></title> + <bridgehead renderas="sect4" id="compatibility.collision2.inner.h0"> + <phrase id="compatibility.collision2.inner.header"/><link linkend="compatibility.collision2.inner.header">Header</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision2.inner.h1"> + <phrase id="compatibility.collision2.inner.heading1"/><link linkend="compatibility.collision2.inner.heading1">Heading1</link> + </bridgehead> + <bridgehead renderas="sect4" id="compatibility.collision2.inner.h2"> + <phrase id="compatibility.collision2.inner.x1"/><link linkend="compatibility.collision2.inner.x1">Header + with id</link> + </bridgehead> + <bridgehead renderas="sect1" id="compatibility.collision2.inner.h3"> + <phrase id="compatibility.collision2.inner.x2"/><link linkend="compatibility.collision2.inner.x2">Heading1 + with id</link> + </bridgehead> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="compatibility.collision2.inner.withid"> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="compatibility.collision2.inner.with_title"> + <title>With Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="compatibility.collision2.inner.x"> + <title>Id and Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="compatibility.collision2.x"> + <title><link linkend="compatibility.collision2.x">Inner with id</link></title> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_6.gold-html b/src/boost/tools/quickbook/test/include/compatibility-1_6.gold-html new file mode 100644 index 000000000..eff72c000 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_6.gold-html @@ -0,0 +1,424 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test Compatibility Mode + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#compatibility.collision">Outer</a> + </li> + <li> + <a href="#compatibility.collision0">Include compatibility 1.1</a> + </li> + <li> + <a href="#compatibility.collision1">Include compatibility 1.5</a> + </li> + <li> + <a href="#compatibility.collision2">Include compatibility 1.6</a> + </li> + </ul> + </div> + <div id="compatibility.collision"> + <h3> + Outer + </h3> + <div id="compatibility.collision"> + </div> + <div id="compatibility.collision.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision.inner"> + <h4 id="compatibility.collision.inner.header"> + Header + </h4> + <h1 id="compatibility.collision.inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision.x"> + </div> + </div> + </div> + <div id="compatibility.collision0"> + <h3> + Include compatibility 1.1 + </h3> + <div id="compatibility.collision0"> + </div> + <div id="compatibility.collision0.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision0.inner"> + <h4 id="compatibility.collision0.inner.header"> + Header + </h4> + <h1 id="inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision0.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision0.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision0.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision0.inner.t0" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision0.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision0.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision0.x"> + </div> + </div> + </div> + <div id="compatibility.collision1"> + <h3> + Include compatibility 1.5 + </h3> + <div id="compatibility.collision1"> + </div> + <div id="compatibility.collision1.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision1.inner"> + <h4 id="compatibility.collision1.inner.header"> + Header + </h4> + <h1 id="compatibility.collision1.inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision1.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision1.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision1.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision1.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision1.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision1.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision1.x"> + </div> + </div> + </div> + <div id="compatibility.collision2"> + <h3> + Include compatibility 1.6 + </h3> + <div id="compatibility.collision2"> + </div> + <div id="compatibility.collision2.inner"> + <h3> + Inner + </h3> + <div id="compatibility.collision2.inner"> + <h4 id="compatibility.collision2.inner.header"> + Header + </h4> + <h1 id="compatibility.collision2.inner.heading1"> + Heading1 + </h1> + <h4 id="compatibility.collision2.inner.x1"> + Header with id + </h4> + <h1 id="compatibility.collision2.inner.x2"> + Heading1 with id + </h1> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision2.inner.withid" class="informaltable"> + <table> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision2.inner.with_title" class="table"> + <table> + <caption>With Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + <div id="compatibility.collision2.inner.x" class="table"> + <table> + <caption>Id and Title</caption> + <thead> + <tr> + <th> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="compatibility.collision2.x"> + <h3> + Inner with id + </h3> + <div id="compatibility.collision2.x"> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/compatibility-1_6.quickbook b/src/boost/tools/quickbook/test/include/compatibility-1_6.quickbook new file mode 100644 index 000000000..46880a8c3 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-1_6.quickbook @@ -0,0 +1,17 @@ +[article Test Compatibility Mode +[id compatibility] +[quickbook 1.6] +] + +[section:collision Outer] +[include compatibility-inc.quickbook] +[endsect] +[section:collision Include compatibility 1.1] +[include compatibility-inc_1_1.quickbook] +[endsect] +[section:collision Include compatibility 1.5] +[include compatibility-inc_1_5.quickbook] +[endsect] +[section:collision Include compatibility 1.6] +[include compatibility-inc_1_6.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-inc.quickbook b/src/boost/tools/quickbook/test/include/compatibility-inc.quickbook new file mode 100644 index 000000000..66fbb54ee --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-inc.quickbook @@ -0,0 +1,31 @@ +[section Inner] + +[heading Header] + +[h1 Heading1] + +[heading:x1 Header with id] + +[h1:x2 Heading1 with id] + +[table +[[]][[]] +] + +[table:withid +[[]][[]] +] + +[table With Title +[[]][[]] +] + +[table:x Id and Title +[[]][[]] +] + + +[endsect] + +[section:x Inner with id] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-inc_1_1.quickbook b/src/boost/tools/quickbook/test/include/compatibility-inc_1_1.quickbook new file mode 100644 index 000000000..89b4d6554 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-inc_1_1.quickbook @@ -0,0 +1,33 @@ +[compatibility-mode 1.1] + +[section Inner] + +[heading Header] + +[h1 Heading1] + +[heading:x1 Header with id] + +[h1:x2 Heading1 with id] + +[table +[[]][[]] +] + +[table:withid +[[]][[]] +] + +[table With Title +[[]][[]] +] + +[table:x Id and Title +[[]][[]] +] + + +[endsect] + +[section:x Inner with id] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-inc_1_5.quickbook b/src/boost/tools/quickbook/test/include/compatibility-inc_1_5.quickbook new file mode 100644 index 000000000..5551da5b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-inc_1_5.quickbook @@ -0,0 +1,33 @@ +[compatibility-mode 1.5] + +[section Inner] + +[heading Header] + +[h1 Heading1] + +[heading:x1 Header with id] + +[h1:x2 Heading1 with id] + +[table +[[]][[]] +] + +[table:withid +[[]][[]] +] + +[table With Title +[[]][[]] +] + +[table:x Id and Title +[[]][[]] +] + + +[endsect] + +[section:x Inner with id] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/compatibility-inc_1_6.quickbook b/src/boost/tools/quickbook/test/include/compatibility-inc_1_6.quickbook new file mode 100644 index 000000000..61f3c7bcd --- /dev/null +++ b/src/boost/tools/quickbook/test/include/compatibility-inc_1_6.quickbook @@ -0,0 +1,33 @@ +[compatibility-mode 1.6] + +[section Inner] + +[heading Header] + +[h1 Heading1] + +[heading:x1 Header with id] + +[h1:x2 Heading1 with id] + +[table +[[]][[]] +] + +[table:withid +[[]][[]] +] + +[table With Title +[[]][[]] +] + +[table:x Id and Title +[[]][[]] +] + + +[endsect] + +[section:x Inner with id] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold b/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold new file mode 100644 index 000000000..f2fb5321d --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="doc_title_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Doc Title 1</title> + <bridgehead renderas="sect2" id="doc_title_1.h0"> + <phrase id="doc_title_1.a1"/><link linkend="doc_title_1.a1">a1</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1.h1"> + <phrase id="doc_title_1.inc1"/><link linkend="doc_title_1.inc1">inc1</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1.h2"> + <phrase id="doc_title_1.a2"/><link linkend="doc_title_1.a2">a2</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1_inc2.h0"> + <phrase id="doc_title_1_inc2.inc2"/><link linkend="doc_title_1_inc2.inc2">inc2</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1.h3"> + <phrase id="doc_title_1.a3"/><link linkend="doc_title_1.a3">a3</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1_inc2.h1"> + <phrase id="doc_title_1_inc2.inc3"/><link linkend="doc_title_1_inc2.inc3">inc3</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1.h4"> + <phrase id="doc_title_1.a4"/><link linkend="doc_title_1.a4">a4</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold-html b/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold-html new file mode 100644 index 000000000..69848ef9f --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-1.5.gold-html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Doc Title 1 + </h3> + <h2 id="doc_title_1.a1"> + a1 + </h2> + <h2 id="doc_title_1.inc1"> + inc1 + </h2> + <h2 id="doc_title_1.a2"> + a2 + </h2> + <h2 id="doc_title_1_inc2.inc2"> + inc2 + </h2> + <h2 id="doc_title_1.a3"> + a3 + </h2> + <h2 id="doc_title_1_inc2.inc3"> + inc3 + </h2> + <h2 id="doc_title_1.a4"> + a4 + </h2> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/doc-title1-1.5.quickbook b/src/boost/tools/quickbook/test/include/doc-title1-1.5.quickbook new file mode 100644 index 000000000..ec7a56c86 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-1.5.quickbook @@ -0,0 +1,27 @@ +[article Doc Title 1 +[quickbook 1.5] +] + +[/ Doc Titles for included files is a little odd. You generally don't see + titles in them, the only way to detect them is through the generated ids. + So that's what this test is for. + + The second include has a title, because that isn't scoped by file it will + continue to be used to generated ids for the following included files - + but not in this document as the document id for the file is generated + for the whole file at the start. + ] + +[heading a1] + +[include doc-title1-inc1.quickbook] + +[heading a2] + +[include doc-title1-inc2.quickbook] + +[heading a3] + +[include doc-title1-inc3.quickbook] + +[heading a4] diff --git a/src/boost/tools/quickbook/test/include/doc-title1-inc1.quickbook b/src/boost/tools/quickbook/test/include/doc-title1-inc1.quickbook new file mode 100644 index 000000000..e17ad31d8 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-inc1.quickbook @@ -0,0 +1 @@ +[heading inc1] diff --git a/src/boost/tools/quickbook/test/include/doc-title1-inc2.quickbook b/src/boost/tools/quickbook/test/include/doc-title1-inc2.quickbook new file mode 100644 index 000000000..e8b18d37b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-inc2.quickbook @@ -0,0 +1,4 @@ +[article Doc Title 1 Inc2 +] + +[heading inc2] diff --git a/src/boost/tools/quickbook/test/include/doc-title1-inc3.quickbook b/src/boost/tools/quickbook/test/include/doc-title1-inc3.quickbook new file mode 100644 index 000000000..501e3320b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1-inc3.quickbook @@ -0,0 +1 @@ +[heading inc3] diff --git a/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold new file mode 100644 index 000000000..0ee226e9e --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="doc-title" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Doc Title 1a</title> + <bridgehead renderas="sect2" id="doc-title.h0"> + <phrase id="doc-title.a1"/><link linkend="doc-title.a1">a1</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1a.h0"> + <phrase id="doc_title_1a.inc1"/><link linkend="doc_title_1a.inc1">inc1</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc-title.h1"> + <phrase id="doc-title.a2"/><link linkend="doc-title.a2">a2</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1_inc2.h0"> + <phrase id="doc_title_1_inc2.inc2"/><link linkend="doc_title_1_inc2.inc2">inc2</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc-title.h2"> + <phrase id="doc-title.a3"/><link linkend="doc-title.a3">a3</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc_title_1_inc2.h1"> + <phrase id="doc_title_1_inc2.inc3"/><link linkend="doc_title_1_inc2.inc3">inc3</link> + </bridgehead> + <bridgehead renderas="sect2" id="doc-title.h3"> + <phrase id="doc-title.a4"/><link linkend="doc-title.a4">a4</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold-html b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold-html new file mode 100644 index 000000000..f29d8cdb7 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.gold-html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Doc Title 1a + </h3> + <h2 id="doc-title.a1"> + a1 + </h2> + <h2 id="doc_title_1a.inc1"> + inc1 + </h2> + <h2 id="doc-title.a2"> + a2 + </h2> + <h2 id="doc_title_1_inc2.inc2"> + inc2 + </h2> + <h2 id="doc-title.a3"> + a3 + </h2> + <h2 id="doc_title_1_inc2.inc3"> + inc3 + </h2> + <h2 id="doc-title.a4"> + a4 + </h2> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/doc-title1a-1.5.quickbook b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.quickbook new file mode 100644 index 000000000..dc12d5cb7 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/doc-title1a-1.5.quickbook @@ -0,0 +1,20 @@ +[article Doc Title 1a +[quickbook 1.5] +[id doc-title] +] + +[/ A repeat of doc-title1, but with an explicit id. ] + +[heading a1] + +[include doc-title1-inc1.quickbook] + +[heading a2] + +[include doc-title1-inc2.quickbook] + +[heading a3] + +[include doc-title1-inc3.quickbook] + +[heading a4] diff --git a/src/boost/tools/quickbook/test/include/filename-1_7.gold b/src/boost/tools/quickbook/test/include/filename-1_7.gold new file mode 100644 index 000000000..935b42642 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-1_7.gold @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="filename_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Filename Test</title> + <para> + filename-1_7.quickbook + </para> + <bridgehead renderas="sect2" id="filename_test.h0"> + <phrase id="filename_test.test_1"/><link linkend="filename_test.test_1">Test + 1</link> + </bridgehead> + <para> + sub/filename_include1.quickbook + </para> + <para> + sub/../filename_include2.quickbook + </para> + <bridgehead renderas="sect2" id="filename_test.h1"> + <phrase id="filename_test.test_2"/><link linkend="filename_test.test_2">Test + 2</link> + </bridgehead> + <para> + filename_include2.quickbook + </para> + <bridgehead renderas="sect2" id="filename_test.h2"> + <phrase id="filename_test.test_3"/><link linkend="filename_test.test_3">Test + 3</link> + </bridgehead> + <para> + sub/filename_include1.quickbook + </para> + <para> + sub/../filename_include2.quickbook + </para> + <bridgehead renderas="sect2" id="filename_test.h3"> + <phrase id="filename_test.test_4"/><link linkend="filename_test.test_4">Test + 4</link> + </bridgehead> + <para> + sub/filename_include1.quickbook + </para> + <para> + sub/../filename_include2.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/filename-1_7.gold-html b/src/boost/tools/quickbook/test/include/filename-1_7.gold-html new file mode 100644 index 000000000..50bd60546 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-1_7.gold-html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Filename Test + </h3> + <p> + filename-1_7.quickbook + </p> + <h2 id="filename_test.test_1"> + Test 1 + </h2> + <p> + sub/filename_include1.quickbook + </p> + <p> + sub/../filename_include2.quickbook + </p> + <h2 id="filename_test.test_2"> + Test 2 + </h2> + <p> + filename_include2.quickbook + </p> + <h2 id="filename_test.test_3"> + Test 3 + </h2> + <p> + sub/filename_include1.quickbook + </p> + <p> + sub/../filename_include2.quickbook + </p> + <h2 id="filename_test.test_4"> + Test 4 + </h2> + <p> + sub/filename_include1.quickbook + </p> + <p> + sub/../filename_include2.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/filename-1_7.quickbook b/src/boost/tools/quickbook/test/include/filename-1_7.quickbook new file mode 100644 index 000000000..9d462af89 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-1_7.quickbook @@ -0,0 +1,21 @@ +[article Filename Test +[quickbook 1.7] +] + +__FILENAME__ + +[heading Test 1] + +[include sub/*.quickbook] + +[heading Test 2] + +[include filename_include?.quickbook] + +[heading Test 3] + +[include su\[b\]/filename\\_include1.quickbook] + +[heading Test 4] + +[include su\\b/*.quickbook] diff --git a/src/boost/tools/quickbook/test/include/filename-path.gold b/src/boost/tools/quickbook/test/include/filename-path.gold new file mode 100644 index 000000000..f77ab84a8 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-path.gold @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="filename_test_with_include_path" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Filename test with include path</title> + <para> + filename-path.quickbook + </para> + <para> + filename_include1.quickbook + </para> + <para> + ../filename_include2.quickbook + </para> + <para> + filename_include2.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/filename-path.gold-html b/src/boost/tools/quickbook/test/include/filename-path.gold-html new file mode 100644 index 000000000..d7a6e2e00 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-path.gold-html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Filename test with include path + </h3> + <p> + filename-path.quickbook + </p> + <p> + filename_include1.quickbook + </p> + <p> + ../filename_include2.quickbook + </p> + <p> + filename_include2.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/filename-path.quickbook b/src/boost/tools/quickbook/test/include/filename-path.quickbook new file mode 100644 index 000000000..6121df5c5 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename-path.quickbook @@ -0,0 +1,9 @@ +[article Filename test with include path +[quickbook 1.5] +] + +__FILENAME__ + +[include filename_include1.quickbook] + +[include filename_include2.quickbook]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/filename.gold b/src/boost/tools/quickbook/test/include/filename.gold new file mode 100644 index 000000000..3e895eb4e --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename.gold @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="filename_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Filename Test</title> + <para> + filename.quickbook + </para> + <para> + sub/filename_include1.quickbook + </para> + <para> + sub/../filename_include2.quickbook + </para> + <para> + filename_include2.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/filename.gold-html b/src/boost/tools/quickbook/test/include/filename.gold-html new file mode 100644 index 000000000..e722f9307 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename.gold-html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Filename Test + </h3> + <p> + filename.quickbook + </p> + <p> + sub/filename_include1.quickbook + </p> + <p> + sub/../filename_include2.quickbook + </p> + <p> + filename_include2.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/filename.quickbook b/src/boost/tools/quickbook/test/include/filename.quickbook new file mode 100644 index 000000000..37ff37b5c --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename.quickbook @@ -0,0 +1,9 @@ +[article Filename Test +[quickbook 1.5] +] + +__FILENAME__ + +[include sub/filename_include1.quickbook] + +[include filename_include2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/filename_include2.quickbook b/src/boost/tools/quickbook/test/include/filename_include2.quickbook new file mode 100644 index 000000000..f9d479a93 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename_include2.quickbook @@ -0,0 +1 @@ +__FILENAME__
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/filename_path-1_7.gold b/src/boost/tools/quickbook/test/include/filename_path-1_7.gold new file mode 100644 index 000000000..6f52dafc1 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename_path-1_7.gold @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="filename_test_with_include_path" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Filename test with include path</title> + <para> + filename_path-1_7.quickbook + </para> + <para> + filename_include1.quickbook + </para> + <para> + ../filename_include2.quickbook + </para> + <para> + filename_include2.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/filename_path-1_7.gold-html b/src/boost/tools/quickbook/test/include/filename_path-1_7.gold-html new file mode 100644 index 000000000..190f5d240 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename_path-1_7.gold-html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Filename test with include path + </h3> + <p> + filename_path-1_7.quickbook + </p> + <p> + filename_include1.quickbook + </p> + <p> + ../filename_include2.quickbook + </p> + <p> + filename_include2.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/filename_path-1_7.quickbook b/src/boost/tools/quickbook/test/include/filename_path-1_7.quickbook new file mode 100644 index 000000000..741d76ad5 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/filename_path-1_7.quickbook @@ -0,0 +1,7 @@ +[article Filename test with include path +[quickbook 1.7] +] + +__FILENAME__ + +[include filename_include?.quickbook] diff --git a/src/boost/tools/quickbook/test/include/glob-1_7.gold b/src/boost/tools/quickbook/test/include/glob-1_7.gold new file mode 100644 index 000000000..ba31ae961 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob-1_7.gold @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="glob_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Glob Test</title> + <section id="glob_test.t1_0"> + <title><link linkend="glob_test.t1_0">Test 1.0</link></title> + </section> + <section id="glob_test.t1_1"> + <title><link linkend="glob_test.t1_1">Test 1.1</link></title> + <para> + A + </para> + </section> + <section id="glob_test.t1_2"> + <title><link linkend="glob_test.t1_2">Test 1.2</link></title> + <para> + B + </para> + </section> + <section id="glob_test.t1_3"> + <title><link linkend="glob_test.t1_3">Test 1.3</link></title> + <para> + B + </para> + </section> + <section id="glob_test.t2_1"> + <title><link linkend="glob_test.t2_1">Test 2.1</link></title> + <para> + A + </para> + <para> + B + </para> + </section> + <section id="glob_test.t2_2"> + <title><link linkend="glob_test.t2_2">Test 2.2</link></title> + <para> + B + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/glob-1_7.gold-html b/src/boost/tools/quickbook/test/include/glob-1_7.gold-html new file mode 100644 index 000000000..9b53c2be4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob-1_7.gold-html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Glob Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#glob_test.t1_0">Test 1.0</a> + </li> + <li> + <a href="#glob_test.t1_1">Test 1.1</a> + </li> + <li> + <a href="#glob_test.t1_2">Test 1.2</a> + </li> + <li> + <a href="#glob_test.t1_3">Test 1.3</a> + </li> + <li> + <a href="#glob_test.t2_1">Test 2.1</a> + </li> + <li> + <a href="#glob_test.t2_2">Test 2.2</a> + </li> + </ul> + </div> + <div id="glob_test.t1_0"> + <h3> + Test 1.0 + </h3> + <div id="glob_test.t1_0"> + </div> + </div> + <div id="glob_test.t1_1"> + <h3> + Test 1.1 + </h3> + <div id="glob_test.t1_1"> + <p> + A + </p> + </div> + </div> + <div id="glob_test.t1_2"> + <h3> + Test 1.2 + </h3> + <div id="glob_test.t1_2"> + <p> + B + </p> + </div> + </div> + <div id="glob_test.t1_3"> + <h3> + Test 1.3 + </h3> + <div id="glob_test.t1_3"> + <p> + B + </p> + </div> + </div> + <div id="glob_test.t2_1"> + <h3> + Test 2.1 + </h3> + <div id="glob_test.t2_1"> + <p> + A + </p> + <p> + B + </p> + </div> + </div> + <div id="glob_test.t2_2"> + <h3> + Test 2.2 + </h3> + <div id="glob_test.t2_2"> + <p> + B + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/glob-1_7.quickbook b/src/boost/tools/quickbook/test/include/glob-1_7.quickbook new file mode 100644 index 000000000..826c12be8 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob-1_7.quickbook @@ -0,0 +1,39 @@ +[article Glob Test +[quickbook 1.7] +] + +[section:t1_0 Test 1.0] + +[include glob0/*] + +[endsect] [/t1_0] + +[section:t1_1 Test 1.1] + +[include glob1/*] + +[endsect] [/t1_1] + +[section:t1_2 Test 1.2] + +[include glob1/*/*] + +[endsect] [/t1_2] + +[section:t1_3 Test 1.3] + +[include glob1/*/b.qbk] + +[endsect] [/t1_3] + +[section:t2_1 Test 2.1] + +[include glob2/*] + +[endsect] [/t2_1] + +[section:t2_2 Test 2.2] + +[include glob2/*/*] + +[endsect] [/t2_2] diff --git a/src/boost/tools/quickbook/test/include/glob1/a.qbk b/src/boost/tools/quickbook/test/include/glob1/a.qbk new file mode 100644 index 000000000..f70f10e4d --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob1/a.qbk @@ -0,0 +1 @@ +A diff --git a/src/boost/tools/quickbook/test/include/glob1/glob1-1/b.qbk b/src/boost/tools/quickbook/test/include/glob1/glob1-1/b.qbk new file mode 100644 index 000000000..223b7836f --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob1/glob1-1/b.qbk @@ -0,0 +1 @@ +B diff --git a/src/boost/tools/quickbook/test/include/glob2/a.qbk b/src/boost/tools/quickbook/test/include/glob2/a.qbk new file mode 100644 index 000000000..160580801 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob2/a.qbk @@ -0,0 +1,3 @@ +A + +[include */*.qbk] diff --git a/src/boost/tools/quickbook/test/include/glob2/glob2-1/b.qbk b/src/boost/tools/quickbook/test/include/glob2/glob2-1/b.qbk new file mode 100644 index 000000000..223b7836f --- /dev/null +++ b/src/boost/tools/quickbook/test/include/glob2/glob2-1/b.qbk @@ -0,0 +1 @@ +B diff --git a/src/boost/tools/quickbook/test/include/import-basic-1.6.gold b/src/boost/tools/quickbook/test/include/import-basic-1.6.gold new file mode 100644 index 000000000..706589aef --- /dev/null +++ b/src/boost/tools/quickbook/test/include/import-basic-1.6.gold @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="import-1.6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Import Quickbook Test</title> + <para> + Macro 1: import-basic-inc1.quickbook Template 1: import-basic-1.6.quickbook + </para> + <para> + Macro 2: import-basic-inc2.quickbook Template 2: import-basic-1.6.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/import-basic-1.6.gold-html b/src/boost/tools/quickbook/test/include/import-basic-1.6.gold-html new file mode 100644 index 000000000..bbc87b7d7 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/import-basic-1.6.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Import Quickbook Test + </h3> + <p> + Macro 1: import-basic-inc1.quickbook Template 1: import-basic-1.6.quickbook + </p> + <p> + Macro 2: import-basic-inc2.quickbook Template 2: import-basic-1.6.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/import-basic-1.6.quickbook b/src/boost/tools/quickbook/test/include/import-basic-1.6.quickbook new file mode 100644 index 000000000..934db6a9e --- /dev/null +++ b/src/boost/tools/quickbook/test/include/import-basic-1.6.quickbook @@ -0,0 +1,12 @@ +[article Import Quickbook Test +[quickbook 1.6] +[id import-1.6] +] + +[import import-basic-inc1.quickbook] + +macro1 [template1] + +[import import-basic-inc2.quickbook] + +macro2 [template2] diff --git a/src/boost/tools/quickbook/test/include/import-basic-inc1.quickbook b/src/boost/tools/quickbook/test/include/import-basic-inc1.quickbook new file mode 100644 index 000000000..469922845 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/import-basic-inc1.quickbook @@ -0,0 +1,4 @@ +This shouldn't show: __FILENAME__ + +[def macro1 Macro 1: __FILENAME__] +[template template1 Template 1: __FILENAME__]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/import-basic-inc2.quickbook b/src/boost/tools/quickbook/test/include/import-basic-inc2.quickbook new file mode 100644 index 000000000..0cbaaa11d --- /dev/null +++ b/src/boost/tools/quickbook/test/include/import-basic-inc2.quickbook @@ -0,0 +1,10 @@ +[article Macro import. +[quickbook 1.6] +] + +[/ TOOD: Should I have a special docinfo type for this kind of thing? ] + +This shouldn't show: __FILENAME__ + +[def macro2 Macro 2: __FILENAME__] +[template template2 Template 2: __FILENAME__]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/in_section-1_5.gold b/src/boost/tools/quickbook/test/include/in_section-1_5.gold new file mode 100644 index 000000000..b55eb73f3 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_5.gold @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_in_section_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section 1.5</title> + <section id="include_in_section_1_5.container"> + <title><link linkend="include_in_section_1_5.container">Container</link></title> + <bridgehead renderas="sect1" id="include_in_section_include_1.container.h0"> + <phrase id="include_in_section_include_1.container.test1"/><link linkend="include_in_section_include_1.container.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1.container.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1.container.inner.h0"> + <phrase id="include_in_section_include_1.container.inner.test2"/><link linkend="include_in_section_include_1.container.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include_in_section_include_1.container.inner.h1"> + <phrase id="include_in_section_include_1.container.inner.simple_include"/><link + linkend="include_in_section_include_1.container.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="section_include.container.h0"> + <phrase id="section_include.container.test1"/><link linkend="section_include.container.test1">Test1</link> + </bridgehead> + <section id="section_include.container.inner"> + <bridgehead renderas="sect1" id="section_include.container.inner.h0"> + <phrase id="section_include.container.inner.test2"/><link linkend="section_include.container.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include_in_section_include_2.container.inner.h0"> + <phrase id="include_in_section_include_2.container.inner.simple_include"/><link + linkend="include_in_section_include_2.container.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </section> + <bridgehead renderas="sect1" id="include_in_section_include_1.h0"> + <phrase id="include_in_section_include_1.test1"/><link linkend="include_in_section_include_1.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1.inner.h0"> + <phrase id="include_in_section_include_1.inner.test2"/><link linkend="include_in_section_include_1.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include_in_section_include_1.inner.h1"> + <phrase id="include_in_section_include_1.inner.simple_include"/><link linkend="include_in_section_include_1.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="section_include.h0"> + <phrase id="section_include.test1"/><link linkend="section_include.test1">Test1</link> + </bridgehead> + <section id="section_include.inner"> + <bridgehead renderas="sect1" id="section_include.inner.h0"> + <phrase id="section_include.inner.test2"/><link linkend="section_include.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include_in_section_include_2.inner.h0"> + <phrase id="include_in_section_include_2.inner.simple_include"/><link linkend="include_in_section_include_2.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + <section id="include_in_section_1_5.container2"> + <title><link linkend="include_in_section_1_5.container2">Container2</link></title> + <bridgehead renderas="sect1" id="include_in_section_include_1.container2.h0"> + <phrase id="include_in_section_include_1.container2.test1"/><link linkend="include_in_section_include_1.container2.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1.container2.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1.container2.inner.h0"> + <phrase id="include_in_section_include_1.container2.inner.test2"/><link linkend="include_in_section_include_1.container2.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include_in_section_include_1.container2.inner.h1"> + <phrase id="include_in_section_include_1.container2.inner.simple_include"/><link + linkend="include_in_section_include_1.container2.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + <bridgehead renderas="sect1" id="section_include.container2.h0"> + <phrase id="section_include.container2.test1"/><link linkend="section_include.container2.test1">Test1</link> + </bridgehead> + <section id="section_include.container2.inner"> + <bridgehead renderas="sect1" id="section_include.container2.inner.h0"> + <phrase id="section_include.container2.inner.test2"/><link linkend="section_include.container2.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include_in_section_include_2.container2.inner.h0"> + <phrase id="include_in_section_include_2.container2.inner.simple_include"/><link + linkend="include_in_section_include_2.container2.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/in_section-1_5.gold-html b/src/boost/tools/quickbook/test/include/in_section-1_5.gold-html new file mode 100644 index 000000000..5bad6b570 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_5.gold-html @@ -0,0 +1,120 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include in section 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_in_section_1_5.container">Container</a> + </li> + <li> + <a href="#include_in_section_include_1.inner"><i>Untitled</i></a> + </li> + <li> + <a href="#section_include.inner"><i>Untitled</i></a> + </li> + <li> + <a href="#include_in_section_1_5.container2">Container2</a> + </li> + </ul> + </div> + <h1 id="include_in_section_include_1.test1"> + Test1 + </h1> + <h1 id="section_include.test1"> + Test1 + </h1> + <div id="include_in_section_1_5.container"> + <h3> + Container + </h3> + <div id="include_in_section_1_5.container"> + <h1 id="include_in_section_include_1.container.test1"> + Test1 + </h1> + <h1 id="section_include.container.test1"> + Test1 + </h1> + </div> + <div id="include_in_section_include_1.container.inner"> + <div id="include_in_section_include_1.container.inner"> + <h1 id="include_in_section_include_1.container.inner.test2"> + Test2 + </h1> + <h4 id="include_in_section_include_1.container.inner.simple_include"> + Simple include + </h4> + </div> + </div> + <div id="section_include.container.inner"> + <div id="section_include.container.inner"> + <h1 id="section_include.container.inner.test2"> + Test2 + </h1> + <h4 id="include_in_section_include_2.container.inner.simple_include"> + Simple include + </h4> + </div> + </div> + </div> + <div id="include_in_section_include_1.inner"> + <div id="include_in_section_include_1.inner"> + <h1 id="include_in_section_include_1.inner.test2"> + Test2 + </h1> + <h3 id="include_in_section_include_1.inner.simple_include"> + Simple include + </h3> + </div> + </div> + <div id="section_include.inner"> + <div id="section_include.inner"> + <h1 id="section_include.inner.test2"> + Test2 + </h1> + <h3 id="include_in_section_include_2.inner.simple_include"> + Simple include + </h3> + </div> + </div> + <div id="include_in_section_1_5.container2"> + <h3> + Container2 + </h3> + <div id="include_in_section_1_5.container2"> + <h1 id="include_in_section_include_1.container2.test1"> + Test1 + </h1> + <h1 id="section_include.container2.test1"> + Test1 + </h1> + </div> + <div id="include_in_section_include_1.container2.inner"> + <div id="include_in_section_include_1.container2.inner"> + <h1 id="include_in_section_include_1.container2.inner.test2"> + Test2 + </h1> + <h4 id="include_in_section_include_1.container2.inner.simple_include"> + Simple include + </h4> + </div> + </div> + <div id="section_include.container2.inner"> + <div id="section_include.container2.inner"> + <h1 id="section_include.container2.inner.test2"> + Test2 + </h1> + <h4 id="include_in_section_include_2.container2.inner.simple_include"> + Simple include + </h4> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/in_section-1_5.quickbook b/src/boost/tools/quickbook/test/include/in_section-1_5.quickbook new file mode 100644 index 000000000..28183096a --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_5.quickbook @@ -0,0 +1,16 @@ +[article Include in section 1.5 +[quickbook 1.5] +] + +[section:container Container] +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] +[endsect] + +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] + +[section:container2 Container2] +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/in_section-1_6.gold b/src/boost/tools/quickbook/test/include/in_section-1_6.gold new file mode 100644 index 000000000..52c18a706 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_6.gold @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_in_section_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section 1.6</title> + <section id="include_in_section_1_6.container"> + <title><link linkend="include_in_section_1_6.container">Container</link></title> + <article id="include_in_section_include_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 1</title> + <bridgehead renderas="sect1" id="include_in_section_include_1.h0"> + <phrase id="include_in_section_include_1.test1"/><link linkend="include_in_section_include_1.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1.inner.h0"> + <phrase id="include_in_section_include_1.inner.test2"/><link linkend="include_in_section_include_1.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include_in_section_include_1.inner.h1"> + <phrase id="include_in_section_include_1.inner.simple_include"/><link linkend="include_in_section_include_1.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </article> + <article id="section_include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 2</title> + <bridgehead renderas="sect1" id="section_include.h0"> + <phrase id="section_include.test1"/><link linkend="section_include.test1">Test1</link> + </bridgehead> + <section id="section_include.inner"> + <bridgehead renderas="sect1" id="section_include.inner.h0"> + <phrase id="section_include.inner.test2"/><link linkend="section_include.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="section_include.inner.h1"> + <phrase id="section_include.inner.simple_include"/><link linkend="section_include.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </article> + </section> + <article id="include_in_section_include_1_0" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 1</title> + <bridgehead renderas="sect1" id="include_in_section_include_1_0.h0"> + <phrase id="include_in_section_include_1_0.test1"/><link linkend="include_in_section_include_1_0.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1_0.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1_0.inner.h0"> + <phrase id="include_in_section_include_1_0.inner.test2"/><link linkend="include_in_section_include_1_0.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include_in_section_include_1_0.inner.h1"> + <phrase id="include_in_section_include_1_0.inner.simple_include"/><link linkend="include_in_section_include_1_0.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </article> + <article id="section_include0" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 2</title> + <bridgehead renderas="sect1" id="section_include0.h0"> + <phrase id="section_include0.test1"/><link linkend="section_include0.test1">Test1</link> + </bridgehead> + <section id="section_include0.inner"> + <bridgehead renderas="sect1" id="section_include0.inner.h0"> + <phrase id="section_include0.inner.test2"/><link linkend="section_include0.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="section_include0.inner.h1"> + <phrase id="section_include0.inner.simple_include"/><link linkend="section_include0.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </article> + <section id="include_in_section_1_6.container2"> + <title><link linkend="include_in_section_1_6.container2">Container2</link></title> + <article id="include_in_section_include_1_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 1</title> + <bridgehead renderas="sect1" id="include_in_section_include_1_1.h0"> + <phrase id="include_in_section_include_1_1.test1"/><link linkend="include_in_section_include_1_1.test1">Test1</link> + </bridgehead> + <section id="include_in_section_include_1_1.inner"> + <bridgehead renderas="sect1" id="include_in_section_include_1_1.inner.h0"> + <phrase id="include_in_section_include_1_1.inner.test2"/><link linkend="include_in_section_include_1_1.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include_in_section_include_1_1.inner.h1"> + <phrase id="include_in_section_include_1_1.inner.simple_include"/><link + linkend="include_in_section_include_1_1.inner.simple_include">Simple include</link> + </bridgehead> + </section> + </article> + <article id="section_include1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include in section include 2</title> + <bridgehead renderas="sect1" id="section_include1.h0"> + <phrase id="section_include1.test1"/><link linkend="section_include1.test1">Test1</link> + </bridgehead> + <section id="section_include1.inner"> + <bridgehead renderas="sect1" id="section_include1.inner.h0"> + <phrase id="section_include1.inner.test2"/><link linkend="section_include1.inner.test2">Test2</link> + </bridgehead> + <bridgehead renderas="sect3" id="section_include1.inner.h1"> + <phrase id="section_include1.inner.simple_include"/><link linkend="section_include1.inner.simple_include">Simple + include</link> + </bridgehead> + </section> + </article> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/in_section-1_6.gold-html b/src/boost/tools/quickbook/test/include/in_section-1_6.gold-html new file mode 100644 index 000000000..cc2c36ac0 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_6.gold-html @@ -0,0 +1,238 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include in section 1.6 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_in_section_1_6.container">Container</a> + <ul> + <li> + <a href="#include_in_section_include_1">Include in section include + 1</a> + </li> + <li> + <a href="#section_include">Include in section include 2</a> + </li> + </ul> + </li> + <li> + <a href="#include_in_section_include_1_0">Include in section include 1</a> + <ul> + <li> + <a href="#include_in_section_include_1_0.inner"><i>Untitled</i></a> + </li> + </ul> + </li> + <li> + <a href="#section_include0">Include in section include 2</a> + <ul> + <li> + <a href="#section_include0.inner"><i>Untitled</i></a> + </li> + </ul> + </li> + <li> + <a href="#include_in_section_1_6.container2">Container2</a> + <ul> + <li> + <a href="#include_in_section_include_1_1">Include in section include + 1</a> + </li> + <li> + <a href="#section_include1">Include in section include 2</a> + </li> + </ul> + </li> + </ul> + </div> + <div id="include_in_section_1_6.container"> + <h3> + Container + </h3> + <div id="include_in_section_1_6.container"> + </div> + <div id="include_in_section_include_1"> + <h3> + Include in section include 1 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_in_section_include_1.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="include_in_section_include_1.test1"> + Test1 + </h1> + <div id="include_in_section_include_1.inner"> + <div id="include_in_section_include_1.inner"> + <h1 id="include_in_section_include_1.inner.test2"> + Test2 + </h1> + <h3 id="include_in_section_include_1.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + <div id="section_include"> + <h3> + Include in section include 2 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_include.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="section_include.test1"> + Test1 + </h1> + <div id="section_include.inner"> + <div id="section_include.inner"> + <h1 id="section_include.inner.test2"> + Test2 + </h1> + <h3 id="section_include.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + </div> + <div id="include_in_section_include_1_0"> + <h3> + Include in section include 1 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_in_section_include_1_0.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="include_in_section_include_1_0.test1"> + Test1 + </h1> + <div id="include_in_section_include_1_0.inner"> + <div id="include_in_section_include_1_0.inner"> + <h1 id="include_in_section_include_1_0.inner.test2"> + Test2 + </h1> + <h3 id="include_in_section_include_1_0.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + <div id="section_include0"> + <h3> + Include in section include 2 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_include0.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="section_include0.test1"> + Test1 + </h1> + <div id="section_include0.inner"> + <div id="section_include0.inner"> + <h1 id="section_include0.inner.test2"> + Test2 + </h1> + <h3 id="section_include0.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + <div id="include_in_section_1_6.container2"> + <h3> + Container2 + </h3> + <div id="include_in_section_1_6.container2"> + </div> + <div id="include_in_section_include_1_1"> + <h3> + Include in section include 1 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_in_section_include_1_1.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="include_in_section_include_1_1.test1"> + Test1 + </h1> + <div id="include_in_section_include_1_1.inner"> + <div id="include_in_section_include_1_1.inner"> + <h1 id="include_in_section_include_1_1.inner.test2"> + Test2 + </h1> + <h3 id="include_in_section_include_1_1.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + <div id="section_include1"> + <h3> + Include in section include 2 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_include1.inner"><i>Untitled</i></a> + </li> + </ul> + </div> + <h1 id="section_include1.test1"> + Test1 + </h1> + <div id="section_include1.inner"> + <div id="section_include1.inner"> + <h1 id="section_include1.inner.test2"> + Test2 + </h1> + <h3 id="section_include1.inner.simple_include"> + Simple include + </h3> + </div> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/in_section-1_6.quickbook b/src/boost/tools/quickbook/test/include/in_section-1_6.quickbook new file mode 100644 index 000000000..686f97ec4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-1_6.quickbook @@ -0,0 +1,16 @@ +[article Include in section 1.6 +[quickbook 1.6] +] + +[section:container Container] +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] +[endsect] + +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] + +[section:container2 Container2] +[include in_section-inc1.quickbook] +[include in_section-inc2.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/in_section-inc1.quickbook b/src/boost/tools/quickbook/test/include/in_section-inc1.quickbook new file mode 100644 index 000000000..f74bf5dbd --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-inc1.quickbook @@ -0,0 +1,13 @@ +[article Include in section include 1 +[quickbook 1.6] +] + +[h1 Test1] + +[section:inner] + +[h1 Test2] + +[include include-id-inc1.quickbook] + +[endsect] diff --git a/src/boost/tools/quickbook/test/include/in_section-inc2.quickbook b/src/boost/tools/quickbook/test/include/in_section-inc2.quickbook new file mode 100644 index 000000000..0a30aaa74 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/in_section-inc2.quickbook @@ -0,0 +1,14 @@ +[article Include in section include 2 +[quickbook 1.6] +[id section_include] +] + +[h1 Test1] + +[section:inner] + +[h1 Test2] + +[include include-id-inc1.quickbook] + +[endsect] diff --git a/src/boost/tools/quickbook/test/include/include-id-1.5.gold b/src/boost/tools/quickbook/test/include/include-id-1.5.gold new file mode 100644 index 000000000..4944d08d4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.5.gold @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_id_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Id Test</title> + <bridgehead renderas="sect2" id="a.h0"> + <phrase id="a.simple_include"/><link linkend="a.simple_include">Simple include</link> + </bridgehead> + <bridgehead renderas="sect2" id="b.h0"> + <phrase id="b.simple_include"/><link linkend="b.simple_include">Simple include</link> + </bridgehead> + <bridgehead renderas="sect2" id="c.h0"> + <phrase id="c.title__no_id"/><link linkend="c.title__no_id">Title, no id</link> + </bridgehead> + <bridgehead renderas="sect2" id="d.h0"> + <phrase id="d.title__no_id"/><link linkend="d.title__no_id">Title, no id</link> + </bridgehead> + <bridgehead renderas="sect2" id="with-id.h0"> + <phrase id="with-id.title_with_id"/><link linkend="with-id.title_with_id">Title + with id</link> + </bridgehead> + <bridgehead renderas="sect2" id="with-id.h1"> + <phrase id="with-id.title_with_id0"/><link linkend="with-id.title_with_id0">Title + with id</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/include/include-id-1.5.gold-html b/src/boost/tools/quickbook/test/include/include-id-1.5.gold-html new file mode 100644 index 000000000..4c7b6b230 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.5.gold-html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Id Test + </h3> + <h2 id="a.simple_include"> + Simple include + </h2> + <h2 id="b.simple_include"> + Simple include + </h2> + <h2 id="c.title__no_id"> + Title, no id + </h2> + <h2 id="d.title__no_id"> + Title, no id + </h2> + <h2 id="with-id.title_with_id"> + Title with id + </h2> + <h2 id="with-id.title_with_id0"> + Title with id + </h2> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/include-id-1.5.quickbook b/src/boost/tools/quickbook/test/include/include-id-1.5.quickbook new file mode 100644 index 000000000..dd4b50ad3 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.5.quickbook @@ -0,0 +1,10 @@ +[article Include Id Test +[quickbook 1.5] +] + +[include:a include-id-inc1.quickbook] +[include:b include-id-inc1.quickbook] +[include:c include-id-inc2.quickbook] +[include:d include-id-inc2.quickbook] +[include:e include-id-inc3.quickbook] +[include:f include-id-inc3.quickbook] diff --git a/src/boost/tools/quickbook/test/include/include-id-1.6.gold b/src/boost/tools/quickbook/test/include/include-id-1.6.gold new file mode 100644 index 000000000..1f4cb881f --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.6.gold @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_id_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Id Test</title> + <bridgehead renderas="sect2" id="a.h0"> + <phrase id="a.simple_include"/><link linkend="a.simple_include">Simple include</link> + </bridgehead> + <bridgehead renderas="sect2" id="b.h0"> + <phrase id="b.simple_include"/><link linkend="b.simple_include">Simple include</link> + </bridgehead> + <article id="c" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include without id</title> + <bridgehead renderas="sect2" id="c.h0"> + <phrase id="c.title__no_id"/><link linkend="c.title__no_id">Title, no id</link> + </bridgehead> + </article> + <article id="d" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include without id</title> + <bridgehead renderas="sect2" id="d.h0"> + <phrase id="d.title__no_id"/><link linkend="d.title__no_id">Title, no id</link> + </bridgehead> + </article> + <article id="e" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include with id</title> + <bridgehead renderas="sect2" id="e.h0"> + <phrase id="e.title_with_id"/><link linkend="e.title_with_id">Title with id</link> + </bridgehead> + </article> + <article id="f" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include with id</title> + <bridgehead renderas="sect2" id="f.h0"> + <phrase id="f.title_with_id"/><link linkend="f.title_with_id">Title with id</link> + </bridgehead> + </article> +</article> diff --git a/src/boost/tools/quickbook/test/include/include-id-1.6.gold-html b/src/boost/tools/quickbook/test/include/include-id-1.6.gold-html new file mode 100644 index 000000000..5912dadb0 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.6.gold-html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Id Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#c">Include without id</a> + </li> + <li> + <a href="#d">Include without id</a> + </li> + <li> + <a href="#e">Include with id</a> + </li> + <li> + <a href="#f">Include with id</a> + </li> + </ul> + </div> + <h2 id="a.simple_include"> + Simple include + </h2> + <h2 id="b.simple_include"> + Simple include + </h2> + <div id="c"> + <h3> + Include without id + </h3> + <h2 id="c.title__no_id"> + Title, no id + </h2> + </div> + <div id="d"> + <h3> + Include without id + </h3> + <h2 id="d.title__no_id"> + Title, no id + </h2> + </div> + <div id="e"> + <h3> + Include with id + </h3> + <h2 id="e.title_with_id"> + Title with id + </h2> + </div> + <div id="f"> + <h3> + Include with id + </h3> + <h2 id="f.title_with_id"> + Title with id + </h2> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/include-id-1.6.quickbook b/src/boost/tools/quickbook/test/include/include-id-1.6.quickbook new file mode 100644 index 000000000..d7d5318cd --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-1.6.quickbook @@ -0,0 +1,10 @@ +[article Include Id Test +[quickbook 1.6] +] + +[include:a include-id-inc1.quickbook] +[include:b include-id-inc1.quickbook] +[include:c include-id-inc2.quickbook] +[include:d include-id-inc2.quickbook] +[include:e include-id-inc3.quickbook] +[include:f include-id-inc3.quickbook] diff --git a/src/boost/tools/quickbook/test/include/include-id-inc1.quickbook b/src/boost/tools/quickbook/test/include/include-id-inc1.quickbook new file mode 100644 index 000000000..63a761d56 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-inc1.quickbook @@ -0,0 +1 @@ +[heading Simple include] diff --git a/src/boost/tools/quickbook/test/include/include-id-inc2.quickbook b/src/boost/tools/quickbook/test/include/include-id-inc2.quickbook new file mode 100644 index 000000000..a7dbef41b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-inc2.quickbook @@ -0,0 +1,5 @@ +[article Include without id +[quickbook 1.5] +] + +[heading Title, no id] diff --git a/src/boost/tools/quickbook/test/include/include-id-inc3.quickbook b/src/boost/tools/quickbook/test/include/include-id-inc3.quickbook new file mode 100644 index 000000000..2bd239825 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include-id-inc3.quickbook @@ -0,0 +1,6 @@ +[article Include with id +[quickbook 1.5] +[id with-id] +] + +[heading Title with id] diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold new file mode 100644 index 000000000..ede21ccbb --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unbalanced" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Test include ids with unbalanced sections</title> + <section id="include1.inc1"> + <title><link linkend="include1.inc1">Include 1</link></title> + <bridgehead renderas="sect3" id="include1.inc1.h0"> + <phrase id="include1.inc1.inc1_1"/><link linkend="include1.inc1.inc1_1">Heading + 1</link> + </bridgehead> + <bridgehead renderas="sect3" id="include1a.h0"> + <phrase id="include1a.inc1a_1"/><link linkend="include1a.inc1a_1">Heading 1</link> + </bridgehead> + <section id="include1a.inc1a"> + <title><link linkend="include1a.inc1a">Include 1a</link></title> + <bridgehead renderas="sect4" id="include1a.inc1a.h0"> + <phrase id="include1a.inc1a.inc1a_2"/><link linkend="include1a.inc1a.inc1a_2">Heading + 2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include1a.inc1a.h1"> + <phrase id="include1a.inc1a.inc1_2"/><link linkend="include1a.inc1a.inc1_2">Heading + 2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include1a.inc1a.h2"> + <phrase id="include1a.inc1a.x1"/><link linkend="include1a.inc1a.x1">X1</link> + </bridgehead> + </section> + <bridgehead renderas="sect3" id="include1.inc1.h1"> + <phrase id="include1.inc1.x2"/><link linkend="include1.inc1.x2">X2</link> + </bridgehead> + </section> + <section id="unbalanced.sect1"> + <title><link linkend="unbalanced.sect1">Section 1</link></title> + <bridgehead renderas="sect3" id="unbalanced.sect1.h0"> + <phrase id="unbalanced.sect1.x1"/><link linkend="unbalanced.sect1.x1">X1</link> + </bridgehead> + <section id="unbalanced.sect1.sect2"> + <title><link linkend="unbalanced.sect1.sect2">Section 2</link></title> + <bridgehead renderas="sect4" id="unbalanced.sect1.sect2.h0"> + <phrase id="unbalanced.sect1.sect2.x2"/><link linkend="unbalanced.sect1.sect2.x2">X2</link> + </bridgehead> + <bridgehead renderas="sect4" id="include2.h0"> + <phrase id="include2.inc2_1"/><link linkend="include2.inc2_1">Heading 1</link> + </bridgehead> + </section> + <bridgehead renderas="sect3" id="include2.h1"> + <phrase id="include2.inc2_2"/><link linkend="include2.inc2_2">Heading 2</link> + </bridgehead> + <bridgehead renderas="sect3" id="include2a.h0"> + <phrase id="include2a.inc2a_1"/><link linkend="include2a.inc2a_1">Heading 1</link> + </bridgehead> + </section> + <bridgehead renderas="sect2" id="include2a.h1"> + <phrase id="include2a.inc2a_2"/><link linkend="include2a.inc2a_2">Heading 2</link> + </bridgehead> + <bridgehead renderas="sect2" id="include2.h2"> + <phrase id="include2.inc2_3"/><link linkend="include2.inc2_3">Heading 3</link> + </bridgehead> +</article> diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold-html b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold-html new file mode 100644 index 000000000..85415e882 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.gold-html @@ -0,0 +1,89 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test include ids with unbalanced sections + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include1.inc1">Include 1</a> + </li> + <li> + <a href="#unbalanced.sect1">Section 1</a> + </li> + </ul> + </div> + <h2 id="include2a.inc2a_2"> + Heading 2 + </h2> + <h2 id="include2.inc2_3"> + Heading 3 + </h2> + <div id="include1.inc1"> + <h3> + Include 1 + </h3> + <div id="include1.inc1"> + <h3 id="include1.inc1.inc1_1"> + Heading 1 + </h3> + <h3 id="include1a.inc1a_1"> + Heading 1 + </h3> + <h3 id="include1.inc1.x2"> + X2 + </h3> + </div> + <div id="include1a.inc1a"> + <h3> + Include 1a + </h3> + <div id="include1a.inc1a"> + <h4 id="include1a.inc1a.inc1a_2"> + Heading 2 + </h4> + <h4 id="include1a.inc1a.inc1_2"> + Heading 2 + </h4> + <h4 id="include1a.inc1a.x1"> + X1 + </h4> + </div> + </div> + </div> + <div id="unbalanced.sect1"> + <h3> + Section 1 + </h3> + <div id="unbalanced.sect1"> + <h3 id="unbalanced.sect1.x1"> + X1 + </h3> + <h3 id="include2.inc2_2"> + Heading 2 + </h3> + <h3 id="include2a.inc2a_1"> + Heading 1 + </h3> + </div> + <div id="unbalanced.sect1.sect2"> + <h3> + Section 2 + </h3> + <div id="unbalanced.sect1.sect2"> + <h4 id="unbalanced.sect1.sect2.x2"> + X2 + </h4> + <h4 id="include2.inc2_1"> + Heading 1 + </h4> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.quickbook b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.quickbook new file mode 100644 index 000000000..b1568d4f9 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-1_6.quickbook @@ -0,0 +1,19 @@ +[quickbook 1.6] +[article Test include ids with unbalanced sections + [id unbalanced] +] + +[/ Sections start in included files ] + +[include:include1 include_id_unbalanced-inc1.quickbook] +[heading:x1 X1] +[endsect] +[heading:x2 X2] +[endsect] + +[/ Sections end in included files ] +[section:sect1 Section 1] +[heading:x1 X1] +[section:sect2 Section 2] +[heading:x2 X2] +[include:include2 include_id_unbalanced-inc2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1.quickbook b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1.quickbook new file mode 100644 index 000000000..d3214811a --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1.quickbook @@ -0,0 +1,4 @@ +[section:inc1 Include 1] +[heading:inc1_1 Heading 1] +[include:include1a include_id_unbalanced-inc1a.quickbook] +[heading:inc1_2 Heading 2] diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1a.quickbook b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1a.quickbook new file mode 100644 index 000000000..1bc46b4f5 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc1a.quickbook @@ -0,0 +1,3 @@ +[heading:inc1a_1 Heading 1] +[section:inc1a Include 1a] +[heading:inc1a_2 Heading 2] diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2.quickbook b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2.quickbook new file mode 100644 index 000000000..37c313cae --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2.quickbook @@ -0,0 +1,5 @@ +[heading:inc2_1 Heading 1] +[endsect] +[heading:inc2_2 Heading 2] +[include:include2a include_id_unbalanced-inc2a.quickbook] +[heading:inc2_3 Heading 3] diff --git a/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2a.quickbook b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2a.quickbook new file mode 100644 index 000000000..780fb4057 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/include_id_unbalanced-inc2a.quickbook @@ -0,0 +1,3 @@ +[heading:inc2a_1 Heading 1] +[endsect] +[heading:inc2a_2 Heading 2] diff --git a/src/boost/tools/quickbook/test/include/macros-1.5.gold b/src/boost/tools/quickbook/test/include/macros-1.5.gold new file mode 100644 index 000000000..d5e8a5193 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.5.gold @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="macros_test_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Macros Test 1.5</title> + <para> + Foo:macros-inc1.quickbook + </para> + <para> + Defined conditional phrase. + </para> + <itemizedlist> + <listitem> + <simpara> + __foo__ + </simpara> + </listitem> + <listitem> + <simpara> + Defined template:macros-1.5.quickbook + </simpara> + </listitem> + <listitem> + <simpara> + __defined_macro__ + </simpara> + </listitem> + <listitem> + <simpara> + [not_defined_template] + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="underline">_not_defined_macro__</emphasis> + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/include/macros-1.5.gold-html b/src/boost/tools/quickbook/test/include/macros-1.5.gold-html new file mode 100644 index 000000000..e1a985932 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.5.gold-html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Macros Test 1.5 + </h3> + <p> + Foo:macros-inc1.quickbook + </p> + <p> + Defined conditional phrase. + </p> + <ul> + <li> + <div> + __foo__ + </div> + </li> + <li> + <div> + Defined template:macros-1.5.quickbook + </div> + </li> + <li> + <div> + __defined_macro__ + </div> + </li> + <li> + <div> + [not_defined_template] + </div> + </li> + <li> + <div> + <span class="underline">_not_defined_macro__</span> + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/macros-1.5.quickbook b/src/boost/tools/quickbook/test/include/macros-1.5.quickbook new file mode 100644 index 000000000..a63a1f0ca --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.5.quickbook @@ -0,0 +1,13 @@ +[article Macros Test 1.5 +[quickbook 1.5] +] + +[def __defined__] + +[include macros-inc1.quickbook] + +* __foo__ +* [defined_template] +* __defined_macro__ +* [not_defined_template] +* [__not_defined_macro__] diff --git a/src/boost/tools/quickbook/test/include/macros-1.6.gold b/src/boost/tools/quickbook/test/include/macros-1.6.gold new file mode 100644 index 000000000..ec93c05c1 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.6.gold @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="macros_test_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Macros Test 1.6</title> + <para> + Foo:macros-inc1.quickbook + </para> + <para> + Defined conditional phrase. + </para> + <itemizedlist> + <listitem> + <simpara> + __foo__ + </simpara> + </listitem> + <listitem> + <simpara> + [defined_template] + </simpara> + </listitem> + <listitem> + <simpara> + __defined_macro__ + </simpara> + </listitem> + <listitem> + <simpara> + [not_defined_template] + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="underline">_not_defined_macro__</emphasis> + </simpara> + </listitem> + </itemizedlist> + <itemizedlist> + <listitem> + <simpara> + Foo:macros-inc1.quickbook + </simpara> + </listitem> + <listitem> + <simpara> + Defined template:macros-1.6.quickbook + </simpara> + </listitem> + <listitem> + <simpara> + Defined macro:macros-inc1.quickbook + </simpara> + </listitem> + <listitem> + <simpara> + [not_defined_template] + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="underline">_not_defined_macro__</emphasis> + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/include/macros-1.6.gold-html b/src/boost/tools/quickbook/test/include/macros-1.6.gold-html new file mode 100644 index 000000000..bb7a9c6c7 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.6.gold-html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Macros Test 1.6 + </h3> + <p> + Foo:macros-inc1.quickbook + </p> + <p> + Defined conditional phrase. + </p> + <ul> + <li> + <div> + __foo__ + </div> + </li> + <li> + <div> + [defined_template] + </div> + </li> + <li> + <div> + __defined_macro__ + </div> + </li> + <li> + <div> + [not_defined_template] + </div> + </li> + <li> + <div> + <span class="underline">_not_defined_macro__</span> + </div> + </li> + </ul> + <ul> + <li> + <div> + Foo:macros-inc1.quickbook + </div> + </li> + <li> + <div> + Defined template:macros-1.6.quickbook + </div> + </li> + <li> + <div> + Defined macro:macros-inc1.quickbook + </div> + </li> + <li> + <div> + [not_defined_template] + </div> + </li> + <li> + <div> + <span class="underline">_not_defined_macro__</span> + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/macros-1.6.quickbook b/src/boost/tools/quickbook/test/include/macros-1.6.quickbook new file mode 100644 index 000000000..5355c090e --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-1.6.quickbook @@ -0,0 +1,21 @@ +[article Macros Test 1.6 +[quickbook 1.6] +] + +[def __defined__] + +[include macros-inc1.quickbook] + +* __foo__ +* [defined_template] +* __defined_macro__ +* [not_defined_template] +* [__not_defined_macro__] + +[import macros-inc1.quickbook] + +* __foo__ +* [defined_template] +* __defined_macro__ +* [not_defined_template] +* [__not_defined_macro__] diff --git a/src/boost/tools/quickbook/test/include/macros-inc1.quickbook b/src/boost/tools/quickbook/test/include/macros-inc1.quickbook new file mode 100644 index 000000000..f8b6f25bc --- /dev/null +++ b/src/boost/tools/quickbook/test/include/macros-inc1.quickbook @@ -0,0 +1,15 @@ +[def __foo__ Foo:__FILENAME__] + +__foo__ + +[?__defined__ +Defined conditional phrase. +[template defined_template Defined template:__FILENAME__] +[def __defined_macro__ Defined macro:__FILENAME__] +] + +[?__not_defined__ +Not defined conditional phrase. +[template not_defined_template Not defined template:__FILENAME__] +[def __not_defined_macro__ Not defined macro:__FILENAME__] +]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold new file mode 100644 index 000000000..92c948a14 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="nested_compatibility_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Nested Compatibility Test</title> + <section id="nested_compatibility_test.duplicate_name"> + <title><link linkend="nested_compatibility_test.duplicate_name">Duplicate Name</link></title> + <section id="nested_compatibility_test.duplicate_name.nested"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested">Nested + Section 1.5</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested.h0"> + <phrase id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5"/><link + linkend="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5">Nested + Heading 1.5</link> + </bridgehead> + </section> + <section id="nested_compatibility_test.duplicate_name.nested0"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested0">Nested + Section 1.6</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested0.h0"> + <phrase id="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6"/><link + linkend="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6">Nested + Heading 1.6</link> + </bridgehead> + </section> + </section> + <section id="nested_compatibility_test.duplicate_name0"> + <title><link linkend="nested_compatibility_test.duplicate_name0">Duplicate Name</link></title> + <section id="nested_compatibility_test.duplicate_name.nested1"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested1">Nested + Section 1.5</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested.h1"> + <phrase id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5_0"/><link + linkend="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5_0">Nested + Heading 1.5</link> + </bridgehead> + </section> + <section id="nested_compatibility_test.duplicate_name.nested2"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested2">Nested + Section 1.6</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested2.h0"> + <phrase id="nested_compatibility_test.duplicate_name.nested2.nested_heading_1_6"/><link + linkend="nested_compatibility_test.duplicate_name.nested2.nested_heading_1_6">Nested + Heading 1.6</link> + </bridgehead> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold-html b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold-html new file mode 100644 index 000000000..c7fe5f3e4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.gold-html @@ -0,0 +1,76 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Nested Compatibility Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#nested_compatibility_test.duplicate_name">Duplicate Name</a> + </li> + <li> + <a href="#nested_compatibility_test.duplicate_name0">Duplicate Name</a> + </li> + </ul> + </div> + <div id="nested_compatibility_test.duplicate_name"> + <h3> + Duplicate Name + </h3> + <div id="nested_compatibility_test.duplicate_name"> + </div> + <div id="nested_compatibility_test.duplicate_name.nested"> + <h3> + Nested Section 1.5 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested"> + <h4 id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5"> + Nested Heading 1.5 + </h4> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name.nested0"> + <h3> + Nested Section 1.6 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested0"> + <h4 id="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6"> + Nested Heading 1.6 + </h4> + </div> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name0"> + <h3> + Duplicate Name + </h3> + <div id="nested_compatibility_test.duplicate_name0"> + </div> + <div id="nested_compatibility_test.duplicate_name.nested1"> + <h3> + Nested Section 1.5 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested1"> + <h4 id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5_0"> + Nested Heading 1.5 + </h4> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name.nested2"> + <h3> + Nested Section 1.6 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested2"> + <h4 id="nested_compatibility_test.duplicate_name.nested2.nested_heading_1_6"> + Nested Heading 1.6 + </h4> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.quickbook b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.quickbook new file mode 100644 index 000000000..f9d78b1e4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_5.quickbook @@ -0,0 +1,12 @@ +[quickbook 1.5] +[article Nested Compatibility Test] + +[section Duplicate Name] +[include nested_compatibility-inc-1_5.quickbook] +[include nested_compatibility-inc-1_6.quickbook] +[endsect] + +[section Duplicate Name] +[include nested_compatibility-inc-1_5.quickbook] +[include nested_compatibility-inc-1_6.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold new file mode 100644 index 000000000..af09a9e87 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="nested_compatibility_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Nested Compatibility Test</title> + <section id="nested_compatibility_test.duplicate_name"> + <title><link linkend="nested_compatibility_test.duplicate_name">Duplicate Name</link></title> + <section id="nested_compatibility_test.duplicate_name.nested"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested">Nested + Section 1.5</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested.h0"> + <phrase id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5"/><link + linkend="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5">Nested + Heading 1.5</link> + </bridgehead> + </section> + <section id="nested_compatibility_test.duplicate_name.nested0"> + <title><link linkend="nested_compatibility_test.duplicate_name.nested0">Nested + Section 1.6</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name.nested0.h0"> + <phrase id="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6"/><link + linkend="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6">Nested + Heading 1.6</link> + </bridgehead> + </section> + </section> + <section id="nested_compatibility_test.duplicate_name0"> + <title><link linkend="nested_compatibility_test.duplicate_name0">Duplicate Name</link></title> + <section id="nested_compatibility_test.duplicate_name0.nested"> + <title><link linkend="nested_compatibility_test.duplicate_name0.nested">Nested + Section 1.5</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name0.nested.h0"> + <phrase id="nested_compatibility_test.duplicate_name0.nested.nested_heading_1_5"/><link + linkend="nested_compatibility_test.duplicate_name0.nested.nested_heading_1_5">Nested + Heading 1.5</link> + </bridgehead> + </section> + <section id="nested_compatibility_test.duplicate_name0.nested0"> + <title><link linkend="nested_compatibility_test.duplicate_name0.nested0">Nested + Section 1.6</link></title> + <bridgehead renderas="sect4" id="nested_compatibility_test.duplicate_name0.nested0.h0"> + <phrase id="nested_compatibility_test.duplicate_name0.nested0.nested_heading_1_6"/><link + linkend="nested_compatibility_test.duplicate_name0.nested0.nested_heading_1_6">Nested + Heading 1.6</link> + </bridgehead> + </section> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold-html b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold-html new file mode 100644 index 000000000..028e53038 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.gold-html @@ -0,0 +1,76 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Nested Compatibility Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#nested_compatibility_test.duplicate_name">Duplicate Name</a> + </li> + <li> + <a href="#nested_compatibility_test.duplicate_name0">Duplicate Name</a> + </li> + </ul> + </div> + <div id="nested_compatibility_test.duplicate_name"> + <h3> + Duplicate Name + </h3> + <div id="nested_compatibility_test.duplicate_name"> + </div> + <div id="nested_compatibility_test.duplicate_name.nested"> + <h3> + Nested Section 1.5 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested"> + <h4 id="nested_compatibility_test.duplicate_name.nested.nested_heading_1_5"> + Nested Heading 1.5 + </h4> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name.nested0"> + <h3> + Nested Section 1.6 + </h3> + <div id="nested_compatibility_test.duplicate_name.nested0"> + <h4 id="nested_compatibility_test.duplicate_name.nested0.nested_heading_1_6"> + Nested Heading 1.6 + </h4> + </div> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name0"> + <h3> + Duplicate Name + </h3> + <div id="nested_compatibility_test.duplicate_name0"> + </div> + <div id="nested_compatibility_test.duplicate_name0.nested"> + <h3> + Nested Section 1.5 + </h3> + <div id="nested_compatibility_test.duplicate_name0.nested"> + <h4 id="nested_compatibility_test.duplicate_name0.nested.nested_heading_1_5"> + Nested Heading 1.5 + </h4> + </div> + </div> + <div id="nested_compatibility_test.duplicate_name0.nested0"> + <h3> + Nested Section 1.6 + </h3> + <div id="nested_compatibility_test.duplicate_name0.nested0"> + <h4 id="nested_compatibility_test.duplicate_name0.nested0.nested_heading_1_6"> + Nested Heading 1.6 + </h4> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.quickbook b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.quickbook new file mode 100644 index 000000000..8beeb8a06 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-1_6.quickbook @@ -0,0 +1,12 @@ +[quickbook 1.6] +[article Nested Compatibility Test] + +[section Duplicate Name] +[include nested_compatibility-inc-1_5.quickbook] +[include nested_compatibility-inc-1_6.quickbook] +[endsect] + +[section Duplicate Name] +[include nested_compatibility-inc-1_5.quickbook] +[include nested_compatibility-inc-1_6.quickbook] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_5.quickbook b/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_5.quickbook new file mode 100644 index 000000000..3c79855a4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_5.quickbook @@ -0,0 +1,5 @@ +[compatibility-mode 1.5] + +[section:nested Nested Section 1.5] +[heading Nested Heading 1.5] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_6.quickbook b/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_6.quickbook new file mode 100644 index 000000000..d0790840c --- /dev/null +++ b/src/boost/tools/quickbook/test/include/nested_compatibility-inc-1_6.quickbook @@ -0,0 +1,5 @@ +[compatibility-mode 1.6] + +[section:nested Nested Section 1.6] +[heading Nested Heading 1.6] +[endsect] diff --git a/src/boost/tools/quickbook/test/include/section-fail1.quickbook b/src/boost/tools/quickbook/test/include/section-fail1.quickbook new file mode 100644 index 000000000..ea75783e0 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-fail1.quickbook @@ -0,0 +1,6 @@ +[article Include Section Test +[quickbook 1.5] +] + +[include section-inc2.quickbook] +[include section-inc1.quickbook] diff --git a/src/boost/tools/quickbook/test/include/section-fail2.quickbook b/src/boost/tools/quickbook/test/include/section-fail2.quickbook new file mode 100644 index 000000000..26a481104 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-fail2.quickbook @@ -0,0 +1,5 @@ +[article Include Section Test +[quickbook 1.5] +] + +[include section-inc2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/section-inc1.quickbook b/src/boost/tools/quickbook/test/include/section-inc1.quickbook new file mode 100644 index 000000000..9c3fdd824 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-inc1.quickbook @@ -0,0 +1 @@ +[section Mulitple file section] diff --git a/src/boost/tools/quickbook/test/include/section-inc2.quickbook b/src/boost/tools/quickbook/test/include/section-inc2.quickbook new file mode 100644 index 000000000..8acc6a502 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-inc2.quickbook @@ -0,0 +1 @@ +[endsect] diff --git a/src/boost/tools/quickbook/test/include/section-unclosed.gold b/src/boost/tools/quickbook/test/include/section-unclosed.gold new file mode 100644 index 000000000..bea5cea67 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-unclosed.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_section_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Section Test</title> + <section id="include_section_test.mulitple_file_section"> + <title><link linkend="include_section_test.mulitple_file_section">Mulitple file + section</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/section-unclosed.gold-html b/src/boost/tools/quickbook/test/include/section-unclosed.gold-html new file mode 100644 index 000000000..efbdd708a --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-unclosed.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Section Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_section_test.mulitple_file_section">Mulitple file section</a> + </li> + </ul> + </div> + <div id="include_section_test.mulitple_file_section"> + <h3> + Mulitple file section + </h3> + <div id="include_section_test.mulitple_file_section"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/section-unclosed.quickbook b/src/boost/tools/quickbook/test/include/section-unclosed.quickbook new file mode 100644 index 000000000..290cd1633 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section-unclosed.quickbook @@ -0,0 +1,5 @@ +[article Include Section Test +[quickbook 1.5] +] + +[include section-inc1.quickbook] diff --git a/src/boost/tools/quickbook/test/include/section.gold b/src/boost/tools/quickbook/test/include/section.gold new file mode 100644 index 000000000..bea5cea67 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include_section_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Section Test</title> + <section id="include_section_test.mulitple_file_section"> + <title><link linkend="include_section_test.mulitple_file_section">Mulitple file + section</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include/section.gold-html b/src/boost/tools/quickbook/test/include/section.gold-html new file mode 100644 index 000000000..efbdd708a --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section.gold-html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Section Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include_section_test.mulitple_file_section">Mulitple file section</a> + </li> + </ul> + </div> + <div id="include_section_test.mulitple_file_section"> + <h3> + Mulitple file section + </h3> + <div id="include_section_test.mulitple_file_section"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/section.quickbook b/src/boost/tools/quickbook/test/include/section.quickbook new file mode 100644 index 000000000..a570b3524 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/section.quickbook @@ -0,0 +1,6 @@ +[article Include Section Test +[quickbook 1.5] +] + +[include section-inc1.quickbook] +[include section-inc2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_5.gold b/src/boost/tools/quickbook/test/include/source_mode-1_5.gold new file mode 100644 index 000000000..2ed6b7fee --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_5.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="souce_mode_include_" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Souce Mode Include</title> +<programlisting>void main() {}</programlisting> +<programlisting>void main() {} +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_5.gold-html b/src/boost/tools/quickbook/test/include/source_mode-1_5.gold-html new file mode 100644 index 000000000..8781356e2 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_5.gold-html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Souce Mode Include + </h3> +<pre class="programlisting">void main() {}</pre> +<pre class="programlisting">void main() {} +</pre> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_5.quickbook b/src/boost/tools/quickbook/test/include/source_mode-1_5.quickbook new file mode 100644 index 000000000..d5df05bd4 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_5.quickbook @@ -0,0 +1,4 @@ +[article Souce Mode Include [source-mode teletype][quickbook 1.5]] + +[include source_mode-inc1.quickbook] +[include source_mode-inc2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_6.gold b/src/boost/tools/quickbook/test/include/source_mode-1_6.gold new file mode 100644 index 000000000..aa01d2057 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_6.gold @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="souce_mode_include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Souce Mode Include</title> + <article id="source_include_with_no_source_mode" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Source include with no source-mode</title> +<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </article> +<programlisting>void main() {} +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_6.gold-html b/src/boost/tools/quickbook/test/include/source_mode-1_6.gold-html new file mode 100644 index 000000000..c41dbbe70 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_6.gold-html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Souce Mode Include + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#source_include_with_no_source_mode">Source include with no source-mode</a> + </li> + </ul> + </div> +<pre class="programlisting">void main() {} +</pre> + <div id="source_include_with_no_source_mode"> + <h3> + Source include with no source-mode + </h3> +<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/source_mode-1_6.quickbook b/src/boost/tools/quickbook/test/include/source_mode-1_6.quickbook new file mode 100644 index 000000000..fc4243f3b --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-1_6.quickbook @@ -0,0 +1,5 @@ +[source-mode teletype][quickbook 1.6] +[article Souce Mode Include] + +[include source_mode-inc1.quickbook] +[include source_mode-inc2.quickbook] diff --git a/src/boost/tools/quickbook/test/include/source_mode-inc1.quickbook b/src/boost/tools/quickbook/test/include/source_mode-inc1.quickbook new file mode 100644 index 000000000..3cefbe6bc --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-inc1.quickbook @@ -0,0 +1,3 @@ +[article Source include with no source-mode] + + void main() {}
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/source_mode-inc2.quickbook b/src/boost/tools/quickbook/test/include/source_mode-inc2.quickbook new file mode 100644 index 000000000..81dba8a17 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/source_mode-inc2.quickbook @@ -0,0 +1,3 @@ +[/ Source include with no source-mode, and no docinfo.] + + void main() {} diff --git a/src/boost/tools/quickbook/test/include/sub/filename_include1.quickbook b/src/boost/tools/quickbook/test/include/sub/filename_include1.quickbook new file mode 100644 index 000000000..6c57614d5 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/sub/filename_include1.quickbook @@ -0,0 +1,3 @@ +__FILENAME__ + +[include ../filename_include2.quickbook]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/template_include-1_7.gold b/src/boost/tools/quickbook/test/include/template_include-1_7.gold new file mode 100644 index 000000000..163ff30ee --- /dev/null +++ b/src/boost/tools/quickbook/test/include/template_include-1_7.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="template_include_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Template include test</title> + <bridgehead renderas="sect2" id="template_include_test.h0"> + <phrase id="template_include_test.simple_include"/><link linkend="template_include_test.simple_include">Simple + include</link> + </bridgehead> +<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> +</article> diff --git a/src/boost/tools/quickbook/test/include/template_include-1_7.gold-html b/src/boost/tools/quickbook/test/include/template_include-1_7.gold-html new file mode 100644 index 000000000..fdd7ff8c5 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/template_include-1_7.gold-html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Template include test + </h3> + <h2 id="template_include_test.simple_include"> + Simple include + </h2> +<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/template_include-1_7.quickbook b/src/boost/tools/quickbook/test/include/template_include-1_7.quickbook new file mode 100644 index 000000000..19f58fab0 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/template_include-1_7.quickbook @@ -0,0 +1,8 @@ +[article Template include test +[quickbook 1.7] +] + +[template include_foo[name] [include [name].quickbook]] + +[include_foo include-id-inc1] +[include_foo source_mode-inc2] diff --git a/src/boost/tools/quickbook/test/include/templates-1.5.gold b/src/boost/tools/quickbook/test/include/templates-1.5.gold new file mode 100644 index 000000000..7d7e5dd60 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.5.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="templates_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Templates 1.5</title> + <para> + Inline:templates-inc1.quickbook + </para> + <para> + Foo:templates-1.5.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/templates-1.5.gold-html b/src/boost/tools/quickbook/test/include/templates-1.5.gold-html new file mode 100644 index 000000000..c773637b6 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.5.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Templates 1.5 + </h3> + <p> + Inline:templates-inc1.quickbook + </p> + <p> + Foo:templates-1.5.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/templates-1.5.quickbook b/src/boost/tools/quickbook/test/include/templates-1.5.quickbook new file mode 100644 index 000000000..5104ae6fa --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.5.quickbook @@ -0,0 +1,7 @@ +[article Templates 1.5 +[quickbook 1.5] +] + +[include templates-inc1.quickbook] + +[foo]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/include/templates-1.6.gold b/src/boost/tools/quickbook/test/include/templates-1.6.gold new file mode 100644 index 000000000..4e37e5e64 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.6.gold @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="templates_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Templates 1.6</title> + <para> + Inline:templates-inc1.quickbook + </para> + <para> + [foo] + </para> + <para> + Foo:templates-1.6.quickbook + </para> +</article> diff --git a/src/boost/tools/quickbook/test/include/templates-1.6.gold-html b/src/boost/tools/quickbook/test/include/templates-1.6.gold-html new file mode 100644 index 000000000..362390d93 --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.6.gold-html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Templates 1.6 + </h3> + <p> + Inline:templates-inc1.quickbook + </p> + <p> + [foo] + </p> + <p> + Foo:templates-1.6.quickbook + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include/templates-1.6.quickbook b/src/boost/tools/quickbook/test/include/templates-1.6.quickbook new file mode 100644 index 000000000..77d821e4c --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-1.6.quickbook @@ -0,0 +1,11 @@ +[article Templates 1.6 +[quickbook 1.6] +] + +[include templates-inc1.quickbook] + +[foo] + +[import templates-inc1.quickbook] + +[foo] diff --git a/src/boost/tools/quickbook/test/include/templates-inc1.quickbook b/src/boost/tools/quickbook/test/include/templates-inc1.quickbook new file mode 100644 index 000000000..70574627c --- /dev/null +++ b/src/boost/tools/quickbook/test/include/templates-inc1.quickbook @@ -0,0 +1,4 @@ +Inline:__FILENAME__ + +[template foo Foo:__FILENAME__] + diff --git a/src/boost/tools/quickbook/test/include2-1_6.gold b/src/boost/tools/quickbook/test/include2-1_6.gold new file mode 100644 index 000000000..f46759b78 --- /dev/null +++ b/src/boost/tools/quickbook/test/include2-1_6.gold @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Test</title> + <article id="include-sub" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include Test Sub Document</title> + </article> + <section id="include-test.test"> + <title><link linkend="include-test.test">Test</link></title> + <para> + Just testing. + </para> + </section> + <section id="foo.test"> + <title><link linkend="foo.test">Test</link></title> + <para> + Just testing. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/include2-1_6.gold-html b/src/boost/tools/quickbook/test/include2-1_6.gold-html new file mode 100644 index 000000000..6d96cfa32 --- /dev/null +++ b/src/boost/tools/quickbook/test/include2-1_6.gold-html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#include-sub">Include Test Sub Document</a> + </li> + <li> + <a href="#include-test.test">Test</a> + </li> + <li> + <a href="#foo.test">Test</a> + </li> + </ul> + </div> + <div id="include-sub"> + <h3> + Include Test Sub Document + </h3> + </div> + <div id="include-test.test"> + <h3> + Test + </h3> + <div id="include-test.test"> + <p> + Just testing. + </p> + </div> + </div> + <div id="foo.test"> + <h3> + Test + </h3> + <div id="foo.test"> + <p> + Just testing. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/include2-1_6.quickbook b/src/boost/tools/quickbook/test/include2-1_6.quickbook new file mode 100644 index 000000000..66b4897ef --- /dev/null +++ b/src/boost/tools/quickbook/test/include2-1_6.quickbook @@ -0,0 +1,8 @@ +[article Include Test + [quickbook 1.6] + [id include-test] +] + +[include include-inc-1_5.quickbook] +[include include-inc.quickbook] +[include:foo include-inc.quickbook] diff --git a/src/boost/tools/quickbook/test/include_invalid_path1-1_7-fail.quickbook b/src/boost/tools/quickbook/test/include_invalid_path1-1_7-fail.quickbook new file mode 100644 index 000000000..fa7e8e337 --- /dev/null +++ b/src/boost/tools/quickbook/test/include_invalid_path1-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Include invalid path fail +[quickbook 1.7] +] + +[include .\\\/empty-inc.quickbook] diff --git a/src/boost/tools/quickbook/test/include_invalid_path2-1_7-fail.quickbook b/src/boost/tools/quickbook/test/include_invalid_path2-1_7-fail.quickbook new file mode 100644 index 000000000..4f2672840 --- /dev/null +++ b/src/boost/tools/quickbook/test/include_invalid_path2-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Include invalid path fail +[quickbook 1.7] +] + +[include .\\\\empty-inc.quickbook] diff --git a/src/boost/tools/quickbook/test/include_invalid_path3-1_7-fail.quickbook b/src/boost/tools/quickbook/test/include_invalid_path3-1_7-fail.quickbook new file mode 100644 index 000000000..5c99c1143 --- /dev/null +++ b/src/boost/tools/quickbook/test/include_invalid_path3-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Include invalid path fail +[quickbook 1.7] +] + +[include empty\[-/\]inc.quickbook] diff --git a/src/boost/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook b/src/boost/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook new file mode 100644 index 000000000..79a9df667 --- /dev/null +++ b/src/boost/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Unicode glob +[quickbook 1.7] +] + +[include £*.quickbook] diff --git a/src/boost/tools/quickbook/test/include_win_path-1_6-fail.quickbook b/src/boost/tools/quickbook/test/include_win_path-1_6-fail.quickbook new file mode 100644 index 000000000..aff5fd2c3 --- /dev/null +++ b/src/boost/tools/quickbook/test/include_win_path-1_6-fail.quickbook @@ -0,0 +1,5 @@ +[article Include fail for windows path. +[quickbook 1.6] +] + +[include .\empty-inc.quickbook] diff --git a/src/boost/tools/quickbook/test/link-1_1.gold b/src/boost/tools/quickbook/test/link-1_1.gold new file mode 100644 index 000000000..955fdec76 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_1.gold @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="link_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Link tests</title> + <section id="link_tests.different_types_of_links"> + <title>Different types of links</title> + <para> + <ulink url="http://www.boost.org/">http://www.boost.org/</ulink> <ulink url="http://www.boost.org/">Boost</ulink> + <link linkend="link-id">link-id</link> <link linkend="link-id">Link Text</link> + <anchor id="link-id"/><functionname alt="foo">foo</functionname> <functionname + alt="foo">link text</functionname> <classname alt="foo">foo</classname> <classname + alt="foo">link text</classname> <methodname alt="foo">foo</methodname> <methodname + alt="foo">link text</methodname> <enumname alt="foo">foo</enumname> <enumname + alt="foo">link text</enumname> <macroname alt="foo">foo</macroname> <macroname + alt="foo">link text</macroname> <headername alt="foo">foo</headername> <headername + alt="foo">link text</headername> <conceptname alt="foo">foo</conceptname> + <conceptname alt="foo">link text</conceptname> <globalname alt="foo">foo</globalname> + <globalname alt="foo">link text</globalname> + </para> + <para> + <link linkend="link">description</link> + </para> + </section> + <section id="link_tests.side_by_side_links"> + <title>Side-by-side links</title> + <para> + <link linkend="x">x</link> and <link linkend="y">y</link> are two distinct + links, which should be separated by whitespace when they appear together as + in <link linkend="x">x</link> <link linkend="y">y</link>. Also in <link linkend="x">x</link> + <link linkend="y">y</link>, and in <link linkend="x">x</link> <link linkend="y">y</link> + as well. + </para> + </section> + <section id="link_tests.escaping_links"> + <title>Escaping links</title> + <itemizedlist> + <listitem> + <simpara> + <ulink url="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</ulink> + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/link-1_1.gold-html b/src/boost/tools/quickbook/test/link-1_1.gold-html new file mode 100644 index 000000000..92ac75b4e --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_1.gold-html @@ -0,0 +1,68 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Link tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#link_tests.different_types_of_links">Different types of links</a> + </li> + <li> + <a href="#link_tests.side_by_side_links">Side-by-side links</a> + </li> + <li> + <a href="#link_tests.escaping_links">Escaping links</a> + </li> + </ul> + </div> + <div id="link_tests.different_types_of_links"> + <h3> + Different types of links + </h3> + <div id="link_tests.different_types_of_links"> + <p> + <a href="http://www.boost.org/">http://www.boost.org/</a> <a href="http://www.boost.org/">Boost</a> + <a href="#link-id">link-id</a> <a href="#link-id">Link Text</a> <span id="link-id"></span>foo + link text <code>foo</code> <code>link text</code> foo link text foo link + text foo link text foo link text foo link text foo link text + </p> + <p> + <a>description</a> + </p> + </div> + </div> + <div id="link_tests.side_by_side_links"> + <h3> + Side-by-side links + </h3> + <div id="link_tests.side_by_side_links"> + <p> + <a>x</a> and <a>y</a> are two distinct links, which should be separated + by whitespace when they appear together as in <a>x</a> <a>y</a>. Also in + <a>x</a> <a>y</a>, and in <a>x</a> <a>y</a> as well. + </p> + </div> + </div> + <div id="link_tests.escaping_links"> + <h3> + Escaping links + </h3> + <div id="link_tests.escaping_links"> + <ul> + <li> + <div> + <a href="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</a> + </div> + </li> + </ul> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/link-1_1.quickbook b/src/boost/tools/quickbook/test/link-1_1.quickbook new file mode 100644 index 000000000..a22ce70f0 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_1.quickbook @@ -0,0 +1,48 @@ +[article Link tests +] + +[section Different types of links] + +[@http://www.boost.org/] +[@ http://www.boost.org/ Boost] +[link link-id] +[link link-id Link Text] +[#link-id] +[funcref foo] +[funcref foo link text] +[classref foo] +[classref foo link text] +[memberref foo] +[memberref foo link text] +[enumref foo] +[enumref foo link text] +[macroref foo] +[macroref foo link text] +[headerref foo] +[headerref foo link text] +[conceptref foo] +[conceptref foo link text] +[globalref foo] +[globalref foo link text] + +[link link[/ comment]description] + +[endsect] + +[section Side-by-side links] + +[link x] and [link y] are two distinct links, which should be separated by +whitespace when they appear together as in [link x] [link y]. Also in [link x] +[link y], and in +[link x] +[link y] +as well. + +[endsect] + +[section Escaping links] + +* [@http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1 + Boost Trac] + +[endsect] diff --git a/src/boost/tools/quickbook/test/link-1_6.gold b/src/boost/tools/quickbook/test/link-1_6.gold new file mode 100644 index 000000000..587b67be3 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_6.gold @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="link_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Link tests</title> + <section id="link_tests.different_types_of_links"> + <title><link linkend="link_tests.different_types_of_links">Different types of + links</link></title> + <para> + <ulink url="http://www.boost.org/">http://www.boost.org/</ulink> <ulink url="http://www.boost.org/">Boost</ulink> + <link linkend="link-id">link-id</link> <link linkend="link-id">Link Text</link> + <anchor id="link-id"/><functionname alt="foo">foo</functionname> <functionname + alt="foo">link text</functionname> <classname alt="foo">foo</classname> <classname + alt="foo">link text</classname> <methodname alt="foo">foo</methodname> <methodname + alt="foo">link text</methodname> <enumname alt="foo">foo</enumname> <enumname + alt="foo">link text</enumname> <macroname alt="foo">foo</macroname> <macroname + alt="foo">link text</macroname> <headername alt="foo">foo</headername> <headername + alt="foo">link text</headername> <conceptname alt="foo">foo</conceptname> + <conceptname alt="foo">link text</conceptname> <globalname alt="foo">foo</globalname> + <globalname alt="foo">link text</globalname> + </para> + <para> + <link linkend="link">description</link> + </para> + <para> + <link linkend="link[Hello]">description</link> + </para> + </section> + <section id="link_tests.side_by_side_links"> + <title><link linkend="link_tests.side_by_side_links">Side-by-side links</link></title> + <para> + <link linkend="x">x</link> and <link linkend="y">y</link> are two distinct + links, which should be separated by whitespace when they appear together as + in <link linkend="x">x</link> <link linkend="y">y</link>. Also in <link linkend="x">x</link> + <link linkend="y">y</link>, and in <link linkend="x">x</link> <link linkend="y">y</link> + as well. + </para> + </section> + <section id="link_tests.escaping_links"> + <title><link linkend="link_tests.escaping_links">Escaping links</link></title> + <itemizedlist> + <listitem> + <simpara> + <ulink url="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</ulink> + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/link-1_6.gold-html b/src/boost/tools/quickbook/test/link-1_6.gold-html new file mode 100644 index 000000000..f8f9b1a2b --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_6.gold-html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Link tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#link_tests.different_types_of_links">Different types of links</a> + </li> + <li> + <a href="#link_tests.side_by_side_links">Side-by-side links</a> + </li> + <li> + <a href="#link_tests.escaping_links">Escaping links</a> + </li> + </ul> + </div> + <div id="link_tests.different_types_of_links"> + <h3> + Different types of links + </h3> + <div id="link_tests.different_types_of_links"> + <p> + <a href="http://www.boost.org/">http://www.boost.org/</a> <a href="http://www.boost.org/">Boost</a> + <a href="#link-id">link-id</a> <a href="#link-id">Link Text</a> <span id="link-id"></span>foo + link text <code>foo</code> <code>link text</code> foo link text foo link + text foo link text foo link text foo link text foo link text + </p> + <p> + <a>description</a> + </p> + <p> + <a>description</a> + </p> + </div> + </div> + <div id="link_tests.side_by_side_links"> + <h3> + Side-by-side links + </h3> + <div id="link_tests.side_by_side_links"> + <p> + <a>x</a> and <a>y</a> are two distinct links, which should be separated + by whitespace when they appear together as in <a>x</a> <a>y</a>. Also in + <a>x</a> <a>y</a>, and in <a>x</a> <a>y</a> as well. + </p> + </div> + </div> + <div id="link_tests.escaping_links"> + <h3> + Escaping links + </h3> + <div id="link_tests.escaping_links"> + <ul> + <li> + <div> + <a href="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</a> + </div> + </li> + </ul> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/link-1_6.quickbook b/src/boost/tools/quickbook/test/link-1_6.quickbook new file mode 100644 index 000000000..c874a79c6 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_6.quickbook @@ -0,0 +1,52 @@ +[article Link tests +[quickbook 1.6] +] + +[section Different types of links] + +[@http://www.boost.org/] +[@ http://www.boost.org/ Boost] +[link link-id] +[link link-id Link Text] +[#link-id] +[funcref foo] +[funcref foo link text] +[classref foo] +[classref foo link text] +[memberref foo] +[memberref foo link text] +[enumref foo] +[enumref foo link text] +[macroref foo] +[macroref foo link text] +[headerref foo] +[headerref foo link text] +[conceptref foo] +[conceptref foo link text] +[globalref foo] +[globalref foo link text] + +[link link[/ comment]description] + +[link link\[Hello\] description] + + +[endsect] + +[section Side-by-side links] + +[link x] and [link y] are two distinct links, which should be separated by +whitespace when they appear together as in [link x] [link y]. Also in [link x] +[link y], and in +[link x] +[link y] +as well. + +[endsect] + +[section Escaping links] + +* [@http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1 + Boost Trac] + +[endsect] diff --git a/src/boost/tools/quickbook/test/link-1_7-fail.quickbook b/src/boost/tools/quickbook/test/link-1_7-fail.quickbook new file mode 100644 index 000000000..9f2db1fb1 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Link fail test +[quickbook 1.7] +] + +[link something [table]] diff --git a/src/boost/tools/quickbook/test/link-1_7-fail2.quickbook b/src/boost/tools/quickbook/test/link-1_7-fail2.quickbook new file mode 100644 index 000000000..30ac49570 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_7-fail2.quickbook @@ -0,0 +1,6 @@ +[article Link fail test +[quickbook 1.7] +] + +[/ Escapes aren't allowed in links.] +[link '''escaped stuff'''] diff --git a/src/boost/tools/quickbook/test/link-1_7.gold b/src/boost/tools/quickbook/test/link-1_7.gold new file mode 100644 index 000000000..c2e5f0398 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_7.gold @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="link_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Link tests</title> + <section id="link_tests.different_types_of_links"> + <title><link linkend="link_tests.different_types_of_links">Different types of + links</link></title> + <para> + <ulink url="http://www.boost.org/">http://www.boost.org/</ulink> <ulink url="http://www.boost.org/">Boost</ulink> + <link linkend="link-id">link-id</link> <link linkend="link-id">Link Text</link> + <anchor id="link-id"/><functionname alt="foo">foo</functionname> <functionname + alt="foo">link text</functionname> <classname alt="foo">foo</classname> <classname + alt="foo">link text</classname> <methodname alt="foo">foo</methodname> <methodname + alt="foo">link text</methodname> <enumname alt="foo">foo</enumname> <enumname + alt="foo">link text</enumname> <macroname alt="foo">foo</macroname> <macroname + alt="foo">link text</macroname> <headername alt="foo">foo</headername> <headername + alt="foo">link text</headername> <conceptname alt="foo">foo</conceptname> + <conceptname alt="foo">link text</conceptname> <globalname alt="foo">foo</globalname> + <globalname alt="foo">link text</globalname> + </para> + <para> + <link linkend="link">description</link> + </para> + </section> + <section id="link_tests.side_by_side_links"> + <title><link linkend="link_tests.side_by_side_links">Side-by-side links</link></title> + <para> + <link linkend="x">x</link> and <link linkend="y">y</link> are two distinct + links, which should be separated by whitespace when they appear together as + in <link linkend="x">x</link> <link linkend="y">y</link>. Also in <link linkend="x">x</link> + <link linkend="y">y</link>, and in <link linkend="x">x</link> <link linkend="y">y</link> + as well. + </para> + </section> + <section id="link_tests.templates_is_links"> + <title><link linkend="link_tests.templates_is_links">Templates is links....</link></title> + <para> + <link linkend="blah.x2">Templated link?</link> + </para> + <para> + <link linkend="something-one-two">something-one-two</link> <link linkend="something-one-two">something-one-two</link> + <link linkend="something-one-two">something-one-two</link> + </para> + </section> + <section id="link_tests.escaping_links"> + <title><link linkend="link_tests.escaping_links">Escaping links</link></title> + <itemizedlist> + <listitem> + <simpara> + <ulink url="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</ulink> + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/link-1_7.gold-html b/src/boost/tools/quickbook/test/link-1_7.gold-html new file mode 100644 index 000000000..797e6a769 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_7.gold-html @@ -0,0 +1,84 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Link tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#link_tests.different_types_of_links">Different types of links</a> + </li> + <li> + <a href="#link_tests.side_by_side_links">Side-by-side links</a> + </li> + <li> + <a href="#link_tests.templates_is_links">Templates is links....</a> + </li> + <li> + <a href="#link_tests.escaping_links">Escaping links</a> + </li> + </ul> + </div> + <div id="link_tests.different_types_of_links"> + <h3> + Different types of links + </h3> + <div id="link_tests.different_types_of_links"> + <p> + <a href="http://www.boost.org/">http://www.boost.org/</a> <a href="http://www.boost.org/">Boost</a> + <a href="#link-id">link-id</a> <a href="#link-id">Link Text</a> <span id="link-id"></span>foo + link text <code>foo</code> <code>link text</code> foo link text foo link + text foo link text foo link text foo link text foo link text + </p> + <p> + <a>description</a> + </p> + </div> + </div> + <div id="link_tests.side_by_side_links"> + <h3> + Side-by-side links + </h3> + <div id="link_tests.side_by_side_links"> + <p> + <a>x</a> and <a>y</a> are two distinct links, which should be separated + by whitespace when they appear together as in <a>x</a> <a>y</a>. Also in + <a>x</a> <a>y</a>, and in <a>x</a> <a>y</a> as well. + </p> + </div> + </div> + <div id="link_tests.templates_is_links"> + <h3> + Templates is links.... + </h3> + <div id="link_tests.templates_is_links"> + <p> + <a>Templated link?</a> + </p> + <p> + <a>something-one-two</a> <a>something-one-two</a> <a>something-one-two</a> + </p> + </div> + </div> + <div id="link_tests.escaping_links"> + <h3> + Escaping links + </h3> + <div id="link_tests.escaping_links"> + <ul> + <li> + <div> + <a href="http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1">Boost + Trac</a> + </div> + </li> + </ul> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/link-1_7.quickbook b/src/boost/tools/quickbook/test/link-1_7.quickbook new file mode 100644 index 000000000..acfba3188 --- /dev/null +++ b/src/boost/tools/quickbook/test/link-1_7.quickbook @@ -0,0 +1,61 @@ +[article Link tests +[quickbook 1.7] +] + +[section Different types of links] + +[@http://www.boost.org/] +[@ http://www.boost.org/ Boost] +[link link-id] +[link link-id Link Text] +[#link-id] +[funcref foo] +[funcref foo link text] +[classref foo] +[classref foo link text] +[memberref foo] +[memberref foo link text] +[enumref foo] +[enumref foo link text] +[macroref foo] +[macroref foo link text] +[headerref foo] +[headerref foo link text] +[conceptref foo] +[conceptref foo link text] +[globalref foo] +[globalref foo link text] + +[link link[/ comment]description] + +[endsect] + +[section Side-by-side links] + +[link x] and [link y] are two distinct links, which should be separated by +whitespace when they appear together as in [link x] [link y]. Also in [link x] +[link y], and in +[link x] +[link y] +as well. + +[endsect] + +[section Templates is links....] + +[template thing[]x] +[link blah.[thing]2 Templated link?] + +[template link_in_template[x y] [link something-[x]-[y]]] +[link_in_template one two] +[link_in_template one..two] +[link_in_template one .. two ] + +[endsect] + +[section Escaping links] + +* [@http://svn.boost.org/trac/boost/query?status=closed&milestone=Boost+1.34.1 + Boost Trac] + +[endsect] diff --git a/src/boost/tools/quickbook/test/list_test-1_5.gold b/src/boost/tools/quickbook/test/list_test-1_5.gold new file mode 100644 index 000000000..4d25aa7cc --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_5.gold @@ -0,0 +1,402 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="list_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>List Test</title> + <para> + Simple list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + <para> + Simple list: + </para> + <orderedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </orderedlist> + <para> + Two level list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <para> + Two level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + E + </simpara> + </listitem> + <listitem> + <simpara> + F + <itemizedlist> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <orderedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </orderedlist> + <para> + Inconsistent Indentation: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + <itemizedlist> + <listitem> + <simpara> + C1 + </simpara> + </listitem> + <listitem> + <simpara> + C2 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + <listitem> + <simpara> + B4 + </simpara> + </listitem> + <listitem> + <simpara> + B5 + <itemizedlist> + <listitem> + <simpara> + C3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B6 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + </itemizedlist> + <para> + Markup in list: + </para> + <itemizedlist> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <quote>Quoted</quote> + </simpara> + </listitem> + <listitem> + <simpara> + <footnote id="list_test.f0"> + <para> + Footnote + </para> + </footnote> + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 1: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + <listitem> + <simpara> + A4 + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 2: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <section id="list_test.list_immediately_following_markup"> + <title><link linkend="list_test.list_immediately_following_markup">List immediately + following markup</link></title> + <itemizedlist> + <listitem> + <simpara> + One + </simpara> + </listitem> + <listitem> + <simpara> + Two + </simpara> + </listitem> + <listitem> + <simpara> + Three + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="list_test.list_immediately_following_markup_2"> + <title><link linkend="list_test.list_immediately_following_markup_2">List immediately + following markup 2</link></title> + <itemizedlist> + <listitem> + <simpara> + One [section Nested section] + </simpara> + </listitem> + <listitem> + <simpara> + Two [endsect] + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/list_test-1_5.gold-html b/src/boost/tools/quickbook/test/list_test-1_5.gold-html new file mode 100644 index 000000000..6c599de4f --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_5.gold-html @@ -0,0 +1,432 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + List Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#list_test.list_immediately_following_markup">List immediately + following markup</a> + </li> + <li> + <a href="#list_test.list_immediately_following_markup_2">List immediately + following markup 2</a> + </li> + </ul> + </div> + <p> + Simple list: + </p> + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + <p> + Simple list: + </p> + <ol> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ol> + <p> + Two level list: + </p> + <ul> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ul> + <p> + Two level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + E + </div> + </li> + <li> + <div> + F + <ul> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ul> + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ol> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ol> + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ol> + <p> + Inconsistent Indentation: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + <ul> + <li> + <div> + C1 + </div> + </li> + <li> + <div> + C2 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B3 + </div> + </li> + <li> + <div> + B4 + </div> + </li> + <li> + <div> + B5 + <ul> + <li> + <div> + C3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B6 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + </ul> + <p> + Markup in list: + </p> + <ul> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <q>Quoted</q> + </div> + </li> + <li> + <div> + <a id="list_test.f0" href="#footnote-1"><sup class="footnote">[1]</sup></a> + </div> + </li> + </ul> + <p> + Don't end list with comment 1: + </p> + <ul> + <li> + <div> + A1 + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + <li> + <div> + A4 + </div> + </li> + </ul> + <p> + Don't end list with comment 2: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + </div> + </li> + <li> + <div> + B3 + </div> + </li> + </ul> + </div> + </li> + </ul> + <div id="list_test.list_immediately_following_markup"> + <h3> + List immediately following markup + </h3> + <div id="list_test.list_immediately_following_markup"> + <ul> + <li> + <div> + One + </div> + </li> + <li> + <div> + Two + </div> + </li> + <li> + <div> + Three + </div> + </li> + </ul> + </div> + </div> + <div id="list_test.list_immediately_following_markup_2"> + <h3> + List immediately following markup 2 + </h3> + <div id="list_test.list_immediately_following_markup_2"> + <ul> + <li> + <div> + One [section Nested section] + </div> + </li> + <li> + <div> + Two [endsect] + </div> + </li> + </ul> + </div> + </div> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#list_test.f0"><sup>[1]</sup></a> Footnote + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/list_test-1_5.quickbook b/src/boost/tools/quickbook/test/list_test-1_5.quickbook new file mode 100644 index 000000000..64b391a61 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_5.quickbook @@ -0,0 +1,108 @@ +[article List Test +[quickbook 1.5] +] + +Simple list: + +* A +* B + +Simple list: + +#A +#B + +Two level list: + +* A + * A + * B +* B + * A + * B + +Two level list: + +# A + * A + * B +# B + * A + * B + +Three level list: + +# A + * A + * B + * C + * D + * E + * F + * G + * H + +Three level list: + +# A + * A + * B + # C + # D +# G +# H + +Inconsistent Indentation: + +* A1 + * B1 + * B2 + * C1 + * C2 + * B3 + * B4 + * B5 + * C3 + * B6 + * A2 +* A3 + +Markup in list: + +* *Bold* +* [*Bold] +* ["Quoted] +* [footnote Footnote] + +Don't end list with comment 1: + +* A1 +* A2 + +[/ End list?] +* A3 +* A4 + +Don't end list with comment 2: + +* A1 + * B1 + +[/ End list?] + * B2 + * B3 + +[section List immediately following markup] +* One +* Two +* Three + +[endsect] + +[section List immediately following markup 2] +* One +[section Nested section] +* Two +[endsect] + +[endsect] diff --git a/src/boost/tools/quickbook/test/list_test-1_6-fail.quickbook b/src/boost/tools/quickbook/test/list_test-1_6-fail.quickbook new file mode 100644 index 000000000..7ca8a9399 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_6-fail.quickbook @@ -0,0 +1,46 @@ +[article List Test +[quickbook 1.6] +] + +Markup in list: + +* [table [[Heading]][[Cell]]] +* [heading The heading for a list item] + + The content of the list item. + +[section Paragraphs in list items] + +* A1 + + A2 + +* B1 + * C1 + + C2 + + B2 + +* D1 + * E1 + + E2 + + E3 + + D2 + +[endsect] + +[section Indented code blocks in lists] + +* A + + B + C +* D + + E +* F +[endsect] diff --git a/src/boost/tools/quickbook/test/list_test-1_6.gold b/src/boost/tools/quickbook/test/list_test-1_6.gold new file mode 100644 index 000000000..b6d3775a6 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_6.gold @@ -0,0 +1,450 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="list_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>List Test</title> + <para> + Simple list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + <para> + Simple list: + </para> + <orderedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </orderedlist> + <para> + Two level list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <para> + Two level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + E + </simpara> + </listitem> + <listitem> + <simpara> + F + <itemizedlist> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <orderedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </orderedlist> + <para> + Inconsistent Indentation: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + <itemizedlist> + <listitem> + <simpara> + C1 + </simpara> + </listitem> + <listitem> + <simpara> + C2 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + <listitem> + <simpara> + B4 + </simpara> + </listitem> + <listitem> + <simpara> + B5 + <itemizedlist> + <listitem> + <simpara> + C3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B6 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + </itemizedlist> + <para> + Markup in list: + </para> + <itemizedlist> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <quote>Quoted</quote> + </simpara> + </listitem> + <listitem> + <simpara> + <footnote id="list_test.f0"> + <para> + Footnote + </para> + </footnote> + </simpara> + </listitem> + <listitem> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <simpara> + Some text. + </simpara> + </listitem> + <listitem> + <simpara> + [section Doesn't expand] Blah, blah. [endsect] + </simpara> + </listitem> + <listitem> + <simpara> + Paragraph cheat 1. + </simpara> + <simpara> + Paragraph cheat 2. + </simpara> + </listitem> + <listitem> + <simpara> + Paragraph cheat 3. + </simpara> + <simpara> + Paragraph cheat 4. + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 1: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + <listitem> + <simpara> + A4 + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 2: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <section id="list_test.list_immediately_following_marku"> + <title><link linkend="list_test.list_immediately_following_marku">List immediately + following markup</link></title> + <itemizedlist> + <listitem> + <simpara> + One + </simpara> + </listitem> + <listitem> + <simpara> + Two + </simpara> + </listitem> + <listitem> + <simpara> + Three + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="list_test.list_immediately_following_mark0"> + <title><link linkend="list_test.list_immediately_following_mark0">List immediately + following markup 2</link></title> + <itemizedlist> + <listitem> + <simpara> + One [section Nested section] + </simpara> + </listitem> + <listitem> + <simpara> + Two [endsect] + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/list_test-1_6.gold-html b/src/boost/tools/quickbook/test/list_test-1_6.gold-html new file mode 100644 index 000000000..c8ca7a85c --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_6.gold-html @@ -0,0 +1,480 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + List Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#list_test.list_immediately_following_marku">List immediately + following markup</a> + </li> + <li> + <a href="#list_test.list_immediately_following_mark0">List immediately + following markup 2</a> + </li> + </ul> + </div> + <p> + Simple list: + </p> + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + <p> + Simple list: + </p> + <ol> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ol> + <p> + Two level list: + </p> + <ul> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ul> + <p> + Two level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + E + </div> + </li> + <li> + <div> + F + <ul> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ul> + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ol> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ol> + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ol> + <p> + Inconsistent Indentation: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + <ul> + <li> + <div> + C1 + </div> + </li> + <li> + <div> + C2 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B3 + </div> + </li> + <li> + <div> + B4 + </div> + </li> + <li> + <div> + B5 + <ul> + <li> + <div> + C3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B6 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + </ul> + <p> + Markup in list: + </p> + <ul> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <q>Quoted</q> + </div> + </li> + <li> + <div> + <a id="list_test.f0" href="#footnote-1"><sup class="footnote">[1]</sup></a> + </div> + </li> + <li> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div> + Some text. + </div> + </li> + <li> + <div> + [section Doesn't expand] Blah, blah. [endsect] + </div> + </li> + <li> + <div> + Paragraph cheat 1. + </div> + <div> + Paragraph cheat 2. + </div> + </li> + <li> + <div> + Paragraph cheat 3. + </div> + <div> + Paragraph cheat 4. + </div> + </li> + </ul> + <p> + Don't end list with comment 1: + </p> + <ul> + <li> + <div> + A1 + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + <li> + <div> + A4 + </div> + </li> + </ul> + <p> + Don't end list with comment 2: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + </div> + </li> + <li> + <div> + B3 + </div> + </li> + </ul> + </div> + </li> + </ul> + <div id="list_test.list_immediately_following_marku"> + <h3> + List immediately following markup + </h3> + <div id="list_test.list_immediately_following_marku"> + <ul> + <li> + <div> + One + </div> + </li> + <li> + <div> + Two + </div> + </li> + <li> + <div> + Three + </div> + </li> + </ul> + </div> + </div> + <div id="list_test.list_immediately_following_mark0"> + <h3> + List immediately following markup 2 + </h3> + <div id="list_test.list_immediately_following_mark0"> + <ul> + <li> + <div> + One [section Nested section] + </div> + </li> + <li> + <div> + Two [endsect] + </div> + </li> + </ul> + </div> + </div> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#list_test.f0"><sup>[1]</sup></a> Footnote + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/list_test-1_6.quickbook b/src/boost/tools/quickbook/test/list_test-1_6.quickbook new file mode 100644 index 000000000..fe1e18756 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_6.quickbook @@ -0,0 +1,120 @@ +[article List Test +[quickbook 1.6] +] + +Simple list: + +* A +* B + +Simple list: + +#A +#B + +Two level list: + +* A + * A + * B +* B + * A + * B + +Two level list: + +# A + * A + * B +# B + * A + * B + +Three level list: + +# A + * A + * B + * C + * D + * E + * F + * G + * H + +Three level list: + +# A + * A + * B + # C + # D +# G +# H + +Inconsistent Indentation: + +* A1 + * B1 + * B2 + * C1 + * C2 + * B3 + * B4 + * B5 + * C3 + * B6 + * A2 +* A3 + +Markup in list: + +* *Bold* +* [*Bold] +* ["Quoted] +* [footnote Footnote] +* [table [[Heading]][[Cell]]] + Some text. +* [section Doesn't expand] + Blah, blah. + [endsect] + +* Paragraph cheat 1. + [block] + Paragraph cheat 2. +* Paragraph cheat 3. + [block] + Paragraph cheat 4. + +Don't end list with comment 1: + +* A1 +* A2 + +[/ End list?] +* A3 +* A4 + +Don't end list with comment 2: + +* A1 + * B1 + +[/ End list?] + * B2 + * B3 + +[section List immediately following markup] +* One +* Two +* Three + +[endsect] + +[section List immediately following markup 2] +* One +[section Nested section] +* Two +[endsect] + +[endsect] diff --git a/src/boost/tools/quickbook/test/list_test-1_7-fail1.quickbook b/src/boost/tools/quickbook/test/list_test-1_7-fail1.quickbook new file mode 100644 index 000000000..c8beed1c5 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_7-fail1.quickbook @@ -0,0 +1,9 @@ +[article List Fail Test 1 +[quickbook 1.7] +] + +[section List immediately following markup] +* One +* Two +* Three +[endsect] diff --git a/src/boost/tools/quickbook/test/list_test-1_7.gold b/src/boost/tools/quickbook/test/list_test-1_7.gold new file mode 100644 index 000000000..dec074c74 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_7.gold @@ -0,0 +1,479 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="list_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>List Test</title> + <para> + Simple list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + <para> + Simple list: + </para> + <orderedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </orderedlist> + <para> + Two level list: + </para> + <itemizedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <para> + Two level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <itemizedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + E + </simpara> + </listitem> + <listitem> + <simpara> + F + <itemizedlist> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + <para> + Three level list: + </para> + <orderedlist> + <listitem> + <simpara> + A + <itemizedlist> + <listitem> + <simpara> + A + </simpara> + </listitem> + <listitem> + <simpara> + B + <orderedlist> + <listitem> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + G + </simpara> + </listitem> + <listitem> + <simpara> + H + </simpara> + </listitem> + </orderedlist> + <para> + Inconsistent Indentation: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + <itemizedlist> + <listitem> + <simpara> + C1 + </simpara> + </listitem> + <listitem> + <simpara> + C2 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + <listitem> + <simpara> + B4 + </simpara> + </listitem> + <listitem> + <simpara> + B5 + <itemizedlist> + <listitem> + <simpara> + C3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + B6 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + </itemizedlist> + <para> + Markup in list: + </para> + <itemizedlist> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <emphasis role="bold">Bold</emphasis> + </simpara> + </listitem> + <listitem> + <simpara> + <quote>Quoted</quote> + </simpara> + </listitem> + <listitem> + <simpara> + <footnote id="list_test.f0"> + <para> + Footnote + </para> + </footnote> + </simpara> + </listitem> + <listitem> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </listitem> + <listitem> + <bridgehead renderas="sect2" id="list_test.h0"> + <phrase id="list_test.the_heading_for_a_list_item"/><link linkend="list_test.the_heading_for_a_list_item">The + heading for a list item</link> + </bridgehead> + <simpara> + The content of the list item. + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 1: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + </simpara> + </listitem> + <listitem> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + A3 + </simpara> + </listitem> + <listitem> + <simpara> + A4 + </simpara> + </listitem> + </itemizedlist> + <para> + Don't end list with comment 2: + </para> + <itemizedlist> + <listitem> + <simpara> + A1 + <itemizedlist> + <listitem> + <simpara> + B1 + </simpara> + </listitem> + <listitem> + <simpara> + B2 + </simpara> + </listitem> + <listitem> + <simpara> + B3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </itemizedlist> + <section id="list_test.paragraphs_in_list_items"> + <title><link linkend="list_test.paragraphs_in_list_items">Paragraphs in list + items</link></title> + <itemizedlist> + <listitem> + <simpara> + A1 + </simpara> + <simpara> + A2 + </simpara> + </listitem> + <listitem> + <simpara> + B1 + <itemizedlist> + <listitem> + <simpara> + C1 + </simpara> + <simpara> + C2 + </simpara> + </listitem> + </itemizedlist> + </simpara> + <simpara> + B2 + </simpara> + </listitem> + <listitem> + <simpara> + D1 + <itemizedlist> + <listitem> + <simpara> + E1 + </simpara> + <simpara> + E2 + </simpara> + <simpara> + E3 + </simpara> + </listitem> + </itemizedlist> + </simpara> + <simpara> + D2 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="list_test.indented_code_blocks_in_lists"> + <title><link linkend="list_test.indented_code_blocks_in_lists">Indented code + blocks in lists</link></title> + <itemizedlist> + <listitem> + <simpara> + A + </simpara> +<programlisting><phrase role="identifier">B</phrase> +</programlisting> + <simpara> + C + </simpara> + </listitem> + <listitem> + <simpara> + D + </simpara> +<programlisting><phrase role="identifier">E</phrase> +</programlisting> + </listitem> + <listitem> + <simpara> + F + </simpara> + </listitem> + </itemizedlist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/list_test-1_7.gold-html b/src/boost/tools/quickbook/test/list_test-1_7.gold-html new file mode 100644 index 000000000..9d7b78eac --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_7.gold-html @@ -0,0 +1,507 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + List Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#list_test.paragraphs_in_list_items">Paragraphs in list items</a> + </li> + <li> + <a href="#list_test.indented_code_blocks_in_lists">Indented code blocks + in lists</a> + </li> + </ul> + </div> + <p> + Simple list: + </p> + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + <p> + Simple list: + </p> + <ol> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ol> + <p> + Two level list: + </p> + <ul> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ul> + <p> + Two level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ul> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + E + </div> + </li> + <li> + <div> + F + <ul> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ul> + </div> + </li> + </ul> + </div> + </li> + </ol> + <p> + Three level list: + </p> + <ol> + <li> + <div> + A + <ul> + <li> + <div> + A + </div> + </li> + <li> + <div> + B + <ol> + <li> + <div> + C + </div> + </li> + <li> + <div> + D + </div> + </li> + </ol> + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + G + </div> + </li> + <li> + <div> + H + </div> + </li> + </ol> + <p> + Inconsistent Indentation: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + <ul> + <li> + <div> + C1 + </div> + </li> + <li> + <div> + C2 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B3 + </div> + </li> + <li> + <div> + B4 + </div> + </li> + <li> + <div> + B5 + <ul> + <li> + <div> + C3 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + B6 + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + </ul> + <p> + Markup in list: + </p> + <ul> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <span class="bold"><strong>Bold</strong></span> + </div> + </li> + <li> + <div> + <q>Quoted</q> + </div> + </li> + <li> + <div> + <a id="list_test.f0" href="#footnote-1"><sup class="footnote">[1]</sup></a> + </div> + </li> + <li> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + </li> + <li> + <h2 id="list_test.the_heading_for_a_list_item"> + The heading for a list item + </h2> + <div> + The content of the list item. + </div> + </li> + </ul> + <p> + Don't end list with comment 1: + </p> + <ul> + <li> + <div> + A1 + </div> + </li> + <li> + <div> + A2 + </div> + </li> + <li> + <div> + A3 + </div> + </li> + <li> + <div> + A4 + </div> + </li> + </ul> + <p> + Don't end list with comment 2: + </p> + <ul> + <li> + <div> + A1 + <ul> + <li> + <div> + B1 + </div> + </li> + <li> + <div> + B2 + </div> + </li> + <li> + <div> + B3 + </div> + </li> + </ul> + </div> + </li> + </ul> + <div id="list_test.paragraphs_in_list_items"> + <h3> + Paragraphs in list items + </h3> + <div id="list_test.paragraphs_in_list_items"> + <ul> + <li> + <div> + A1 + </div> + <div> + A2 + </div> + </li> + <li> + <div> + B1 + <ul> + <li> + <div> + C1 + </div> + <div> + C2 + </div> + </li> + </ul> + </div> + <div> + B2 + </div> + </li> + <li> + <div> + D1 + <ul> + <li> + <div> + E1 + </div> + <div> + E2 + </div> + <div> + E3 + </div> + </li> + </ul> + </div> + <div> + D2 + </div> + </li> + </ul> + </div> + </div> + <div id="list_test.indented_code_blocks_in_lists"> + <h3> + Indented code blocks in lists + </h3> + <div id="list_test.indented_code_blocks_in_lists"> + <ul> + <li> + <div> + A + </div> +<pre class="programlisting"><span class="identifier">B</span> +</pre> + <div> + C + </div> + </li> + <li> + <div> + D + </div> +<pre class="programlisting"><span class="identifier">E</span> +</pre> + </li> + <li> + <div> + F + </div> + </li> + </ul> + </div> + </div> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#list_test.f0"><sup>[1]</sup></a> Footnote + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/list_test-1_7.quickbook b/src/boost/tools/quickbook/test/list_test-1_7.quickbook new file mode 100644 index 000000000..8eac6a718 --- /dev/null +++ b/src/boost/tools/quickbook/test/list_test-1_7.quickbook @@ -0,0 +1,134 @@ +[article List Test +[quickbook 1.7] +] + +Simple list: + +* A +* B + +Simple list: + +#A +#B + +Two level list: + +* A + * A + * B +* B + * A + * B + +Two level list: + +# A + * A + * B +# B + * A + * B + +Three level list: + +# A + * A + * B + * C + * D + * E + * F + * G + * H + +Three level list: + +# A + * A + * B + # C + # D +# G +# H + +Inconsistent Indentation: + +* A1 + * B1 + * B2 + * C1 + * C2 + * B3 + * B4 + * B5 + * C3 + * B6 + * A2 +* A3 + +Markup in list: + +* *Bold* +* [*Bold] +* ["Quoted] +* [footnote Footnote] +* [table [[Heading]][[Cell]]] +* [heading The heading for a list item] + + The content of the list item. + +Don't end list with comment 1: + +* A1 +* A2 + +[/ End list?] +* A3 +* A4 + +Don't end list with comment 2: + +* A1 + * B1 + +[/ End list?] + * B2 + * B3 + +[section Paragraphs in list items] + +* A1 + + A2 + +* B1 + * C1 + + C2 + + B2 + +* D1 + * E1 + + E2 + + E3 + + D2 + +[endsect] + +[section Indented code blocks in lists] + +* A + + B + C +* D + + E +* F + +[endsect] diff --git a/src/boost/tools/quickbook/test/macro-1_5.gold b/src/boost/tools/quickbook/test/macro-1_5.gold new file mode 100644 index 000000000..aec771a0c --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_5.gold @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="macro_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Macro Test</title> + <para> + 1 + </para> + <para> + 2 + </para> + <para> + two + </para> + <para> + 1 + </para> + <para> + 1 + </para> + <para> + 1 + </para> + <para> + 1 2 + </para> +</article> diff --git a/src/boost/tools/quickbook/test/macro-1_5.gold-html b/src/boost/tools/quickbook/test/macro-1_5.gold-html new file mode 100644 index 000000000..b2ffd0edd --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_5.gold-html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Macro Test + </h3> + <p> + 1 + </p> + <p> + 2 + </p> + <p> + two + </p> + <p> + 1 + </p> + <p> + 1 + </p> + <p> + 1 + </p> + <p> + 1 2 + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/macro-1_5.quickbook b/src/boost/tools/quickbook/test/macro-1_5.quickbook new file mode 100644 index 000000000..165ad1b92 --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_5.quickbook @@ -0,0 +1,34 @@ +[article Macro Test +[quickbook 1.5] +] + +[def one 1] + +one + +[template foo[] + +[def two 2] +two +] + +[foo] +two [/This shouldn't expand] + + +[def __foo__ 1] +[def __foo__ 2] +__foo__ + +[template foo2[] +[def __foo__ 3] +__foo__ +] + +[foo2] +__foo__ + +[def __crazy[macro__ 1] +[def __crazy\macro__ 2] +__crazy[macro__ +__crazy\macro__
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/macro-1_6.gold b/src/boost/tools/quickbook/test/macro-1_6.gold new file mode 100644 index 000000000..291ddf1f9 --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_6.gold @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="macro_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Macro Test</title> + <para> + 1 + </para> + <para> + 2 + </para> + <para> + two + </para> + <para> + 2 + </para> + <para> + 3 + </para> + <para> + 2 + </para> + <para> + [1] \m2 + </para> +</article> diff --git a/src/boost/tools/quickbook/test/macro-1_6.gold-html b/src/boost/tools/quickbook/test/macro-1_6.gold-html new file mode 100644 index 000000000..f49236233 --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_6.gold-html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Macro Test + </h3> + <p> + 1 + </p> + <p> + 2 + </p> + <p> + two + </p> + <p> + 2 + </p> + <p> + 3 + </p> + <p> + 2 + </p> + <p> + [1] \m2 + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/macro-1_6.quickbook b/src/boost/tools/quickbook/test/macro-1_6.quickbook new file mode 100644 index 000000000..43f8cbc0a --- /dev/null +++ b/src/boost/tools/quickbook/test/macro-1_6.quickbook @@ -0,0 +1,34 @@ +[article Macro Test +[quickbook 1.6] +] + +[def one 1] + +one + +[template foo[] + +[def two 2] +two +] + +[foo] +two [/This shouldn't expand] + + +[def __foo__ 1] +[def __foo__ 2] +__foo__ + +[template foo2[] +[def __foo__ 3] +__foo__ +] + +[foo2] +__foo__ + +[def __crazy[1]] +[def __crazy2\m2] +__crazy +__crazy2
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/mismatched_brackets-1_1-fail.quickbook b/src/boost/tools/quickbook/test/mismatched_brackets-1_1-fail.quickbook new file mode 100644 index 000000000..e3db0daa2 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets-1_1-fail.quickbook @@ -0,0 +1,5 @@ +[article Mismatched brackets] + +[template foo Oops] +[template blah Eek +[foo] diff --git a/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold new file mode 100644 index 000000000..f6fbff497 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="mismatched_brackets" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Mismatched brackets</title> + <para> + [foo + </para> + <para> + Eek + </para> +</article> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold-html b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold-html new file mode 100644 index 000000000..a0c96eb7a --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Mismatched brackets + </h3> + <p> + [foo + </p> + <p> + Eek + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.quickbook b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.quickbook new file mode 100644 index 000000000..a0cfb77b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets1-1_1.quickbook @@ -0,0 +1,7 @@ +[article Mismatched brackets] + +[template foo Oops] + +[foo +[template blah Eek] +[blah]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/mismatched_brackets1-1_7.quickbook b/src/boost/tools/quickbook/test/mismatched_brackets1-1_7.quickbook new file mode 100644 index 000000000..2303fa8e8 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets1-1_7.quickbook @@ -0,0 +1,8 @@ +[quickbook 1.7] +[article Mismatched brackets] + +[template foo Oops] + +[foo +[template blah Eek] +[blah] diff --git a/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold new file mode 100644 index 000000000..bdbb114c7 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="mismatched_brackets" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Mismatched brackets</title> + <para> + [foo Eek + </para> +</article> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold-html b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold-html new file mode 100644 index 000000000..27c42db45 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.gold-html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Mismatched brackets + </h3> + <p> + [foo Eek + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.quickbook b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.quickbook new file mode 100644 index 000000000..271fee8af --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets2-1_1.quickbook @@ -0,0 +1,7 @@ +[article Mismatched brackets] + +[template foo Oops] +[template blah Eek] + +[foo +[blah]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold new file mode 100644 index 000000000..a7ab11e83 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="mismatched_brackets" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Mismatched brackets</title> + <section id="mismatched_brackets.something"> + <title>Something</title> + </section> + <para> + ] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold-html b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold-html new file mode 100644 index 000000000..a63ee3a63 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.gold-html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Mismatched brackets + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#mismatched_brackets.something">Something</a> + </li> + </ul> + </div> + <p> + ] + </p> + <div id="mismatched_brackets.something"> + <h3> + Something + </h3> + <div id="mismatched_brackets.something"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.quickbook b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.quickbook new file mode 100644 index 000000000..dadd42692 --- /dev/null +++ b/src/boost/tools/quickbook/test/mismatched_brackets3-1_1.quickbook @@ -0,0 +1,6 @@ +[article Mismatched brackets] + +[section Something] + +[endsect] +] diff --git a/src/boost/tools/quickbook/test/newline-1_1.gold b/src/boost/tools/quickbook/test/newline-1_1.gold new file mode 100644 index 000000000..716acca12 --- /dev/null +++ b/src/boost/tools/quickbook/test/newline-1_1.gold @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="test_newlines" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Test newlines</title> + <para> + Line 1<sbr/> Line 2 + </para> + <blockquote> + <para> + <quote>It is better to be approximately right than exactly wrong.</quote><sbr/> + <emphasis>-- Old adage</emphasis> + </para> + </blockquote> + <para> + Line 1<sbr/> Line 2 + </para> + <blockquote> + <para> + <quote>It is better to be approximately right than exactly wrong.</quote><sbr/> + <emphasis>-- Old adage</emphasis> + </para> + </blockquote> +</article> diff --git a/src/boost/tools/quickbook/test/newline-1_1.gold-html b/src/boost/tools/quickbook/test/newline-1_1.gold-html new file mode 100644 index 000000000..ea82594a1 --- /dev/null +++ b/src/boost/tools/quickbook/test/newline-1_1.gold-html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test newlines + </h3> + <p> + Line 1<br/> Line 2 + </p> + <blockquote> + <p> + <q>It is better to be approximately right than exactly wrong.</q><br/> <span + class="emphasis"><em>-- Old adage</em></span> + </p> + </blockquote> + <p> + Line 1<br/> Line 2 + </p> + <blockquote> + <p> + <q>It is better to be approximately right than exactly wrong.</q><br/> <span + class="emphasis"><em>-- Old adage</em></span> + </p> + </blockquote> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/newline-1_1.quickbook b/src/boost/tools/quickbook/test/newline-1_1.quickbook new file mode 100644 index 000000000..6476f6a40 --- /dev/null +++ b/src/boost/tools/quickbook/test/newline-1_1.quickbook @@ -0,0 +1,10 @@ +[article Test newlines +] + +Line 1\nLine 2 + +[:["It is better to be approximately right than exactly wrong.]\n['-- Old adage]] + +Line 1[br]Line 2 + +[:["It is better to be approximately right than exactly wrong.][br]['-- Old adage]]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/para_test-1_5.gold b/src/boost/tools/quickbook/test/para_test-1_5.gold new file mode 100644 index 000000000..1a8f17d6a --- /dev/null +++ b/src/boost/tools/quickbook/test/para_test-1_5.gold @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="paragraph_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Paragraph Test</title> + <section id="paragraph_test.some_paragraphs"> + <title><link linkend="paragraph_test.some_paragraphs">Some Paragraphs</link></title> + <para> + Shouldn't be a code block. + </para> + <para> + <emphasis role="bold">Should be bold</emphasis>. + </para> + <para> + Should be a single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Lots of newlines round this paragraph. + </para> + <para> + Last paragraph. + </para> + </section> + <section id="paragraph_test.inside___breaking_comment__blocks"> + <title><link linkend="paragraph_test.inside___breaking_comment__blocks">Inside + blocks</link></title> + <variablelist> + <title></title> + <varlistentry> + <term>Paragraphs</term> + <listitem> + <para> + Shouldn't be a code block. + </para> + <para> + <emphasis role="bold">Should be bold</emphasis>. + </para> + <para> + Should be a single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Single paragraph. + </para> + <para> + Lots of newlines round this paragraph. + </para> + <para> + Last paragraph. + </para> + </listitem> + </varlistentry> + </variablelist> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/para_test-1_5.gold-html b/src/boost/tools/quickbook/test/para_test-1_5.gold-html new file mode 100644 index 000000000..92018efc5 --- /dev/null +++ b/src/boost/tools/quickbook/test/para_test-1_5.gold-html @@ -0,0 +1,97 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Paragraph Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#paragraph_test.some_paragraphs">Some Paragraphs</a> + </li> + <li> + <a href="#paragraph_test.inside___breaking_comment__blocks">Inside blocks</a> + </li> + </ul> + </div> + <div id="paragraph_test.some_paragraphs"> + <h3> + Some Paragraphs + </h3> + <div id="paragraph_test.some_paragraphs"> + <p> + Shouldn't be a code block. + </p> + <p> + <span class="bold"><strong>Should be bold</strong></span>. + </p> + <p> + Should be a single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Lots of newlines round this paragraph. + </p> + <p> + Last paragraph. + </p> + </div> + </div> + <div id="paragraph_test.inside___breaking_comment__blocks"> + <h3> + Inside blocks + </h3> + <div id="paragraph_test.inside___breaking_comment__blocks"> + <dl> + <dt> + Paragraphs + </dt> + <dd> + <p> + Shouldn't be a code block. + </p> + <p> + <span class="bold"><strong>Should be bold</strong></span>. + </p> + <p> + Should be a single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Single paragraph. + </p> + <p> + Lots of newlines round this paragraph. + </p> + <p> + Last paragraph. + </p> + </dd> + </dl> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/para_test-1_5.quickbook b/src/boost/tools/quickbook/test/para_test-1_5.quickbook new file mode 100644 index 000000000..8a099bce5 --- /dev/null +++ b/src/boost/tools/quickbook/test/para_test-1_5.quickbook @@ -0,0 +1,81 @@ +[article Paragraph Test + [quickbook 1.5] +] + +[section Some Paragraphs] + +[/ Leading comment ] Shouldn't be a code block. + +[/ Leading comment ]*Should be bold*. + +Should be a +[/ Breaking comment] +single paragraph. + +Single paragraph. +[/ Breaking comment] + +Single paragraph. + +[/ Breaking comment] +Single paragraph. + +Single paragraph.[/ Trailing comment] + + + + + + +Lots of newlines round this paragraph. + + + + + + + + +Last paragraph.[endsect] + +[section Inside +[/Breaking comment] +blocks] + +[variablelist +[[Paragraphs][ +[/ Leading comment ] Shouldn't be a code block. + +[/ Leading comment ]*Should be bold*. + +Should be a +[/ Breaking comment] +single paragraph. + +Single paragraph. +[/ Breaking comment] + +Single paragraph. + +[/ Breaking comment] +Single paragraph. + +Single paragraph.[/ Trailing comment] + + + + + + +Lots of newlines round this paragraph. + + + + + + + + +Last paragraph.]]] + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/post_process-fail.quickbook b/src/boost/tools/quickbook/test/post_process-fail.quickbook new file mode 100644 index 000000000..994a63574 --- /dev/null +++ b/src/boost/tools/quickbook/test/post_process-fail.quickbook @@ -0,0 +1,3 @@ +[article Fail post process due to invalid embedded xml [quickbook 1.4] ] + +Invalid xml follows: '''<!--quickbook-escape-postfix--><>''' diff --git a/src/boost/tools/quickbook/test/preformatted-1_1.gold b/src/boost/tools/quickbook/test/preformatted-1_1.gold new file mode 100644 index 000000000..a92b3f55a --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_1.gold @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="preformatted" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Preformatted</title> + <section id="preformatted.preformatted"> + <title>Preformatted</title> + <para> + Here's the ubiquitous <emphasis>Hello World</emphasis> program in C++. + </para> +<programlisting>#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +</programlisting> + <para> + The code should appear as a single block of code in a monospaced font and with + no syntax highlighting. The fifth and sixth lines should appear indented to + the right, aligning under <code><phrase role="identifier">main</phrase></code>, + on line 3. + </para> + <para> + Here's a one line function definitition: + </para> +<programlisting>void something(); </programlisting> + <para> + . + </para> + <para> + And some indented code: + </para> +<programlisting>void go() + { + } +</programlisting> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/preformatted-1_1.gold-html b/src/boost/tools/quickbook/test/preformatted-1_1.gold-html new file mode 100644 index 000000000..e25c047f5 --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_1.gold-html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Preformatted + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#preformatted.preformatted">Preformatted</a> + </li> + </ul> + </div> + <div id="preformatted.preformatted"> + <h3> + Preformatted + </h3> + <div id="preformatted.preformatted"> + <p> + Here's the ubiquitous <span class="emphasis"><em>Hello World</em></span> + program in C++. + </p> +<pre class="programlisting">#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +</pre> + <p> + The code should appear as a single block of code in a monospaced font and + with no syntax highlighting. The fifth and sixth lines should appear indented + to the right, aligning under <code><span class="identifier">main</span></code>, + on line 3. + </p> + <p> + Here's a one line function definitition: + </p> +<pre class="programlisting">void something(); </pre> + <p> + . + </p> + <p> + And some indented code: + </p> +<pre class="programlisting">void go() + { + } +</pre> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/preformatted-1_1.quickbook b/src/boost/tools/quickbook/test/preformatted-1_1.quickbook new file mode 100644 index 000000000..e41f83b5d --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_1.quickbook @@ -0,0 +1,32 @@ +[article Preformatted +] + +[section Preformatted] + +Here's the ubiquitous /Hello World/ program in C++. + +[pre +#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +] + +The code should appear as a single block of code in a monospaced font and with +no syntax highlighting. The fifth and sixth lines should appear indented to the +right, aligning under `main`, on line 3. + +Here's a one line function definitition: [pre void something(); ]. + +And some indented code: + +[pre + void go() + { + } +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/preformatted-1_6.gold b/src/boost/tools/quickbook/test/preformatted-1_6.gold new file mode 100644 index 000000000..46a90c98e --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_6.gold @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="preformatted" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Preformatted</title> + <section id="preformatted.preformatted"> + <title><link linkend="preformatted.preformatted">Preformatted</link></title> + <para> + Here's the ubiquitous <emphasis>Hello World</emphasis> program in C++. + </para> +<programlisting>#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +</programlisting> + <para> + The code should appear as a single block of code in a monospaced font and with + no syntax highlighting. The fifth and sixth lines should appear indented to + the right, aligning under <code><phrase role="identifier">main</phrase></code>, + on line 3. + </para> + <para> + Here's a one line function definitition: + </para> +<programlisting>void something(); </programlisting> + <para> + . + </para> + <para> + And some indented code: + </para> +<programlisting> void go() + { + } +</programlisting> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/preformatted-1_6.gold-html b/src/boost/tools/quickbook/test/preformatted-1_6.gold-html new file mode 100644 index 000000000..bebc28896 --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_6.gold-html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Preformatted + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#preformatted.preformatted">Preformatted</a> + </li> + </ul> + </div> + <div id="preformatted.preformatted"> + <h3> + Preformatted + </h3> + <div id="preformatted.preformatted"> + <p> + Here's the ubiquitous <span class="emphasis"><em>Hello World</em></span> + program in C++. + </p> +<pre class="programlisting">#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +</pre> + <p> + The code should appear as a single block of code in a monospaced font and + with no syntax highlighting. The fifth and sixth lines should appear indented + to the right, aligning under <code><span class="identifier">main</span></code>, + on line 3. + </p> + <p> + Here's a one line function definitition: + </p> +<pre class="programlisting">void something(); </pre> + <p> + . + </p> + <p> + And some indented code: + </p> +<pre class="programlisting"> void go() + { + } +</pre> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/preformatted-1_6.quickbook b/src/boost/tools/quickbook/test/preformatted-1_6.quickbook new file mode 100644 index 000000000..25c6bc5c5 --- /dev/null +++ b/src/boost/tools/quickbook/test/preformatted-1_6.quickbook @@ -0,0 +1,33 @@ +[article Preformatted +[quickbook 1.6] +] + +[section Preformatted] + +Here's the ubiquitous /Hello World/ program in C++. + +[pre +#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +] + +The code should appear as a single block of code in a monospaced font and with +no syntax highlighting. The fifth and sixth lines should appear indented to the +right, aligning under `main`, on line 3. + +Here's a one line function definitition: [pre void something(); ]. + +And some indented code: + +[pre + void go() + { + } +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/python/include_glob.qbk b/src/boost/tools/quickbook/test/python/include_glob.qbk new file mode 100644 index 000000000..6e1f5248a --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_glob.qbk @@ -0,0 +1,11 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[quickbook 1.7] +[article Include Path] +[include ?.qbk] diff --git a/src/boost/tools/quickbook/test/python/include_glob_deps.txt b/src/boost/tools/quickbook/test/python/include_glob_deps.txt new file mode 100644 index 000000000..82fb66e68 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_glob_deps.txt @@ -0,0 +1,6 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +include_glob.qbk +sub1/a.qbk +sub2/b.qbk diff --git a/src/boost/tools/quickbook/test/python/include_glob_locs.txt b/src/boost/tools/quickbook/test/python/include_glob_locs.txt new file mode 100644 index 000000000..ccab607e0 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_glob_locs.txt @@ -0,0 +1,9 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) ++ include_glob.qbk +g ?.qbk +g sub1/?.qbk ++ sub1/a.qbk +g sub2/?.qbk ++ sub2/b.qbk diff --git a/src/boost/tools/quickbook/test/python/include_path.qbk b/src/boost/tools/quickbook/test/python/include_path.qbk new file mode 100644 index 000000000..3af3b3704 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_path.qbk @@ -0,0 +1,12 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[quickbook 1.5] +[article Include Path] +[include a.qbk] +[include b.qbk] diff --git a/src/boost/tools/quickbook/test/python/include_path_deps.txt b/src/boost/tools/quickbook/test/python/include_path_deps.txt new file mode 100644 index 000000000..86875d79b --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_path_deps.txt @@ -0,0 +1,6 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +include_path.qbk +sub1/a.qbk +sub2/b.qbk diff --git a/src/boost/tools/quickbook/test/python/include_path_locs.txt b/src/boost/tools/quickbook/test/python/include_path_locs.txt new file mode 100644 index 000000000..7926db615 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/include_path_locs.txt @@ -0,0 +1,9 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) ++ include_path.qbk +- a.qbk ++ sub1/a.qbk +- b.qbk +- sub1/b.qbk ++ sub2/b.qbk diff --git a/src/boost/tools/quickbook/test/python/missing_relative.qbk b/src/boost/tools/quickbook/test/python/missing_relative.qbk new file mode 100644 index 000000000..ff96b1088 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/missing_relative.qbk @@ -0,0 +1,14 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[quickbook 1.5] +[article Missing Relative] + +[include ../missing.qbk] +[include missing-dir/x.qbk] +[include missing-dir/../../x.qbk] diff --git a/src/boost/tools/quickbook/test/python/missing_relative_deps.txt b/src/boost/tools/quickbook/test/python/missing_relative_deps.txt new file mode 100644 index 000000000..fb8f27fee --- /dev/null +++ b/src/boost/tools/quickbook/test/python/missing_relative_deps.txt @@ -0,0 +1,4 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +missing_relative.qbk diff --git a/src/boost/tools/quickbook/test/python/missing_relative_locs.txt b/src/boost/tools/quickbook/test/python/missing_relative_locs.txt new file mode 100644 index 000000000..ac85cec10 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/missing_relative_locs.txt @@ -0,0 +1,7 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) ++ missing_relative.qbk +- ../missing.qbk +- missing-dir/x.qbk +- missing-dir/../../x.qbk diff --git a/src/boost/tools/quickbook/test/python/run_tests.py b/src/boost/tools/quickbook/test/python/run_tests.py new file mode 100644 index 000000000..955f52c92 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/run_tests.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python + +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +import sys, os, subprocess, tempfile, re + +def main(args, directory): + if len(args) != 1: + print "Usage: output-deps.py quickbook-command" + exit(1) + quickbook_command = args[0] + + failures = 0 + + # Dependency tests + + failures += run_quickbook(quickbook_command, 'svg_missing.qbk', + deps_gold = 'svg_missing_deps.txt') + failures += run_quickbook(quickbook_command, 'svg_missing.qbk', + locations_gold = 'svg_missing_locs.txt') + failures += run_quickbook(quickbook_command, 'missing_relative.qbk', + deps_gold = 'missing_relative_deps.txt', + locations_gold = 'missing_relative_locs.txt') + failures += run_quickbook(quickbook_command, 'include_path.qbk', + deps_gold = 'include_path_deps.txt', + locations_gold = 'include_path_locs.txt', + input_path = ['sub1', 'sub2']) + failures += run_quickbook(quickbook_command, 'include_glob.qbk', + deps_gold = 'include_glob_deps.txt', + locations_gold = 'include_glob_locs.txt', + input_path = ['sub1', 'sub2']) + + # Try building a simple document with various flags. + + failures += run_quickbook(quickbook_command, 'simple.qbk', + output_gold = 'simple.xml') + failures += run_quickbook(quickbook_command, 'simple.qbk', + extra_flags = ['--no-self-linked-headers'], + output_gold = 'simple_no_self_linked.xml') + failures += run_quickbook(quickbook_command, 'simple.qbk', + extra_flags = ['--no-pretty-print'], + output_gold = 'simple_no_pretty_print.xml') + failures += run_quickbook(quickbook_command, 'simple.qbk', + extra_flags = ['--indent','4','--linewidth','60'], + output_gold = 'simple_custom_pretty_print.xml') + + if failures == 0: + print "Success" + else: + print "Failures:",failures + exit(failures) + +def run_quickbook(quickbook_command, filename, output_gold = None, + deps_gold = None, locations_gold = None, input_path = [], + extra_flags = None): + failures = 0 + + command = [quickbook_command, '--debug', filename] + + output_filename = None + if output_gold: + output_filename = temp_filename('.qbk') + command.extend(['--output-file', output_filename]) + + deps_filename = None + if deps_gold: + deps_filename = temp_filename('.txt') + command.extend(['--output-deps', deps_filename]) + + locations_filename = None + if locations_gold: + locations_filename = temp_filename('.txt') + command.extend(['--output-checked-locations', locations_filename]) + + for path in input_path: + command.extend(['-I', path]) + + if extra_flags: + command.extend(extra_flags) + + try: + print 'Running: ' + ' '.join(command) + print + exit_code = subprocess.call(command) + print + success = not exit_code + + if output_filename: + output = load_file(output_filename) + else: + output = None + + if deps_filename: + deps = load_dependencies(deps_filename) + else: + deps = None + + if locations_filename: + locations = load_locations(locations_filename) + else: + locations = None + finally: + if output_filename: os.unlink(output_filename) + if deps_filename: os.unlink(deps_filename) + + if deps_gold: + gold = load_dependencies(deps_gold) + if deps != gold: + failures = failures + 1 + print "Dependencies don't match:" + print "Gold:", gold + print "Result:", deps + print + + if locations_gold: + gold = load_locations(locations_gold) + if locations != gold: + failures = failures + 1 + print "Dependencies don't match:" + print "Gold:", gold + print "Result:", locations + print + + if output_gold: + gold = load_file(output_gold) + if gold != output: + failures = failures + 1 + print "Output doesn't match:" + print + print gold + print + print output + print + + return failures + +def load_dependencies(filename): + dependencies = set() + f = open(filename, 'r') + for path in f: + if path[0] == '#': continue + if path in dependencies: + raise Exception("Duplicate path (%1s) in %2s" % (path, filename)) + dependencies.add(path) + return dependencies + +def load_locations(filename): + line_matcher = re.compile("^([+-g]) (.*)$") + dependencies = {} + f = open(filename, 'r') + glob = None + globs = {} + for line in f: + if line[0] == '#': continue + m = line_matcher.match(line) + + path = m.group(2) + + if not m: + raise Exception("Invalid dependency file: %1s" % filename) + if m.group(1) == 'g': + globs[path] = [] + glob = path + elif glob: + if m.group(1) != '+': + raise Exception("Negative match in glob.") + globs[glob].append(path) + else: + found = m.group(1) == '+' + if path in dependencies: + raise Exception("Duplicate path (%1s) in %2s" % (path, filename)) + dependencies[path] = found + return { 'dependencies': dependencies, 'globs': globs } + +def temp_filename(extension): + file = tempfile.mkstemp(suffix = extension) + os.close(file[0]) + return file[1] + +def load_file(filename): + f = open(filename, 'r') + try: + return f.read() + finally: + f.close() + + return None + +main(sys.argv[1:], os.path.dirname(sys.argv[0])) diff --git a/src/boost/tools/quickbook/test/python/simple.qbk b/src/boost/tools/quickbook/test/python/simple.qbk new file mode 100644 index 000000000..af42ca5cd --- /dev/null +++ b/src/boost/tools/quickbook/test/python/simple.qbk @@ -0,0 +1,23 @@ +[/ Copyright 2016 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[quickbook 1.6] +[article Simple Test Article + [copyright 2016 Daniel James] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[section:one One] + +[h1 A] + +Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed pretium urna metus scelerisque urna massa vestibulum neque. + +[heading B] + +[endsect] diff --git a/src/boost/tools/quickbook/test/python/simple.xml b/src/boost/tools/quickbook/test/python/simple.xml new file mode 100644 index 000000000..9b8f73bed --- /dev/null +++ b/src/boost/tools/quickbook/test/python/simple.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Simple Test Article</title> + <articleinfo> + <copyright> + <year>2016</year> <holder>Daniel James</holder> + </copyright> + <legalnotice id="simple_test_article.legal"> + <para> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>) + </para> + </legalnotice> + </articleinfo> + <section id="simple_test_article.one"> + <title><link linkend="simple_test_article.one">One</link></title> + <bridgehead renderas="sect1" id="simple_test_article.one.h0"> + <phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link> + </bridgehead> + <para> + Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit + luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. + Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non + libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem + amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor + iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. + Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed + pretium urna metus scelerisque urna massa vestibulum neque. + </para> + <bridgehead renderas="sect3" id="simple_test_article.one.h1"> + <phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link> + </bridgehead> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/python/simple_custom_pretty_print.xml b/src/boost/tools/quickbook/test/python/simple_custom_pretty_print.xml new file mode 100644 index 000000000..07b71e5bf --- /dev/null +++ b/src/boost/tools/quickbook/test/python/simple_custom_pretty_print.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" +"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Simple Test Article</title> + <articleinfo> + <copyright> + <year>2016</year> <holder>Daniel James</holder> + </copyright> + <legalnotice id="simple_test_article.legal"> + <para> + Distributed under the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt + or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>) + </para> + </legalnotice> + </articleinfo> + <section id="simple_test_article.one"> + <title><link linkend="simple_test_article.one">One</link></title> + <bridgehead renderas="sect1" id="simple_test_article.one.h0"> + <phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link> + </bridgehead> + <para> + Lorem ipsum dolor. Sit amet quis hendrerit pretium + massa. Et imperdiet sit luctus et nam. Eget neque + vivamus nec aliquam vestibulum. Venenatis id penatibus. + Rutrum lobortis tempora. Turpis cras imperdiet. Quis + parturient quam sed non libero donec in ut aliquam + aliquam purus maecenas con dolor in est felis lorem + amet vel. Risus mauris felis. Libero felis fringilla. + Sed cursus metus dolor iaculis eget sit ac commodo. + Molestie interdum nunc. Erat auctor suscipit. Turpis + quisque nonummy. Integer vestibulum vivamus vulputate + euismod et sed pretium urna metus scelerisque urna + massa vestibulum neque. + </para> + <bridgehead renderas="sect3" id="simple_test_article.one.h1"> + <phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link> + </bridgehead> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/python/simple_no_pretty_print.xml b/src/boost/tools/quickbook/test/python/simple_no_pretty_print.xml new file mode 100644 index 000000000..258b4339f --- /dev/null +++ b/src/boost/tools/quickbook/test/python/simple_no_pretty_print.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" + "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article + id="simple_test_article" + last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Simple Test Article</title> + + + <articleinfo> + + <copyright> + <year>2016</year> + <holder>Daniel James</holder> + </copyright> + + <legalnotice id="simple_test_article.legal"> + <para> + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>) + + </para> + </legalnotice> + + </articleinfo> + + +<section id="simple_test_article.one"> +<title><link linkend="simple_test_article.one">One</link></title> +<bridgehead renderas="sect1" id="simple_test_article.one.h0"><phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link></bridgehead><para> +Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed pretium urna metus scelerisque urna massa vestibulum neque.</para> +<bridgehead renderas="sect3" id="simple_test_article.one.h1"><phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link></bridgehead></section> +</article> + diff --git a/src/boost/tools/quickbook/test/python/simple_no_self_linked.xml b/src/boost/tools/quickbook/test/python/simple_no_self_linked.xml new file mode 100644 index 000000000..37dce222e --- /dev/null +++ b/src/boost/tools/quickbook/test/python/simple_no_self_linked.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Simple Test Article</title> + <articleinfo> + <copyright> + <year>2016</year> <holder>Daniel James</holder> + </copyright> + <legalnotice id="simple_test_article.legal"> + <para> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>) + </para> + </legalnotice> + </articleinfo> + <section id="simple_test_article.one"> + <title>One</title> + <bridgehead renderas="sect1" id="simple_test_article.one.a"> + A + </bridgehead> + <para> + Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit + luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. + Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non + libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem + amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor + iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. + Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed + pretium urna metus scelerisque urna massa vestibulum neque. + </para> + <bridgehead renderas="sect3" id="simple_test_article.one.b"> + B + </bridgehead> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/python/sub1/a.qbk b/src/boost/tools/quickbook/test/python/sub1/a.qbk new file mode 100644 index 000000000..f3abe6ebf --- /dev/null +++ b/src/boost/tools/quickbook/test/python/sub1/a.qbk @@ -0,0 +1,9 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +a diff --git a/src/boost/tools/quickbook/test/python/sub2/b.qbk b/src/boost/tools/quickbook/test/python/sub2/b.qbk new file mode 100644 index 000000000..9b4336bdc --- /dev/null +++ b/src/boost/tools/quickbook/test/python/sub2/b.qbk @@ -0,0 +1,9 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +b diff --git a/src/boost/tools/quickbook/test/python/svg_missing.qbk b/src/boost/tools/quickbook/test/python/svg_missing.qbk new file mode 100644 index 000000000..1b54ece45 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/svg_missing.qbk @@ -0,0 +1,11 @@ +[/ + Copyright 2012-2013 Daniel James + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +] + +[article Dependencies for missing svg] + +[$missing.svg] diff --git a/src/boost/tools/quickbook/test/python/svg_missing_deps.txt b/src/boost/tools/quickbook/test/python/svg_missing_deps.txt new file mode 100644 index 000000000..91487e85e --- /dev/null +++ b/src/boost/tools/quickbook/test/python/svg_missing_deps.txt @@ -0,0 +1,4 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +svg_missing.qbk diff --git a/src/boost/tools/quickbook/test/python/svg_missing_locs.txt b/src/boost/tools/quickbook/test/python/svg_missing_locs.txt new file mode 100644 index 000000000..0f4c9b806 --- /dev/null +++ b/src/boost/tools/quickbook/test/python/svg_missing_locs.txt @@ -0,0 +1,5 @@ +# Copyright 2012-2013 Daniel James +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +- html/missing.svg ++ svg_missing.qbk diff --git a/src/boost/tools/quickbook/test/quickbook-testing.jam b/src/boost/tools/quickbook/test/quickbook-testing.jam new file mode 100644 index 000000000..a4529497c --- /dev/null +++ b/src/boost/tools/quickbook/test/quickbook-testing.jam @@ -0,0 +1,185 @@ +# +# Copyright (c) 2005 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import feature ; +import generators ; +import modules ; +import project ; +import targets ; +import testing ; +import toolset ; +import type ; + +feature.feature quickbook-testing.quickbook-command : : free dependency ; +feature.feature <quickbook-test-define> : : free ; +feature.feature <quickbook-test-include> : : free path ; +feature.feature <quickbook-xinclude-base> : : free ; + +type.register QUICKBOOK_INPUT : quickbook ; +type.register QUICKBOOK_OUTPUT ; +type.register QUICKBOOK_HTML_OUTPUT ; + +generators.register-standard quickbook-testing.process-quickbook : QUICKBOOK_INPUT : QUICKBOOK_OUTPUT ; +generators.register-standard quickbook-testing.process-quickbook-html : QUICKBOOK_INPUT : QUICKBOOK_HTML_OUTPUT ; + +################################################################################ +# +# quickbook-test - generates a test for quickbook itself. A quickbook-test is +# actually made up of two tests: +# $(target-name).boostbook : +# generate boostbook from $(input) or $(target-name).quickbook +# +# $(target-name): +# compare generated boostbook to $(reference-output) or +# $(input).gold or $(target-name).gold +# +rule quickbook-test ( target-name : input ? : reference-output ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + reference-output ?= $(input:S=.gold) ; + reference-output-html = $(input:S=.gold-html) ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t1 = + [ targets.create-typed-target QUICKBOOK_OUTPUT + : $(project) + : $(target-name).boostbook + : $(input) + : $(requirements) + <location-prefix>$(target-name).test + <quickbook-testing.quickbook-command>$(boost-root)/tools/quickbook/src//quickbook + ] ; + + local t2 = + [ targets.create-typed-target RUN + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/test/src/text_diff.cpp + : $(requirements) + <location-prefix>$(target-name).test2 + <testing.input-file>$(reference-output) + <testing.input-file>$(target-name).boostbook + <preserve-test-targets>on + ] ; + + local t1-html = + [ targets.create-typed-target QUICKBOOK_HTML_OUTPUT + : $(project) + : $(target-name).html + : $(input) + : $(requirements) + <location-prefix>$(target-name).test-html + <quickbook-testing.quickbook-command>$(boost-root)/tools/quickbook/src//quickbook + ] ; + + local t2-html = + [ targets.create-typed-target RUN + : $(project) + : $(target-name)-compare-html + : $(boost-root)/tools/quickbook/test/src/text_diff.cpp + : $(requirements) + <location-prefix>$(target-name).test-html + <testing.input-file>$(reference-output-html) + <testing.input-file>$(target-name).html + <preserve-test-targets>on + ] ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t2) $(t2-html) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t1) $(t2) $(t1-html) $(t2-html) ; +} + +rule quickbook-fail-test ( target-name : input ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t = + [ targets.create-typed-target RUN_FAIL + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/src//quickbook + : $(requirements) + <testing.input-file>$(input) + <preserve-test-targets>on + <dependency>$(input) + ] + ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t) ; +} + +rule quickbook-error-test ( target-name : input ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t = + [ targets.create-typed-target RUN + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/src//quickbook + : $(requirements) + <testing.input-file>$(input) + <testing.arg>--expect-errors + <preserve-test-targets>on + <dependency>$(input) + ] + ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t) ; +} + +################################################################################ +toolset.flags quickbook-testing.process-quickbook quickbook-command <quickbook-testing.quickbook-command> ; +toolset.flags quickbook-testing.process-quickbook QB-DEFINES <quickbook-test-define> ; +toolset.flags quickbook-testing.process-quickbook XINCLUDE <quickbook-xinclude-base> ; +toolset.flags quickbook-testing.process-quickbook INCLUDES <quickbook-test-include> ; +toolset.flags quickbook-testing.process-quickbook-html quickbook-command <quickbook-testing.quickbook-command> ; +toolset.flags quickbook-testing.process-quickbook-html QB-DEFINES <quickbook-test-define> ; +toolset.flags quickbook-testing.process-quickbook-html XINCLUDE <quickbook-xinclude-base> ; +toolset.flags quickbook-testing.process-quickbook-html INCLUDES <quickbook-test-include> ; + +rule process-quickbook ( target : source : properties * ) +{ + DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ; +} + +actions process-quickbook bind quickbook-command +{ + $(quickbook-command) $(>) --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)" +} + +rule process-quickbook-html ( target : source : properties * ) +{ + DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ; +} + +actions process-quickbook-html bind quickbook-command +{ + $(quickbook-command) $(>) --output-format=onehtml --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)" +} diff --git a/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold b/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold new file mode 100644 index 000000000..86d2eda66 --- /dev/null +++ b/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold @@ -0,0 +1,3945 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="quickbook" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Quickbook 1.4</title> + <articleinfo> + <authorgroup> + <author> + <firstname>Joel</firstname> <surname>de Guzman</surname> + </author> + <author> + <firstname>Eric</firstname> <surname>Niebler</surname> + </author> + </authorgroup> + <copyright> + <year>2002</year> <year>2004</year> <year>2006</year> <holder>Joel de Guzman, + Eric Niebler</holder> + </copyright> + <legalnotice id="quickbook.legal"> + <para> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>) + </para> + </legalnotice> + <articlepurpose> + <emphasis>WikiWiki</emphasis> style documentation tool + </articlepurpose> + </articleinfo> + <section id="quickbook.intro"> + <title><link linkend="quickbook.intro">Introduction</link></title> + <blockquote> + <para> + <emphasis role="bold"><emphasis><quote>Why program by hand in five days what + you can spend five years of your life automating?</quote></emphasis></emphasis> + </para> + <para> + -- Terrence Parr, author ANTLR/PCCTS + </para> + </blockquote> + <para> + Well, QuickBook started as a weekend hack. It was originally intended to be + a sample application using <ulink url="http://spirit.sourceforge.net">Spirit</ulink>. + What is it? What you are viewing now, this documentation, is autogenerated + by QuickBook. These files were generated from one master: + </para> + <blockquote> + <para> + <ulink url="../quickbook.qbk">quickbook.qbk</ulink> + </para> + </blockquote> + <para> + Originally named QuickDoc, this funky tool that never dies evolved into a funkier + tool thanks to Eric Niebler who resurrected the project making it generate + <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> + instead of HTML. The <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> + documentation format is an extension of <ulink url="http://www.docbook.org/">DocBook</ulink>, + an SGML or XML based format for describing documentation. + </para> + <para> + QuickBook is a WikiWiki style documentation tool geared towards C++ documentation + using simple rules and markup for simple formatting tasks. QuickBook extends + the WikiWiki concept. Like the WikiWiki, QuickBook documents are simple text + files. A single QuickBook document can generate a fully linked set of nice + HTML and PostScript/PDF documents complete with images and syntax- colorized + source code. + </para> + <para> + Features include: + </para> + <itemizedlist> + <listitem> + <simpara> + generate <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> + xml, to generate HTML, PostScript and PDF + </simpara> + </listitem> + <listitem> + <simpara> + simple markup to link to Doxygen-generated entities + </simpara> + </listitem> + <listitem> + <simpara> + macro system for simple text substitution + </simpara> + </listitem> + <listitem> + <simpara> + simple markup for italics, bold, preformatted, blurbs, code samples, tables, + URLs, anchors, images, etc. + </simpara> + </listitem> + <listitem> + <simpara> + automatic syntax coloring of code samples + </simpara> + </listitem> + <listitem> + <simpara> + CSS support + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="quickbook.change_log"> + <title><link linkend="quickbook.change_log">Change Log</link></title> + <bridgehead renderas="sect3" id="quickbook.change_log.h0"> + <phrase id="quickbook.change_log.version_1_3"/><link linkend="quickbook.change_log.version_1_3">Version + 1.3</link> + </bridgehead> + <itemizedlist> + <listitem> + <simpara> + Quickbook file inclusion [include]. + </simpara> + </listitem> + <listitem> + <simpara> + Better xml output (pretty layout). Check out the generated XML. + </simpara> + </listitem> + <listitem> + <simpara> + Regression testing facility: to make sure your document will always be + compatible (full backward compatibility) regardless of changes to QuickBook. + </simpara> + </listitem> + <listitem> + <simpara> + Code cleanup and refactoring. + </simpara> + </listitem> + <listitem> + <simpara> + Allow phrase markup in the doc-info. + </simpara> + </listitem> + <listitem> + <simpara> + Preformatted code blocks via ``code`` (double ticks) allows code in tables + and lists, for example. + </simpara> + </listitem> + <listitem> + <simpara> + Quickbook versioning; allows full backward compatibility. You have to add + [quickbook 1.3] to the doc-info header to enable the new features. Without + this, QuickBook will assume that the document is a pre-1.3 document. + </simpara> + </listitem> + <listitem> + <simpara> + Better (intuitive) paragraph termination. Some markups may terminate a + paragraph. Example: +<programlisting><phrase role="special">[</phrase><phrase role="identifier">section</phrase> <phrase role="identifier">x</phrase><phrase role="special">]</phrase> +<phrase role="identifier">blah</phrase><phrase role="special">...</phrase> +<phrase role="special">[</phrase><phrase role="identifier">endsect</phrase><phrase role="special">]</phrase></programlisting> + </simpara> + </listitem> + <listitem> + <simpara> + Fully qualified section and headers. Subsection names are concatenated + to the ID to avoid clashing. Example: <code><phrase role="identifier">doc_name</phrase><phrase + role="special">.</phrase><phrase role="identifier">sect_name</phrase><phrase + role="special">.</phrase><phrase role="identifier">sub_sect_name</phrase><phrase + role="special">.</phrase><phrase role="identifier">sub_sub_sect_name</phrase></code> + </simpara> + </listitem> + <listitem> + <simpara> + Better &nbsp; and whitespace handling in code snippets. + </simpara> + </listitem> + <listitem> + <simpara> + [xinclude] fixes up the relative path to the target XML file when input_directory + is not the same as the output_directory. + </simpara> + </listitem> + <listitem> + <simpara> + Allow untitled tables. + </simpara> + </listitem> + <listitem> + <simpara> + Allow phrase markups in section titles. + </simpara> + </listitem> + <listitem> + <simpara> + Allow escaping back to QuickBook from code, code blocks and inline code. + </simpara> + </listitem> + <listitem> + <simpara> + Footnotes, with the [footnote This is the footnote] syntax. + </simpara> + </listitem> + <listitem> + <simpara> + Post-processor bug fix for escaped XML code that it does not recognize. + </simpara> + </listitem> + <listitem> + <simpara> + Replaceable, with the [~replacement] syntax. + </simpara> + </listitem> + <listitem> + <simpara> + Generic Headers + </simpara> + </listitem> + <listitem> + <simpara> + Code changes to allow full recursion (i.e. Collectors and push/pop functions) + </simpara> + </listitem> + <listitem> + <simpara> + Various code cleanup/maintenance + </simpara> + </listitem> + <listitem> + <simpara> + Templates! + </simpara> + </listitem> + <listitem> + <simpara> + [conceptref] for referencing BoostBook <concept> entities. + </simpara> + </listitem> + <listitem> + <simpara> + Allow escape of spaces. The escaped space is removed from the output. Syntax: + <code><phrase role="special">\</phrase> </code>. + </simpara> + </listitem> + <listitem> + <simpara> + Nested comments are now allowed. + </simpara> + </listitem> + <listitem> + <simpara> + Quickbook blocks can nest inside comments. + </simpara> + </listitem> + <listitem> + <simpara> + <link linkend="quickbook.syntax.block.import">Import</link> facility. + </simpara> + </listitem> + <listitem> + <simpara> + Callouts on imported code + </simpara> + </listitem> + <listitem> + <simpara> + Simple markups can now span a whole block. + </simpara> + </listitem> + <listitem> + <simpara> + <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>, <link linkend="quickbook.syntax.block.admonitions">Admonitions</link> + and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>) + may now contain paragraphs. + </simpara> + </listitem> + <listitem> + <simpara> + <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code> + and <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase + role="special">]</phrase></code> are now deprecated. + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="quickbook.syntax"> + <title><link linkend="quickbook.syntax">Syntax Summary</link></title> + <para> + A QuickBook document is composed of one or more blocks. An example of a block + is the paragraph or a C++ code snippet. Some blocks have special mark-ups. + Blocks, except code snippets which have their own grammar (C++ or Python), + are composed of one or more phrases. A phrase can be a simple contiguous run + of characters. Phrases can have special mark-ups. Marked up phrases can recursively + contain other phrases, but cannot contain blocks. A terminal is a self contained + block-level or phrase-level element that does not nest anything. + </para> + <para> + Blocks, in general, are delimited by two end-of-lines (the block terminator). + Phrases in each block cannot contain a block terminator. This way, syntax errors + such as un-matched closing brackets do not go haywire and corrupt anything + past a single block. + </para> + <section id="quickbook.syntax.comments"> + <title><link linkend="quickbook.syntax.comments">Comments</link></title> + <para> + Can be placed anywhere. + </para> +<programlisting><!--quickbook-escape-prefix-->[/ comment (no output generated) ]<!--quickbook-escape-postfix--> +</programlisting> +<programlisting><!--quickbook-escape-prefix-->[/ comments can be nested [/ some more here] ]<!--quickbook-escape-postfix--> +</programlisting> +<programlisting><!--quickbook-escape-prefix-->[/ Quickbook blocks can nest inside comments. [*Comment this out too!] ]<!--quickbook-escape-postfix--> +</programlisting> + </section> + <section id="quickbook.syntax.phrase"> + <title><link linkend="quickbook.syntax.phrase">Phrase Level Elements</link></title> + <section id="quickbook.syntax.phrase.font_styles"> + <title><link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link></title> +<programlisting><!--quickbook-escape-prefix-->['italic], [*bold], [_underline], [^teletype], [-strikethrough] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <emphasis>italic</emphasis>, <emphasis role="bold">bold</emphasis>, <emphasis + role="underline">underline</emphasis>, <literal>teletype</literal>, <emphasis + role="strikethrough">strikethrough</emphasis> + </para> + <para> + Like all non-terminal phrase level elements, this can of course be nested: + </para> +<programlisting><!--quickbook-escape-prefix-->[*['bold-italic]] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <emphasis role="bold"><emphasis>bold-italic</emphasis></emphasis> + </para> + </section> + <section id="quickbook.syntax.phrase.replaceable"> + <title><link linkend="quickbook.syntax.phrase.replaceable">Replaceable</link></title> + <para> + When you want content that may or must be replaced by the user, use the + syntax: + </para> +<programlisting><!--quickbook-escape-prefix-->[~replacement] +<!--quickbook-escape-postfix--></programlisting> + <para> + This will generate: + </para> + <para> + <replaceable>replacement</replaceable> + </para> + </section> + <section id="quickbook.syntax.phrase.quotations"> + <title><link linkend="quickbook.syntax.phrase.quotations">Quotations</link></title> +<programlisting><!--quickbook-escape-prefix-->["A question that sometimes drives me hazy: am I or are the others crazy?]--Einstein +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <quote>A question that sometimes drives me hazy: am I or are the others + crazy?</quote>--Einstein + </para> + <para> + Note the proper left and right quote marks. Also, while you can simply + use ordinary quote marks like "quoted", our quotation, above, + will generate correct DocBook quotations (e.g. <quote>quoted</quote>). + </para> + <para> + Like all phrase elements, quotations may be nested. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->["Here's the rule for bargains: ["Do other men, for they would do you.] That's +the true business precept.] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <quote>Here's the rule for bargains: <quote>Do other men, for they would + do you.</quote> That's the true business precept.</quote> + </para> + </section> + <section id="quickbook.syntax.phrase.simple_formatting"> + <title><link linkend="quickbook.syntax.phrase.simple_formatting">Simple formatting</link></title> + <para> + Simple markup for formatting text, common in many applications, is now + supported: + </para> +<programlisting><!--quickbook-escape-prefix-->/italic/, *bold*, _underline_, =teletype= +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <emphasis>italic</emphasis>, <emphasis role="bold">bold</emphasis>, <emphasis + role="underline">underline</emphasis>, <literal>teletype</literal> + </para> + <para> + Unlike QuickBook's standard formatting scheme, the rules for simpler alternatives + are much stricter<footnote id="quickbook.syntax.phrase.simple_formatting.f0"> + <para> + Thanks to David Barrett, author of <ulink url="http://quinthar.com/qwikiwiki/index.php?page=Home">Qwiki</ulink>, + for sharing these samples and teaching me these obscure formatting rules. + I wasn't sure at all if <ulink url="http://spirit.sourceforge.net">Spirit</ulink>, + being more or less a formal EBNF parser, can handle the context sensitivity + and ambiguity. + </para> + </footnote>. + </para> + <itemizedlist> + <listitem> + <simpara> + Simple markups cannot nest. You can combine a simple markup with a + nestable markup. + </simpara> + </listitem> + <listitem> + <simpara> + Simple markups cannot contain any other form of quickbook markup. + </simpara> + </listitem> + <listitem> + <simpara> + A non-space character must follow the leading markup + </simpara> + </listitem> + <listitem> + <simpara> + A non-space character must precede the trailing markup + </simpara> + </listitem> + <listitem> + <simpara> + A space or a punctuation must follow the trailing markup + </simpara> + </listitem> + <listitem> + <simpara> + If the matching markup cannot be found within a block, the formatting + will not be applied. This is to ensure that un-matched formatting markups, + which can be a common mistake, does not corrupt anything past a single + block. We do not want the rest of the document to be rendered bold + just because we forgot a trailing '*'. A single block is terminated + by two end of lines or the close bracket: ']'. + </simpara> + </listitem> + <listitem> + <simpara> + A line starting with the star will be interpreted as an unordered list. + See <link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered + lists</link>. + </simpara> + </listitem> + </itemizedlist> + <table frame="all" id="quickbook.syntax.phrase.simple_formatting.t0"> + <title>More Formatting Samples</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Markup + </para> + </entry> + <entry> + <para> + Result + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + <literal>*Bold*</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">Bold</emphasis> + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*Is bold*</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">Is bold</emphasis> + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>* Not bold* *Not bold * * Not bold *</literal> + </para> + </entry> + <entry> + <para> + * Not bold* *Not bold * * Not bold * + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>This*Isn't*Bold (no bold)</literal> + </para> + </entry> + <entry> + <para> + This*Isn't*Bold (no bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>(*Bold Inside*) (parenthesis not bold)</literal> + </para> + </entry> + <entry> + <para> + (<emphasis role="bold">Bold Inside</emphasis>) (parenthesis not + bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*(Bold Outside)* (parenthesis bold)</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">(Bold Outside)</emphasis> (parenthesis + bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>3*4*5 = 60 (no bold)</literal> + </para> + </entry> + <entry> + <para> + 3*4*5 = 60 (no bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>3 * 4 * 5 = 60 (no bold)</literal> + </para> + </entry> + <entry> + <para> + 3 * 4 * 5 = 60 (no bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>3 *4* 5 = 60 (4 is bold)</literal> + </para> + </entry> + <entry> + <para> + 3 <emphasis role="bold">4</emphasis> 5 = 60 (4 is bold) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*This is bold* this is not *but this is*</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">This is bold</emphasis> this is not <emphasis + role="bold">but this is</emphasis> + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*This is bold*.</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">This is bold</emphasis>. + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*B*. (bold B)</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">B</emphasis>. (bold B) + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>['*Bold-Italic*]</literal> + </para> + </entry> + <entry> + <para> + <emphasis><emphasis role="bold">Bold-Italic</emphasis></emphasis> + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>*side-by*/-side/</literal> + </para> + </entry> + <entry> + <para> + <emphasis role="bold">side-by</emphasis><emphasis>-side</emphasis> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <para> + As mentioned, simple markups cannot go past a single block. The text from + "have" to "full" in the following paragraph will be + rendered as bold: + </para> +<programlisting><!--quickbook-escape-prefix-->Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full!* +One for the master, one for the dame, +And one for the little boy who lives down the lane. +<!--quickbook-escape-postfix--></programlisting> + <para> + Baa baa black sheep, <emphasis role="bold">have you any wool? Yes sir, + yes sir, three bags full!</emphasis> One for the master, one for the dame, + And one for the little boy who lives down the lane. + </para> + <para> + But in the following paragraph, bold is not applied: + </para> +<programlisting><!--quickbook-escape-prefix-->Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full! +One for the master, one for the dame, +And one for the little boy who lives down the lane. +<!--quickbook-escape-postfix--></programlisting> + <para> + Baa baa black sheep, *have you any wool? Yes sir, yes sir, three bags full! + One for the master, one for the dame, And one for the little boy who lives + down the lane. + </para> + </section> + <section id="quickbook.syntax.phrase.inline_code"> + <title><link linkend="quickbook.syntax.phrase.inline_code">Inline code</link></title> + <para> + Inlining code in paragraphs is quite common when writing C++ documentation. + We provide a very simple markup for this. For example, this: + </para> +<programlisting><!--quickbook-escape-prefix-->This text has inlined code `int main() { return 0; }` in it. +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + This text has inlined code <code><phrase role="keyword">int</phrase> <phrase + role="identifier">main</phrase><phrase role="special">()</phrase> <phrase + role="special">{</phrase> <phrase role="keyword">return</phrase> <phrase + role="number">0</phrase><phrase role="special">;</phrase> <phrase role="special">}</phrase></code> + in it. The code will be syntax highlighted. + </para> + <note> + <para> + We simply enclose the code with the tick: <literal>"`"</literal>, not the + single quote: <code><phrase role="string">"'"</phrase></code>. + Note too that <literal>`some code`</literal> is preferred over <literal>[^some code]</literal>. + </para> + </note> + </section> + <section id="quickbook.syntax.phrase.code_blocks"> + <title><link linkend="quickbook.syntax.phrase.code_blocks">Code blocks</link></title> + <para> + Preformatted code simply starts with a space or a tab (See <link linkend="quickbook.syntax.block.code">Code</link>). + However, such a simple syntax cannot be used as phrase elements in lists + (See <link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered + lists</link> and <link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered + lists</link>), tables (See <link linkend="quickbook.syntax.block.tables">Tables</link>), + etc. Inline code (see above) can. The problem is, inline code does not + allow formatting with newlines, spaces, and tabs. These are lost. + </para> + <para> + We provide a phrase level markup that is a mix between the two. By using + the double-tick, instead of the single-tick, we are telling QuickBook to + use preformatted blocks of code. Example: + </para> +<programlisting>`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } +`` +</programlisting> + <para> + will generate: + </para> + <para> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> + <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + </section> + <section id="quickbook.syntax.phrase.source_mode"> + <title><link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link></title> + <para> + If a document contains more than one type of source code then the source + mode may be changed dynamically as the document is processed. All QuickBook + documents are initially in C++ mode by default, though an alternative initial + value may be set in the <link linkend="quickbook.syntax.block.document">Document</link> + section. + </para> + <para> + To change the source mode, use the <literal>[source-mode]</literal> markup, + where <literal>source-mode</literal> is one of the supported modes. For + example, this: + </para> +<programlisting><!--quickbook-escape-prefix-->Python's [python] `import` is rather like C++'s [c++] `#include`. A +C++ comment `// looks like this` whereas a Python comment [python] +`# looks like this`. +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + Python's <code><phrase role="keyword">import</phrase></code> is rather + like C++'s <code><phrase role="preprocessor">#include</phrase></code>. + A C++ comment <code><phrase role="comment">// looks like this</phrase></code> + whereas a Python comment <code><phrase role="comment">#looks like this</phrase></code>. + </para> + <table frame="all" id="quickbook.syntax.phrase.source_mode.t0"> + <title>Supported Source Modes</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Mode + </para> + </entry> + <entry> + <para> + Source Mode Markup + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + C++ + </para> + </entry> + <entry> + <para> + <literal>[c++]</literal> + </para> + </entry> + </row> + <row> + <entry> + <para> + Python + </para> + </entry> + <entry> + <para> + <literal>[python]</literal> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <note> + <para> + The source mode strings are lowercase. + </para> + </note> + </section> + <section id="quickbook.syntax.phrase.line_break"> + <title><link linkend="quickbook.syntax.phrase.line_break">line-break</link></title> +<programlisting><!--quickbook-escape-prefix-->[br] +<!--quickbook-escape-postfix--></programlisting> + <warning> + <para> + <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase + role="special">]</phrase></code> is now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>, + <link linkend="quickbook.syntax.block.admonitions">Admonitions</link> + and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>) + may now contain paragraphs. + </para> + </warning> + </section> + <section id="quickbook.syntax.phrase.anchors"> + <title><link linkend="quickbook.syntax.phrase.anchors">Anchors</link></title> +<programlisting><!--quickbook-escape-prefix-->[#named_anchor] +<!--quickbook-escape-postfix--></programlisting> + <para> + A named anchor is a hook that can be referenced by a link elsewhere in + the document. You can then reference an anchor with <literal>[link named_anchor +Some link text]</literal>. + See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link>, + <link linkend="quickbook.syntax.block.section">Section</link> and <link + linkend="quickbook.syntax.block.headings">Heading</link>. + </para> + </section> + <section id="quickbook.syntax.phrase.links"> + <title><link linkend="quickbook.syntax.phrase.links">Links</link></title> +<programlisting><!--quickbook-escape-prefix-->[@http://www.boost.org this is [*boost's] website....] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <para> + <ulink url="http://www.boost.org">this is <emphasis role="bold">boost's</emphasis> + website....</ulink> + </para> + <para> + URL links where the link text is the link itself is common. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->see http://spirit.sourceforge.net/ +<!--quickbook-escape-postfix--></programlisting> + <para> + so, when the text is absent in a link markup, the URL is assumed. Example: + </para> +<programlisting>see <!--quickbook-escape-prefix-->[@http://spirit.sourceforge.net/]<!--quickbook-escape-postfix--> +</programlisting> + <para> + will generate: + </para> + <para> + see <ulink url="http://spirit.sourceforge.net/">http://spirit.sourceforge.net/</ulink> + </para> + </section> + <section id="quickbook.syntax.phrase.anchor_links"> + <title><link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link></title> + <para> + You can link within a document using: + </para> +<programlisting><!--quickbook-escape-prefix-->[link section_id.normalized_header_text The link text] +<!--quickbook-escape-postfix--></programlisting> + <para> + See sections <link linkend="quickbook.syntax.block.section">Section</link> + and <link linkend="quickbook.syntax.block.headings">Heading</link> for + more info. + </para> + </section> + <section id="quickbook.syntax.phrase.refentry_links"> + <title><link linkend="quickbook.syntax.phrase.refentry_links">refentry links</link></title> + <para> + In addition, you can link internally to an XML refentry like: + </para> +<programlisting><!--quickbook-escape-prefix-->[link xml.refentry The link text] +<!--quickbook-escape-postfix--></programlisting> + <para> + This gets converted into <literal><link linkend="xml.refentry">The + link text</link></literal>. + </para> + <para> + Like URLs, the link text is optional. If this is not present, the link + text will automatically be the refentry. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[link xml.refentry] +<!--quickbook-escape-postfix--></programlisting> + <para> + This gets converted into <literal><link linkend="xml.refentry">xml.refentry</link></literal>. + </para> + </section> + <section id="quickbook.syntax.phrase.code_links"> + <title><link linkend="quickbook.syntax.phrase.code_links">Code Links</link></title> + <para> + If you want to link to a function, class, member, enum, concept or header + in the reference section, you can use: + </para> +<programlisting><!--quickbook-escape-prefix-->[funcref fully::qualified::function_name The link text] +[classref fully::qualified::class_name The link text] +[memberref fully::qualified::member_name The link text] +[enumref fully::qualified::enum_name The link text] +[macroref MACRO_NAME The link text] +[conceptref ConceptName The link text] +[headerref path/to/header.hpp The link text] +<!--quickbook-escape-postfix--></programlisting> + <para> + Again, the link text is optional. If this is not present, the link text + will automatically be the function, class, member, enum, macro, concept + or header. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[classref boost::bar::baz] +<!--quickbook-escape-postfix--></programlisting> + <para> + would have "boost::bar::baz" as the link text. + </para> + </section> + <section id="quickbook.syntax.phrase.escape"> + <title><link linkend="quickbook.syntax.phrase.escape">Escape</link></title> + <para> + The escape mark-up is used when we don't want to do any processing. + </para> +<programlisting>''' +escape (no processing/formatting) +''' +</programlisting> + <para> + Escaping allows us to pass XML markup to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> + or <ulink url="http://www.docbook.org/">DocBook</ulink>. For example: + </para> +<programlisting>''' +<emphasis role="bold">This is direct XML markup</emphasis> +''' +</programlisting> + <para> + <emphasis role="bold">This is direct XML markup</emphasis> + </para> + <important> + <para> + Be careful when using the escape. The text must conform to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>/<ulink + url="http://www.docbook.org/">DocBook</ulink> syntax. + </para> + </important> + </section> + <section id="quickbook.syntax.phrase.single_char_escape"> + <title><link linkend="quickbook.syntax.phrase.single_char_escape">Single + char escape</link></title> + <para> + The backslash may be used to escape a single punctuation character. The + punctuation immediately after the backslash is passed without any processing. + This is useful when we need to escape QuickBook punctuations such as <code><phrase + role="special">[</phrase></code> and <code><phrase role="special">]</phrase></code>. + For example, how do you escape the triple quote? Simple: <literal>\'\'\'</literal> + </para> + <para> + <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code> + has a special meaning. It is used to generate line breaks. + </para> + <warning> + <para> + <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code> + and <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase + role="special">]</phrase></code> are now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>, + <link linkend="quickbook.syntax.block.admonitions">Admonitions</link> + and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>) + may now contain paragraphs. + </para> + </warning> + <para> + The escaped space: <code><phrase role="special">\</phrase> </code> also + has a special meaning. The escaped space is removed from the output. + </para> + </section> + <section id="quickbook.syntax.phrase.images"> + <title><link linkend="quickbook.syntax.phrase.images">Images</link></title> +<programlisting><!--quickbook-escape-prefix-->[$image.jpg] +<!--quickbook-escape-postfix--></programlisting> + </section> + <section id="quickbook.syntax.phrase.footnotes"> + <title><link linkend="quickbook.syntax.phrase.footnotes">Footnotes</link></title> + <para> + As of version 1.3, QuickBook supports footnotes. Just put the text of the + footnote in a <code><phrase role="special">[</phrase><phrase role="identifier">footnote</phrase><phrase + role="special">]</phrase></code> block, and the text will be put at the + bottom of the current page. For example, this: + </para> +<programlisting><!--quickbook-escape-prefix-->[footnote A sample footnote] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate this<footnote id="quickbook.syntax.phrase.footnotes.f0"> + <para> + A sample footnote + </para> + </footnote>. + </para> + <section id="quickbook.syntax.phrase.footnotes.macro_expansion"> + <title><link linkend="quickbook.syntax.phrase.footnotes.macro_expansion">Macro + Expansion</link></title> +<programlisting><!--quickbook-escape-prefix-->__a_macro_identifier__ +<!--quickbook-escape-postfix--></programlisting> + <para> + See <link linkend="quickbook.syntax.block.macros">Macros</link> for details. + </para> + </section> + <section id="quickbook.syntax.phrase.footnotes.template_expansion"> + <title><link linkend="quickbook.syntax.phrase.footnotes.template_expansion">Template + Expansion</link></title> +<programlisting><!--quickbook-escape-prefix-->[a_template_identifier] +<!--quickbook-escape-postfix--></programlisting> + <para> + See <link linkend="quickbook.syntax.block.templates">Templates</link> + for details. + </para> + </section> + </section> + </section> + <section id="quickbook.syntax.block"> + <title><link linkend="quickbook.syntax.block">Block Level Elements</link></title> + <section id="quickbook.syntax.block.document"> + <title><link linkend="quickbook.syntax.block.document">Document</link></title> + <para> + Every document must begin with a Document Info section, which should look + like this: + </para> +<programlisting><!--quickbook-escape-prefix-->[document-type The Document Title + [quickbook 1.3] + [version 1.0] + [id the_document_name] + [dirname the_document_dir] + [copyright 2000 2002 2003 Joe Blow, Jane Doe] + [purpose The document's reason for being] + [category The document's category] + [authors [Blow, Joe], [Doe, Jane]] + [license The document's license] + [source-mode source-type] +] +<!--quickbook-escape-postfix--></programlisting> + <para> + Where document-type is one of: + </para> + <itemizedlist> + <listitem> + <simpara> + book + </simpara> + </listitem> + <listitem> + <simpara> + article + </simpara> + </listitem> + <listitem> + <simpara> + library + </simpara> + </listitem> + <listitem> + <simpara> + chapter + </simpara> + </listitem> + <listitem> + <simpara> + part + </simpara> + </listitem> + <listitem> + <simpara> + appendix + </simpara> + </listitem> + <listitem> + <simpara> + preface + </simpara> + </listitem> + <listitem> + <simpara> + qandadiv + </simpara> + </listitem> + <listitem> + <simpara> + qandaset + </simpara> + </listitem> + <listitem> + <simpara> + reference + </simpara> + </listitem> + <listitem> + <simpara> + set + </simpara> + </listitem> + </itemizedlist> + <para> + quickbook 1.3 declares the version of quickbook the document is written + for. In its absence, version 1.1 is assumed. + </para> + <para> + <literal>version</literal>, <literal>id</literal>, <literal>dirname</literal>, + <literal>copyright</literal>, <literal>purpose</literal>, <literal>category</literal>, + <literal>authors</literal>, <literal>license</literal>, <literal>last-revision</literal> + and <literal>source-mode</literal> are optional information. + </para> + <para> + <literal>source-type</literal> is a lowercase string setting the initial + <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link>. + If the <literal>source-mode</literal> field is omitted, a default value + of <literal>c++</literal> will be used. + </para> + </section> + <section id="quickbook.syntax.block.section"> + <title><link linkend="quickbook.syntax.block.section">Section</link></title> + <para> + Starting a new section is accomplished with: + </para> +<programlisting><!--quickbook-escape-prefix-->[section:id The Section Title] +<!--quickbook-escape-postfix--></programlisting> + <para> + where <emphasis>id</emphasis> is optional. id will be the filename of the + generated section. If it is not present, "The Section Title" + will be normalized and become the id. Valid characters are <literal>a-Z</literal>, + <literal>A-Z</literal>, <literal>0-9</literal> and <literal>_</literal>. + All non-valid characters are converted to underscore and all upper-case + are converted to lower case. Thus: "The Section Title" will be + normalized to "the_section_title". + </para> + <para> + End a section with: + </para> +<programlisting><!--quickbook-escape-prefix-->[endsect] +<!--quickbook-escape-postfix--></programlisting> + <para> + Sections can nest, and that results in a hierarchy in the table of contents. + </para> + </section> + <section id="quickbook.syntax.block.xinclude"> + <title><link linkend="quickbook.syntax.block.xinclude">xinclude</link></title> + <para> + You can include another XML file with: + </para> +<programlisting><!--quickbook-escape-prefix-->[xinclude file.xml] +<!--quickbook-escape-postfix--></programlisting> + <para> + This is useful when file.xml has been generated by Doxygen and contains + your reference section. + </para> + </section> + <section id="quickbook.syntax.block.paragraphs"> + <title><link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link></title> + <para> + Paragraphs start left-flushed and are terminated by two or more newlines. + No markup is needed for paragraphs. QuickBook automatically detects paragraphs + from the context. Block markups [section, endsect, h1, h2, h3, h4, h5, + h6, blurb, (block-quote) ':', pre, def, table and include ] may also terminate + a paragraph. + </para> + </section> + <section id="quickbook.syntax.block.lists"> + <title><link linkend="quickbook.syntax.block.lists">Lists</link></title> + <section id="quickbook.syntax.block.lists.ordered_lists"> + <title><link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered + lists</link></title> +<programlisting># One +# Two +# Three +</programlisting> + <para> + will generate: + </para> + <orderedlist> + <listitem> + <simpara> + One + </simpara> + </listitem> + <listitem> + <simpara> + Two + </simpara> + </listitem> + <listitem> + <simpara> + Three + </simpara> + </listitem> + </orderedlist> + </section> + <section id="quickbook.syntax.block.lists.list_hierarchies"> + <title><link linkend="quickbook.syntax.block.lists.list_hierarchies">List + Hierarchies</link></title> + <para> + List hierarchies are supported. Example: + </para> +<programlisting># One +# Two +# Three + # Three.a + # Three.b + # Three.c +# Four + # Four.a + # Four.a.i + # Four.a.ii +# Five +</programlisting> + <para> + will generate: + </para> + <orderedlist> + <listitem> + <simpara> + One + </simpara> + </listitem> + <listitem> + <simpara> + Two + </simpara> + </listitem> + <listitem> + <simpara> + Three + <orderedlist> + <listitem> + <simpara> + Three.a + </simpara> + </listitem> + <listitem> + <simpara> + Three.b + </simpara> + </listitem> + <listitem> + <simpara> + Three.c + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Fourth + <orderedlist> + <listitem> + <simpara> + Four.a + <orderedlist> + <listitem> + <simpara> + Four.a.i + </simpara> + </listitem> + <listitem> + <simpara> + Four.a.ii + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Five + </simpara> + </listitem> + </orderedlist> + </section> + <section id="quickbook.syntax.block.lists.long_list_lines"> + <title><link linkend="quickbook.syntax.block.lists.long_list_lines">Long + List Lines</link></title> + <para> + Long lines will be wrapped appropriately. Example: + </para> +<programlisting># A short item. +# A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. +# A short item. +</programlisting> + <orderedlist> + <listitem> + <simpara> + A short item. + </simpara> + </listitem> + <listitem> + <simpara> + A very long item. A very long item. A very long item. A very long + item. A very long item. A very long item. A very long item. A very + long item. A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. A very long + item. + </simpara> + </listitem> + <listitem> + <simpara> + A short item. + </simpara> + </listitem> + </orderedlist> + </section> + <section id="quickbook.syntax.block.lists.unordered_lists"> + <title><link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered + lists</link></title> +<programlisting><!--quickbook-escape-prefix-->* First +* Second +* Third +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <itemizedlist> + <listitem> + <simpara> + First + </simpara> + </listitem> + <listitem> + <simpara> + Second + </simpara> + </listitem> + <listitem> + <simpara> + Third + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="quickbook.syntax.block.lists.mixed_lists"> + <title><link linkend="quickbook.syntax.block.lists.mixed_lists">Mixed lists</link></title> + <para> + Mixed lists (ordered and unordered) are supported. Example: + </para> +<programlisting><!--quickbook-escape-prefix--># One +# Two +# Three + * Three.a + * Three.b + * Three.c +# Four +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <orderedlist> + <listitem> + <simpara> + One + </simpara> + </listitem> + <listitem> + <simpara> + Two + </simpara> + </listitem> + <listitem> + <simpara> + Three + <itemizedlist> + <listitem> + <simpara> + Three.a + </simpara> + </listitem> + <listitem> + <simpara> + Three.b + </simpara> + </listitem> + <listitem> + <simpara> + Three.c + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + Four + </simpara> + </listitem> + </orderedlist> + <para> + And... + </para> +<programlisting><!--quickbook-escape-prefix--># 1 + * 1.a + # 1.a.1 + # 1.a.2 + * 1.b +# 2 + * 2.a + * 2.b + # 2.b.1 + # 2.b.2 + * 2.b.2.a + * 2.b.2.b +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <orderedlist> + <listitem> + <simpara> + 1 + <itemizedlist> + <listitem> + <simpara> + 1.a + <orderedlist> + <listitem> + <simpara> + 1.a.1 + </simpara> + </listitem> + <listitem> + <simpara> + 1.a.2 + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + <listitem> + <simpara> + 1.b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <simpara> + 2 + <itemizedlist> + <listitem> + <simpara> + 2.a + </simpara> + </listitem> + <listitem> + <simpara> + 2.b + <orderedlist> + <listitem> + <simpara> + 2.b.1 + </simpara> + </listitem> + <listitem> + <simpara> + 2.b.2 + <itemizedlist> + <listitem> + <simpara> + 2.b.2.a + </simpara> + </listitem> + <listitem> + <simpara> + 2.b.2.b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + </orderedlist> + </section> + </section> + <section id="quickbook.syntax.block.code"> + <title><link linkend="quickbook.syntax.block.code">Code</link></title> + <para> + Preformatted code starts with a space or a tab. The code will be syntax + highlighted according to the current <link linkend="quickbook.syntax.phrase.source_mode">Source + Mode</link>: + </para> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// Sample code</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World\n"</phrase><phrase role="special">;</phrase> + <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> +<programlisting><phrase role="keyword">import</phrase> <phrase role="identifier">cgi</phrase> + +<phrase role="keyword">def</phrase> <phrase role="identifier">cookForHtml</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">):</phrase> + <phrase role="string">'''"Cooks" the input text for HTML.'''</phrase> + + <phrase role="keyword">return</phrase> <phrase role="identifier">cgi</phrase><phrase role="special">.</phrase><phrase role="identifier">escape</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">)</phrase> +</programlisting> + <para> + Macros that are already defined are expanded in source code. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[def __array__ [@http://www.boost.org/doc/html/array/reference.html array]] +[def __boost__ [@http://www.boost.org/libs/libraries.htm boost]] + + using __boost__::__array__; +<!--quickbook-escape-postfix--></programlisting> + <para> + Generates: + </para> +<programlisting><phrase role="keyword">using</phrase> <ulink url="http://www.boost.org/libs/libraries.htm">boost</ulink><phrase role="special">::</phrase><ulink url="http://www.boost.org/doc/html/array/reference.html">array</ulink><phrase role="special">;</phrase> +</programlisting> + </section> + <section id="quickbook.syntax.block.escape_back"> + <title><link linkend="quickbook.syntax.block.escape_back">Escaping Back To + QuickBook</link></title> + <para> + Inside code, code blocks and inline code, QuickBook does not allow any + markup to avoid conflicts with the target syntax (e.g. c++). In case you + need to switch back to QuickBook markup inside code, you can do so using + a language specific <emphasis>escape-back</emphasis> delimiter. In C++ + and Python, the delimiter is the double tick (back-quote): "``" + and "``". Example: + </para> +<programlisting><!--quickbook-escape-prefix-->void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``() +{ +} +<!--quickbook-escape-postfix--></programlisting> + <para> + Will generate: + </para> +<programlisting><phrase role="keyword">void</phrase> <ulink url="http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz">foo</ulink><phrase role="special">()</phrase> +<phrase role="special">{</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + When escaping from code to QuickBook, only phrase level markups are allowed. + Block level markups like lists, tables etc. are not allowed. + </para> + </section> + <section id="quickbook.syntax.block.preformatted"> + <title><link linkend="quickbook.syntax.block.preformatted">Preformatted</link></title> + <para> + Sometimes, you don't want some preformatted text to be parsed as C++. In + such cases, use the <literal>[pre ... ]</literal> markup block. + </para> +<programlisting><!--quickbook-escape-prefix-->[pre + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + +] +<!--quickbook-escape-postfix--></programlisting> + <para> + Spaces, tabs and newlines are rendered as-is. Unlike all quickbook block + level markup, pre (and Code) are the only ones that allow multiple newlines. + The markup above will generate: + </para> +<programlisting>Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text + + Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text + + Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text + +</programlisting> + <para> + Notice that unlike Code, phrase markup such as font style is still permitted + inside <literal>pre</literal> blocks. + </para> + </section> + <section id="quickbook.syntax.block.blockquote"> + <title><link linkend="quickbook.syntax.block.blockquote">Blockquote</link></title> +<programlisting><!--quickbook-escape-prefix-->[:sometext...]<!--quickbook-escape-postfix--> +</programlisting> + <blockquote> + <para> + Indents the paragraph. This applies to one paragraph only. + </para> + </blockquote> + </section> + <section id="quickbook.syntax.block.admonitions"> + <title><link linkend="quickbook.syntax.block.admonitions">Admonitions</link></title> +<programlisting><!--quickbook-escape-prefix-->[note This is a note] +[tip This is a tip] +[important This is important] +[caution This is a caution] +[warning This is a warning] +<!--quickbook-escape-postfix--></programlisting> + <para> + generates <ulink url="http://www.docbook.org/">DocBook</ulink> admonitions: + </para> + <note> + <para> + This is a note + </para> + </note> + <tip> + <para> + This is a tip + </para> + </tip> + <important> + <para> + This is important + </para> + </important> + <caution> + <para> + This is a caution + </para> + </caution> + <warning> + <para> + This is a warning + </para> + </warning> + <para> + These are the only admonitions supported by <ulink url="http://www.docbook.org/">DocBook</ulink>. + So, for example <literal>[information This is some information]</literal> + is unlikely to produce the desired effect. + </para> + </section> + <section id="quickbook.syntax.block.headings"> + <title><link linkend="quickbook.syntax.block.headings">Headings</link></title> +<programlisting><!--quickbook-escape-prefix-->[h1 Heading 1] +[h2 Heading 2] +[h3 Heading 3] +[h4 Heading 4] +[h5 Heading 5] +[h6 Heading 6] +<!--quickbook-escape-postfix--></programlisting> + <bridgehead renderas="sect1" id="quickbook.syntax.block.headings.h0"> + <phrase id="quickbook.syntax.block.headings.heading_1"/><link linkend="quickbook.syntax.block.headings.heading_1">Heading + 1</link> + </bridgehead> + <bridgehead renderas="sect2" id="quickbook.syntax.block.headings.h1"> + <phrase id="quickbook.syntax.block.headings.heading_2"/><link linkend="quickbook.syntax.block.headings.heading_2">Heading + 2</link> + </bridgehead> + <bridgehead renderas="sect3" id="quickbook.syntax.block.headings.h2"> + <phrase id="quickbook.syntax.block.headings.heading_3"/><link linkend="quickbook.syntax.block.headings.heading_3">Heading + 3</link> + </bridgehead> + <bridgehead renderas="sect4" id="quickbook.syntax.block.headings.h3"> + <phrase id="quickbook.syntax.block.headings.heading_4"/><link linkend="quickbook.syntax.block.headings.heading_4">Heading + 4</link> + </bridgehead> + <bridgehead renderas="sect5" id="quickbook.syntax.block.headings.h4"> + <phrase id="quickbook.syntax.block.headings.heading_5"/><link linkend="quickbook.syntax.block.headings.heading_5">Heading + 5</link> + </bridgehead> + <bridgehead renderas="sect6" id="quickbook.syntax.block.headings.h5"> + <phrase id="quickbook.syntax.block.headings.heading_6"/><link linkend="quickbook.syntax.block.headings.heading_6">Heading + 6</link> + </bridgehead> + <para> + Headings 1-3 [h1 h2 and h3] will automatically have anchors with normalized + names with <literal>name="section_id.normalized_header_text"</literal> + (i.e. valid characters are <literal>a-z</literal>, <literal>A-Z</literal>, + <literal>0-9</literal> and <literal>_</literal>. All non-valid characters + are converted to underscore and all upper-case are converted to lower-case. + For example: Heading 1 in section Section 2 will be normalized to <literal>section_2.heading_1</literal>). + You can use: + </para> +<programlisting><!--quickbook-escape-prefix-->[link section_id.normalized_header_text The link text] +<!--quickbook-escape-postfix--></programlisting> + <para> + to link to them. See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor + links</link> and <link linkend="quickbook.syntax.block.section">Section</link> + for more info. + </para> + </section> + <section id="quickbook.syntax.block.generic_heading"> + <title><link linkend="quickbook.syntax.block.generic_heading">Generic Heading</link></title> + <para> + In cases when you don't want to care about the heading level (1 to 6), + you can use the <emphasis>Generic Heading</emphasis>: + </para> +<programlisting><!--quickbook-escape-prefix-->[heading Heading] +<!--quickbook-escape-postfix--></programlisting> + <para> + The <emphasis>Generic Heading</emphasis> assumes the level, plus one, of + the innermost section where it is placed. For example, if it is placed + in the outermost section, then, it assumes <emphasis>h2</emphasis>. + </para> + <para> + Headings are often used as an alternative to sections. It is used particularly + if you do not want to start a new section. In many cases, however, headings + in a particular section is just flat. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[section A] +[h2 X] +[h2 Y] +[h2 Z] +[endsect] +<!--quickbook-escape-postfix--></programlisting> + <para> + Here we use h2 assuming that section A is the outermost level. If it is + placed in an inner level, you'll have to use h3, h4, etc. depending on + where the section is. In general, it is the section level plus one. It + is rather tedious, however, to scan the section level everytime. If you + rewrite the example above as shown below, this will be automatic: + </para> +<programlisting><!--quickbook-escape-prefix-->[section A] +[heading X] +[heading Y] +[heading Z] +[endsect] +<!--quickbook-escape-postfix--></programlisting> + <para> + They work well regardless where you place them. You can rearrange sections + at will without any extra work to ensure correct heading levels. In fact, + with <emphasis>section</emphasis> and <emphasis>heading</emphasis>, you + have all you need. <emphasis>h1</emphasis>..<emphasis>h6</emphasis> becomes + redundant. <emphasis>h1</emphasis>..<emphasis>h6</emphasis> might be deprecated + in the future. + </para> + </section> + <section id="quickbook.syntax.block.macros"> + <title><link linkend="quickbook.syntax.block.macros">Macros</link></title> +<programlisting><!--quickbook-escape-prefix-->[def macro_identifier some text] +<!--quickbook-escape-postfix--></programlisting> + <para> + When a macro is defined, the identifier replaces the text anywhere in the + file, in paragraphs, in markups, etc. macro_identifier is a string of non- + white space characters except ']'. A macro may not follow an alphabetic + character or the underscore. The replacement text can be any phrase (even + marked up). Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]] +sf_logo +<!--quickbook-escape-postfix--></programlisting> + <para> + Now everywhere the sf_logo is placed, the picture will be inlined. + </para> + <para> + <inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&type=1"></imagedata></imageobject> + <textobject> + <phrase>sflogo</phrase> + </textobject> + </inlinemediaobject> + </para> + <tip> + <para> + It's a good idea to use macro identifiers that are distinguishable. For + instance, in this document, macro identifiers have two leading and trailing + underscores (e.g. <literal>__spirit__</literal>). The reason is to avoid unwanted + macro replacement. + </para> + </tip> + <para> + Links (URLS) and images are good candidates for macros. <emphasis role="bold">1</emphasis>) + They tend to change a lot. It is a good idea to place all links and images + in one place near the top to make it easy to make changes. <emphasis role="bold">2</emphasis>) + The syntax is not pretty. It's easier to read and write, e.g. <literal>__spirit__</literal> + than <literal>[@http://spirit.sourceforge.net Spirit]</literal>. + </para> + <para> + Some more examples: + </para> +<programlisting><!--quickbook-escape-prefix-->[def :-) [$theme/smiley.png]] +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] +<!--quickbook-escape-postfix--></programlisting> + <para> + (See <link linkend="quickbook.syntax.phrase.images">Images</link> and + <link linkend="quickbook.syntax.phrase.links">Links</link>) + </para> + <para> + Invoking these macros: + </para> +<programlisting><!--quickbook-escape-prefix-->Hi __spirit__ :-) +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate this: + </para> + <para> + Hi <ulink url="http://spirit.sourceforge.net">Spirit</ulink> <inlinemediaobject><imageobject><imagedata + fileref="images/smiley.png"></imagedata></imageobject> + <textobject> + <phrase>smiley</phrase> + </textobject> + </inlinemediaobject> + </para> + </section> + <section id="quickbook.syntax.block.predefined_macros"> + <title><link linkend="quickbook.syntax.block.predefined_macros">Predefined + Macros</link></title> + <para> + Quickbook has some predefined macros that you can already use. + </para> + <table frame="all" id="quickbook.syntax.block.predefined_macros.t0"> + <title>Predefined Macros</title> + <tgroup cols="3"> + <thead> + <row> + <entry> + <para> + Macro + </para> + </entry> + <entry> + <para> + Meaning + </para> + </entry> + <entry> + <para> + Example + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + __DATE__ + </para> + </entry> + <entry> + <para> + Today's date + </para> + </entry> + <entry> + <para> + 2000-Dec-20 + </para> + </entry> + </row> + <row> + <entry> + <para> + __TIME__ + </para> + </entry> + <entry> + <para> + The current time + </para> + </entry> + <entry> + <para> + 12:00:00 PM + </para> + </entry> + </row> + <row> + <entry> + <para> + __FILENAME__ + </para> + </entry> + <entry> + <para> + Quickbook source filename + </para> + </entry> + <entry> + <para> + quickbook_manual-1_4.quickbook + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="quickbook.syntax.block.templates"> + <title><link linkend="quickbook.syntax.block.templates">Templates</link></title> + <para> + Templates provide a more versatile text substitution mechanism. Templates + come in handy when you need to create parameterizable, multi-line, boilerplate + text that you specify once and expand many times. Templates accept one + or more arguments. These arguments act like place-holders for text replacement. + Unlike simple macros, which are limited to phrase level markup, templates + can contain block level markup (e.g. paragraphs, code blocks and tables). + </para> + <para> + Example template: + </para> +<programlisting><!--quickbook-escape-prefix-->[template person[name age what] + +Hi, my name is [name]. I am [age] years old. I am a [what]. + +] +<!--quickbook-escape-postfix--></programlisting> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h0"> + <phrase id="quickbook.syntax.block.templates.template_identifier"/><link + linkend="quickbook.syntax.block.templates.template_identifier">Template + Identifier</link> + </bridgehead> + <para> + Template identifiers can either consist of: + </para> + <itemizedlist> + <listitem> + <simpara> + An initial alphabetic character or the underscore, followed by zero + or more alphanumeric characters or the underscore. This is similar + to your typical C/C++ identifier. + </simpara> + </listitem> + <listitem> + <simpara> + A single character punctuation (a non-alphanumeric printable character) + </simpara> + </listitem> + </itemizedlist> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h1"> + <phrase id="quickbook.syntax.block.templates.formal_template_arguments"/><link + linkend="quickbook.syntax.block.templates.formal_template_arguments">Formal + Template Arguments</link> + </bridgehead> + <para> + Template formal arguments are identifiers consisting of an initial alphabetic + character or the underscore, followed by zero or more alphanumeric characters + or the underscore. This is similar to your typical C/C++ identifier. + </para> + <para> + A template formal argument temporarily hides a template of the same name + at the point where the <link linkend="quickbook.syntax.block.templates.template_expansion">template + is expanded</link>. Note that the body of the <literal>person</literal> + template above refers to <literal>name</literal> <literal>age</literal> + and <literal>what</literal> as <literal>[name]</literal> <literal>[age]</literal> + and <literal>[what]</literal>. <literal>name</literal> <literal>age</literal> + and <literal>what</literal> are actually templates that exist in the duration + of the template call. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h2"> + <phrase id="quickbook.syntax.block.templates.template_body"/><link linkend="quickbook.syntax.block.templates.template_body">Template + Body</link> + </bridgehead> + <para> + The template body can be just about any QuickBook block or phrase. There + are actually two forms. Templates may be phrase or block level. Phrase + templates are of the form: + </para> +<programlisting><!--quickbook-escape-prefix-->[template sample[arg1 arg2...argN] replacement text... ] +<!--quickbook-escape-postfix--></programlisting> + <para> + Block templates are of the form: + </para> +<programlisting><!--quickbook-escape-prefix-->[template sample[arg1 arg2...argN] +replacement text... +] +<!--quickbook-escape-postfix--></programlisting> + <para> + The basic rule is as follows: if a newline immediately follows the argument + list, then it is a block template, otherwise, it is a phrase template. + Phrase templates are typically expanded as part of phrases. Like macros, + block level elements are not allowed in phrase templates. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h3"> + <phrase id="quickbook.syntax.block.templates.template_expansion"/><link + linkend="quickbook.syntax.block.templates.template_expansion">Template + Expansion</link> + </bridgehead> + <para> + You expand a template this way: + </para> +<programlisting><!--quickbook-escape-prefix-->[template_identifier arg1..arg2..arg3] +<!--quickbook-escape-postfix--></programlisting> + <para> + At template expansion, you supply the actual arguments. The template will + be expanded with your supplied arguments. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[person James Bond..39..Spy] +[person Santa Clause..87..Big Red Fatso] +<!--quickbook-escape-postfix--></programlisting> + <para> + Which will expand to: + </para> + <para> + Hi, my name is James Bond. I am 39 years old. I am a Spy. + </para> + <para> + Hi, my name is Santa Clause. I am 87 years old. I am a Big Red Fatso. + </para> + <caution> + <para> + A word of caution: Templates are recursive. A template can call another + template or even itself, directly or indirectly. There are no control + structures in QuickBook (yet) so this will always mean infinite recursion. + QuickBook can detect this situation and report an error if recursion + exceeds a certain limit. + </para> + </caution> + <para> + Each actual argument can be a word, a text fragment or just about any + <link linkend="quickbook.syntax.phrase">QuickBook phrase</link>. Arguments + are separated by the double dot <literal>".."</literal> and terminated + by the close parenthesis. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h4"> + <phrase id="quickbook.syntax.block.templates.nullary_templates"/><link + linkend="quickbook.syntax.block.templates.nullary_templates">Nullary Templates</link> + </bridgehead> + <para> + Nullary templates look and act like simple macros. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[template alpha[]'''&#945;'''] +[template beta[]'''&#946;'''] +<!--quickbook-escape-postfix--></programlisting> + <para> + Expanding: + </para> +<programlisting><!--quickbook-escape-prefix-->Some squigles...[*[alpha][beta]]<!--quickbook-escape-postfix--></programlisting> + <para> + We have: + </para> + <para> + Some squiggles...<emphasis role="bold">αβ</emphasis> + </para> + <para> + The difference with macros are + </para> + <itemizedlist> + <listitem> + <simpara> + The explicit <link linkend="quickbook.syntax.block.templates.template_expansion">template + expansion syntax</link>. This is an advantage because, now, we don't + have to use obscure naming conventions like double underscores (e.g. + __alpha__) to avoid unwanted macro replacement. + </simpara> + </listitem> + <listitem> + <simpara> + The template is expanded at the point where it is invoked. A macro + is expanded immediately at its point of declaration. This is subtle + and can cause a slight difference in behavior especially if you refer + to other macros and templates in the body. + </simpara> + </listitem> + </itemizedlist> + <para> + The empty brackets after the template identifier (<literal>alpha[]</literal>) + indicates no arguments. If the template body does not look like a template + argument list, we can elide the empty brackets. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[template aristotle_quote Aristotle: [*['Education is the best provision +for the journey to old age.]]] +<!--quickbook-escape-postfix--></programlisting> + <para> + Expanding: + </para> +<programlisting><!--quickbook-escape-prefix-->Here's a quote from [aristotle_quote]. +<!--quickbook-escape-postfix--></programlisting> + <para> + We have: + </para> + <para> + Here's a quote from Aristotle: <emphasis role="bold"><emphasis>Education + is the best provision for the journey to old age.</emphasis></emphasis>. + </para> + <para> + The disadvantage is that you can't avoid the space between the template + identifier, <code><phrase role="identifier">aristotle_quote</phrase></code>, + and the template body "Aristotle...". This space will be part + of the template body. If that space is unwanted, use empty brackets or + use the space escape: "<code><phrase role="special">\</phrase> </code>". + Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[template tag\ _tag] +<!--quickbook-escape-postfix--></programlisting> + <para> + Then expanding: + </para> +<programlisting><!--quickbook-escape-prefix-->`struct` x[tag]; +<!--quickbook-escape-postfix--></programlisting> + <para> + We have: + </para> + <para> + <code><phrase role="keyword">struct</phrase></code> x_tag; + </para> + <para> + You have a couple of ways to do it. I personally prefer the explicit empty + brackets, though. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h5"> + <phrase id="quickbook.syntax.block.templates.simple_arguments"/><link linkend="quickbook.syntax.block.templates.simple_arguments">Simple + Arguments</link> + </bridgehead> + <para> + As mentioned, arguments are separated by the double dot <literal>".."</literal>. + If there are less arguments passed than expected, QuickBook attempts to + break the last argument into two or more arguments following this logic: + </para> + <itemizedlist> + <listitem> + <simpara> + Break the last argument into two, at the first space found (<literal>'', + '\n', \t' or '\r'</literal>). + </simpara> + </listitem> + <listitem> + <simpara> + Repeat until there are enough arguments or if there are no more spaces + found (in which case, an error is reported). + </simpara> + </listitem> + </itemizedlist> + <para> + For example: + </para> +<programlisting><!--quickbook-escape-prefix-->[template simple[a b c d] [a][b][c][d]] +[simple w x y z] +<!--quickbook-escape-postfix--></programlisting> + <para> + will produce: + </para> + <para> + wxyz + </para> + <para> + "w x y z" is initially treated as a single argument because we + didn't supply any <literal>".."</literal> separators. However, + since <literal>simple</literal> expects 4 arguments, "w x y z" + is broken down iteratively (applying the logic above) until we have "w", + "x", "y" and "z". + </para> + <para> + QuickBook only tries to get the arguments it needs. For example: + </para> +<programlisting><!--quickbook-escape-prefix-->[simple w x y z trail] +<!--quickbook-escape-postfix--></programlisting> + <para> + will produce: + </para> + <para> + wxyz trail + </para> + <para> + The arguments being: "w", "x", "y" and "z + trail". + </para> + <para> + It should be obvious now that for simple arguments with no spaces, we can + get by without separating the arguments with <literal>".."</literal> + separators. It is possible to combine <literal>".."</literal> + separators with the argument passing simplification presented above. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[simple what do you think ..m a n?] +<!--quickbook-escape-postfix--></programlisting> + <para> + will produce: + </para> + <para> + what do you think man? + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.templates.h6"> + <phrase id="quickbook.syntax.block.templates.punctuation_templates"/><link + linkend="quickbook.syntax.block.templates.punctuation_templates">Punctuation + Templates</link> + </bridgehead> + <para> + With templates, one of our objectives is to allow us to rewrite QuickBook + in QuickBook (as a qbk library). For that to happen, we need to accommodate + single character punctuation templates which are fairly common in QuickBook. + You might have noticed that single character punctuations are allowed as + <link linkend="quickbook.syntax.block.templates.template_identifier">template + identifiers</link>. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[template ![bar] <!--quickbook-escape-postfix--><hey><!--quickbook-escape-prefix-->[bar]<!--quickbook-escape-postfix--></hey><!--quickbook-escape-prefix-->] +<!--quickbook-escape-postfix--></programlisting> + <para> + Now, expanding this: + </para> +<programlisting><!--quickbook-escape-prefix-->[!baz] +<!--quickbook-escape-postfix--></programlisting> + <para> + We will have: + </para> +<programlisting><hey>baz</hey> +</programlisting> + </section> + <section id="quickbook.syntax.block.blurbs"> + <title><link linkend="quickbook.syntax.block.blurbs">Blurbs</link></title> +<programlisting><!--quickbook-escape-prefix-->[blurb :-) [*An eye catching advertisement or note...] + + __spirit__ is an object-oriented recursive-descent parser generator framework + implemented using template meta-programming techniques. Expression templates + allow us to approximate the syntax of Extended Backus-Normal Form (EBNF) + completely in C++. +] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate this: + </para> + <sidebar role="blurb"> + <para> + <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject> + <textobject> + <phrase>smiley</phrase> + </textobject> + </inlinemediaobject> <emphasis role="bold">An eye catching advertisement + or note...</emphasis> + </para> + <para> + <ulink url="http://spirit.sourceforge.net">Spirit</ulink> is an object-oriented + recursive-descent parser generator framework implemented using template + meta-programming techniques. Expression templates allow us to approximate + the syntax of Extended Backus-Normal Form (EBNF) completely in C++. + </para> + </sidebar> + <note> + <para> + Prefer <link linkend="quickbook.syntax.block.admonitions">admonitions</link> + wherever appropriate. + </para> + </note> + </section> + <section id="quickbook.syntax.block.tables"> + <title><link linkend="quickbook.syntax.block.tables">Tables</link></title> +<programlisting><!--quickbook-escape-prefix-->[table A Simple Table + [[Heading 1] [Heading 2] [Heading 3]] + [[R0-C0] [R0-C1] [R0-C2]] + [[R1-C0] [R1-C1] [R1-C2]] + [[R2-C0] [R2-C1] [R2-C2]] +] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <table frame="all" id="quickbook.syntax.block.tables.t0"> + <title>A Simple Table</title> + <tgroup cols="3"> + <thead> + <row> + <entry> + <para> + Heading 1 + </para> + </entry> + <entry> + <para> + Heading 2 + </para> + </entry> + <entry> + <para> + Heading 3 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + R0-C0 + </para> + </entry> + <entry> + <para> + R0-C1 + </para> + </entry> + <entry> + <para> + R0-C2 + </para> + </entry> + </row> + <row> + <entry> + <para> + R2-C0 + </para> + </entry> + <entry> + <para> + R2-C1 + </para> + </entry> + <entry> + <para> + R2-C2 + </para> + </entry> + </row> + <row> + <entry> + <para> + R3-C0 + </para> + </entry> + <entry> + <para> + R3-C1 + </para> + </entry> + <entry> + <para> + R3-C2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <para> + The table title is optional. The first row of the table is automatically + treated as the table header; that is, it is wrapped in <literal><thead>...</thead></literal> + XML tags. Note that unlike the original QuickDoc, the columns are nested + in [ cells... ]. The syntax is free-format and allows big cells to be formatted + nicely. Example: + </para> +<programlisting><!--quickbook-escape-prefix-->[table Table with fat cells + [[Heading 1] [Heading 2]] + [ + [Row 0, Col 0: a small cell] + [ + Row 0, Col 1: a big fat cell with paragraphs + + Boost provides free peer-reviewed portable C++ source libraries. + + We emphasize libraries that work well with the C++ Standard Library. + Boost libraries are intended to be widely useful, and usable across + a broad spectrum of applications. The Boost license encourages both + commercial and non-commercial use. + ] + ] + [ + [Row 1, Col 0: a small cell] + [Row 1, Col 1: a small cell] + ] +] +<!--quickbook-escape-postfix--></programlisting> + <para> + and thus: + </para> + <table frame="all" id="quickbook.syntax.block.tables.t1"> + <title>Table with fat cells</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Heading 1 + </para> + </entry> + <entry> + <para> + Heading 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Row 0, Col 0: a small cell + </para> + </entry> + <entry> + <para> + Row 0, Col 1: a big fat cell with paragraphs + </para> + <para> + Boost provides free peer-reviewed portable C++ source libraries. + </para> + <para> + We emphasize libraries that work well with the C++ Standard Library. + Boost libraries are intended to be widely useful, and usable + across a broad spectrum of applications. The Boost license encourages + both commercial and non-commercial use. + </para> + </entry> + </row> + <row> + <entry> + <para> + Row 1, Col 0: a small cell + </para> + </entry> + <entry> + <para> + Row 1, Col 1: a small cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <para> + Here's how to have preformatted blocks of code in a table cell: + </para> +<programlisting><!--quickbook-escape-prefix-->[table Table with code + [[Comment] [Code]] + [ + [My first program] + [<!--quickbook-escape-postfix-->`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + ``<!--quickbook-escape-prefix-->] + ] +] +<!--quickbook-escape-postfix--></programlisting> + <table frame="all" id="quickbook.syntax.block.tables.t2"> + <title>Table with code</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Comment + </para> + </entry> + <entry> + <para> + Code + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + My first program + </para> + </entry> + <entry> + <para> +<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> + <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> + <section id="quickbook.syntax.block.variable_lists"> + <title><link linkend="quickbook.syntax.block.variable_lists">Variable Lists</link></title> +<programlisting><!--quickbook-escape-prefix-->[variablelist A Variable List + [[term 1] [The definition of term 1]] + [[term 2] [The definition of term 2]] + [[term 3] [The definition of term 3]] +] +<!--quickbook-escape-postfix--></programlisting> + <para> + will generate: + </para> + <variablelist> + <title>A Variable List</title> + <varlistentry> + <term>term 1</term> + <listitem> + <para> + The definition of term 1 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>term 2</term> + <listitem> + <para> + The definition of term 2 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>term 3</term> + <listitem> + <para> + The definition of term 3 + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + The rules for variable lists are the same as for tables, except that only + 2 "columns" are allowed. The first column contains the terms, + and the second column contains the definitions. Those familiar with HTML + will recognize this as a "definition list". + </para> + </section> + <section id="quickbook.syntax.block.include"> + <title><link linkend="quickbook.syntax.block.include">Include</link></title> + <para> + You can include one QuickBook file from another. The syntax is simply: + </para> +<programlisting><!--quickbook-escape-prefix-->[include someother.qbk] +<!--quickbook-escape-postfix--></programlisting> + <para> + The included file will be processed as if it had been cut and pasted into + the current document, with the following exceptions: + </para> + <itemizedlist> + <listitem> + <simpara> + The __FILENAME__ predefined macro will reflect the name of the file currently being + processed. + </simpara> + </listitem> + <listitem> + <simpara> + Any macros defined in the included file are scoped to that file. + </simpara> + </listitem> + </itemizedlist> + <para> + The <literal>[include]</literal> directive lets you specify a document + id to use for the included file. When this id is not explicitly specified, + the id defaults to the filename ("someother", in the example + above). You can specify the id like this: + </para> +<programlisting><!--quickbook-escape-prefix-->[include:someid someother.qbk] +<!--quickbook-escape-postfix--></programlisting> + <para> + All auto-generated anchors will use the document id as a unique prefix. + So for instance, if there is a top section in someother.qbk named "Intro", + the named anchor for that section will be "someid.intro", and + you can link to it with <literal>[link someid.intro The Intro]</literal>. + </para> + </section> + <section id="quickbook.syntax.block.import"> + <title><link linkend="quickbook.syntax.block.import">Import</link></title> + <para> + When documenting code, you'd surely need to present code from actual source + files. While it is possible to copy some code and paste them in your QuickBook + file, doing so is error prone and the extracted code in the documentation + tends to get out of sync with the actual code as the code evolves. The + problem, as always, is that once documentation is written, the tendency + is for the docs to languish in the archives without maintenance. + </para> + <para> + QuickBook's import facility provides a nice solution. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.import.h0"> + <phrase id="quickbook.syntax.block.import.example"/><link linkend="quickbook.syntax.block.import.example">Example</link> + </bridgehead> + <para> + You can effortlessly import code snippets from source code into your QuickBook. + The following illustrates how this is done: + </para> +<programlisting><!--quickbook-escape-prefix-->[import ../test/stub.cpp] +[foo] +[bar] +<!--quickbook-escape-postfix--></programlisting> + <para> + The first line: + </para> +<programlisting><!--quickbook-escape-prefix-->[import ../test/stub.cpp] +<!--quickbook-escape-postfix--></programlisting> + <para> + collects specially marked-up code snippets from <ulink url="../../test/stub.cpp">stub.cpp</ulink> + and places them in your QuickBook file as virtual templates. Each of the + specially marked-up code snippets has a name (e.g. <code><phrase role="identifier">foo</phrase></code> + and <code><phrase role="identifier">bar</phrase></code> in the example + above). This shall be the template identifier for that particular code + snippet. The second and third line above does the actual template expansion: + </para> +<programlisting><!--quickbook-escape-prefix-->[foo] +[bar] +<!--quickbook-escape-postfix--></programlisting> + <para> + And the result is: + </para> + <para> + This is the <emphasis role="bold"><emphasis>foo</emphasis></emphasis> function. + </para> + <para> + This description can have paragraphs... + </para> + <itemizedlist> + <listitem> + <simpara> + lists + </simpara> + </listitem> + <listitem> + <simpara> + etc. + </simpara> + </listitem> + </itemizedlist> + <para> + And any quickbook block markup. + </para> + <para> +<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// return 'em, foo man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> + This is the <emphasis role="bold"><emphasis>bar</emphasis></emphasis> function + </para> + <para> +<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">bar</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="comment">// return 'em, bar man!</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> + Some trailing text here + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.import.h1"> + <phrase id="quickbook.syntax.block.import.code_snippet_markup"/><link linkend="quickbook.syntax.block.import.code_snippet_markup">Code + Snippet Markup</link> + </bridgehead> + <para> + Note how the code snippets in <ulink url="../../test/stub.cpp">stub.cpp</ulink> + get marked up. We use distinguishable comments following the form: + </para> +<programlisting><phrase role="comment">//[id</phrase> +<phrase role="identifier">some</phrase> <phrase role="identifier">code</phrase> <phrase role="identifier">here</phrase> +<phrase role="comment">//]</phrase> +</programlisting> + <para> + The first comment line above initiates a named code-snippet. This prefix + will not be visible in quickbook. The entire code-snippet in between <code><phrase + role="comment">//[id</phrase></code> and <code><phrase role="comment">//]</phrase></code> + will be inserted as a template in quickbook with name <emphasis><emphasis>id</emphasis></emphasis>. + The comment <code><phrase role="comment">//]</phrase></code> ends a code-snippet + This too will not be visible in quickbook. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.import.h2"> + <phrase id="quickbook.syntax.block.import.special_comments"/><link linkend="quickbook.syntax.block.import.special_comments">Special + Comments</link> + </bridgehead> + <para> + Special comments of the form: + </para> +<programlisting><phrase role="comment">//` some [*quickbook] markup here</phrase> +</programlisting> + <para> + and: + </para> +<programlisting><phrase role="comment">/*` some [*quickbook] markup here */</phrase> +</programlisting> + <para> + will be parsed by QuickBook. This can contain quickbook <emphasis>blocks</emphasis> + (e.g. sections, paragraphs, tables, etc). In the first case, the initial + slash-slash, tick and white-space shall be ignored. In the second, the + initial slash-star-tick and the final star-slash shall be ignored. + </para> + <bridgehead renderas="sect5" id="quickbook.syntax.block.import.h3"> + <phrase id="quickbook.syntax.block.import.callouts"/><link linkend="quickbook.syntax.block.import.callouts">Callouts</link> + </bridgehead> + <para> + Special comments of the form: + </para> +<programlisting><phrase role="comment">/*< some [*quickbook] markup here >*/</phrase> +</programlisting> + <para> + will be regarded as callouts. These will be collected, numbered and rendered + as a "callout bug" (a small icon with a number). After the whole + snippet is parsed, the callout list is generated. See <ulink url="http://www.docbook.org/tdg/en/html/callout.html">Callouts</ulink> + for details. Example: + </para> + <para> +<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo_bar</phrase><phrase role="special">()</phrase> <co id="quickbook.syntax.block.import.c0" linkends="quickbook.syntax.block.import.c1" /> +<phrase role="special">{</phrase> + <phrase role="keyword">return</phrase> <phrase role="string">"foo-bar"</phrase><phrase role="special">;</phrase> <co id="quickbook.syntax.block.import.c2" linkends="quickbook.syntax.block.import.c3" /> +<phrase role="special">}</phrase> +</programlisting> + </para> + <calloutlist> + <callout arearefs="quickbook.syntax.block.import.c0" id="quickbook.syntax.block.import.c1"> + <para> + The <emphasis>Mythical</emphasis> FooBar. See <ulink url="http://en.wikipedia.org/wiki/Foobar">Foobar + for details</ulink> + </para> + </callout> + <callout arearefs="quickbook.syntax.block.import.c2" id="quickbook.syntax.block.import.c3"> + <para> + return 'em, foo-bar man! + </para> + </callout> + </calloutlist> + <para> + Checkout <ulink url="../../test/stub.cpp">stub.cpp</ulink> to see the actual + code. + </para> + </section> + </section> + </section> + <section id="quickbook.install"> + <title><link linkend="quickbook.install">Installation and configuration</link></title> + <para> + This section provides some guidelines on how to install and configure BoostBook + and Quickbook under several operating systems. + </para> + <para> + Before continuing, it is very important that you keep this in mind: if you + try to build some documents and the process breaks due to misconfiguration, + be absolutely sure to delete any <code><phrase role="identifier">bin</phrase></code> + and <code><phrase role="identifier">bin</phrase><phrase role="special">.</phrase><phrase + role="identifier">v2</phrase></code> directories generated by the build before + trying again. Otherwise your configuration fixes will not take any effect. + </para> + <section id="quickbook.install.windows"> + <title><link linkend="quickbook.install.windows">Windows 2000, XP, 2003, Vista</link></title> + <blockquote> + <para> + <emphasis>Section contributed by Julio M. Merino Vidal</emphasis> + </para> + </blockquote> + <para> + The following instructions apply to any Windows system based on Windows 2000, + including Windows XP, Windows 2003 Server and Windows Vista. The paths shown + below are taken from a Windows Vista machine; you will need to adjust them + to match your system in case you are running an older version. + </para> + <orderedlist> + <listitem> + <simpara> + First of all you need to have a copy of <code><phrase role="identifier">xsltproc</phrase></code> + for Windows. There are many ways to get this tool, but to keep things + simple, use the <ulink url="http://www.zlatkovic.com/pub/libxml/">binary + packages</ulink> made by Igor Zlatkovic. At the very least, you need + to download the following packages: <code><phrase role="identifier">iconv</phrase></code>, + <code><phrase role="identifier">zlib</phrase></code>, <code><phrase role="identifier">libxml2</phrase></code> + and <code><phrase role="identifier">libxslt</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Unpack all these packages in the same directory so that you get unique + <code><phrase role="identifier">bin</phrase></code>, <code><phrase role="identifier">include</phrase></code> + and <code><phrase role="identifier">lib</phrase></code> directories within + the hierarchy. These instructions use <code><phrase role="identifier">C</phrase><phrase + role="special">:\</phrase><phrase role="identifier">Users</phrase><phrase + role="special">\</phrase><phrase role="identifier">example</phrase><phrase + role="special">\</phrase><phrase role="identifier">Documents</phrase><phrase + role="special">\</phrase><phrase role="identifier">boost</phrase><phrase + role="special">\</phrase><phrase role="identifier">xml</phrase></code> + as the root for all files. + </simpara> + </listitem> + <listitem> + <simpara> + From the command line, go to the <code><phrase role="identifier">bin</phrase></code> + directory and launch <code><phrase role="identifier">xsltproc</phrase><phrase + role="special">.</phrase><phrase role="identifier">exe</phrase></code> + to ensure it works. You should get usage information on screen. + </simpara> + </listitem> + <listitem> + <simpara> + Download <ulink url="http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip">Docbook + XML 4.2</ulink> and unpack it in the same directory used above. That + is: <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase + role="identifier">Users</phrase><phrase role="special">\</phrase><phrase + role="identifier">example</phrase><phrase role="special">\</phrase><phrase + role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase + role="identifier">boost</phrase><phrase role="special">\</phrase><phrase + role="identifier">xml</phrase><phrase role="special">\</phrase><phrase + role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase + role="identifier">xml</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Download the latest <ulink url="http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608">Docbook + XSL</ulink> version and unpack it, again in the same directory used before. + To make things easier, rename the directory created during the extraction + to <code><phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase + role="identifier">xsl</phrase></code> (bypassing the version name): + <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase + role="identifier">Users</phrase><phrase role="special">\</phrase><phrase + role="identifier">example</phrase><phrase role="special">\</phrase><phrase + role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase + role="identifier">boost</phrase><phrase role="special">\</phrase><phrase + role="identifier">xml</phrase><phrase role="special">\</phrase><phrase + role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase + role="identifier">xsl</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Add the following to your <code><phrase role="identifier">user</phrase><phrase + role="special">-</phrase><phrase role="identifier">config</phrase><phrase + role="special">.</phrase><phrase role="identifier">jam</phrase></code> + file, which should live in your home directory (<code><phrase role="special">%</phrase><phrase + role="identifier">HOMEDRIVE</phrase><phrase role="special">%%</phrase><phrase + role="identifier">HOMEPATH</phrase><phrase role="special">%</phrase></code>). + You must already have it somewhere or otherwise you could not be building + Boost (i.e. missing tools configuration). + </simpara> + </listitem> + </orderedlist> +<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase> + <phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/bin/xsltproc.exe"</phrase> + <phrase role="special">;</phrase> + +<phrase role="identifier">using</phrase> <phrase role="identifier">boostbook</phrase> + <phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/docbook-xsl"</phrase> + <phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/docbook-xml"</phrase> + <phrase role="special">;</phrase> +</programlisting> + <para> + The above steps are enough to get a functional BoostBook setup. Quickbook + will be automatically built when needed. If you want to avoid these rebuilds: + </para> + <orderedlist> + <listitem> + <simpara> + Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase + role="special">\</phrase><phrase role="identifier">tools</phrase><phrase + role="special">\</phrase><phrase role="identifier">quickbook</phrase></code>). + </simpara> + </listitem> + <listitem> + <simpara> + Build the utility by issuing <code><phrase role="identifier">bjam</phrase> + <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Copy the resulting <code><phrase role="identifier">quickbook</phrase><phrase + role="special">.</phrase><phrase role="identifier">exe</phrase></code> + binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase + role="special">\</phrase><phrase role="identifier">bin</phrase><phrase + role="special">.</phrase><phrase role="identifier">v2</phrase></code> + hierarchy) to a safe place. Following our previous example, you can install + it into: <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase + role="identifier">Users</phrase><phrase role="special">\</phrase><phrase + role="identifier">example</phrase><phrase role="special">\</phrase><phrase + role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase + role="identifier">boost</phrase><phrase role="special">\</phrase><phrase + role="identifier">xml</phrase><phrase role="special">\</phrase><phrase + role="identifier">bin</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Add the following to your <code><phrase role="identifier">user</phrase><phrase + role="special">-</phrase><phrase role="identifier">config</phrase><phrase + role="special">.</phrase><phrase role="identifier">jam</phrase></code> + file: + </simpara> + </listitem> + </orderedlist> +<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase> + <phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/bin/quickbook.exe"</phrase> + <phrase role="special">;</phrase> +</programlisting> + </section> + <section id="quickbook.install.linux"> + <title><link linkend="quickbook.install.linux">Debian, Ubuntu</link></title> + <para> + The following instructions apply to Debian and its derivatives. They are + based on a Ubuntu Edgy install but should work on other Debian based systems. + </para> + <para> + First install the <code><phrase role="identifier">bjam</phrase></code>, + <code><phrase role="identifier">xsltproc</phrase></code>, <code><phrase role="identifier">docbook</phrase><phrase + role="special">-</phrase><phrase role="identifier">xsl</phrase></code> and + <code><phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase + role="identifier">xml</phrase></code> packages. For example, using <code><phrase + role="identifier">apt</phrase><phrase role="special">-</phrase><phrase role="identifier">get</phrase></code>: + </para> +<programlisting><phrase role="identifier">sudo</phrase> <phrase role="identifier">apt</phrase><phrase role="special">-</phrase><phrase role="identifier">get</phrase> <phrase role="identifier">install</phrase> <phrase role="identifier">xsltprc</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xsl</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xml</phrase> +</programlisting> + <para> + If you're planning on building boost's documentation, you'll also need to + install the <code><phrase role="identifier">doxygen</phrase></code> package + as well. + </para> + <para> + Next, we need to configure Boost Build to compile BoostBook files. Add the + following to your <code><phrase role="identifier">user</phrase><phrase role="special">-</phrase><phrase + role="identifier">config</phrase><phrase role="special">.</phrase><phrase + role="identifier">jam</phrase></code> file, which should be in your home + directory. If you don't have one, create a file containing this text. For + more information on setting up <code><phrase role="identifier">user</phrase><phrase + role="special">-</phrase><phrase role="identifier">config</phrase><phrase + role="special">.</phrase><phrase role="identifier">jam</phrase></code>, see + the <ulink url="http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html">Boost + Build documentation</ulink>. + </para> +<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase> <phrase role="special">;</phrase> + +<phrase role="identifier">using</phrase> <phrase role="identifier">boostbook</phrase> + <phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">share</phrase><phrase role="special">/</phrase><phrase role="identifier">xml</phrase><phrase role="special">/</phrase><phrase role="identifier">docbook</phrase><phrase role="special">/</phrase><phrase role="identifier">stylesheet</phrase><phrase role="special">/</phrase><phrase role="identifier">nwalsh</phrase> + <phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">share</phrase><phrase role="special">/</phrase><phrase role="identifier">xml</phrase><phrase role="special">/</phrase><phrase role="identifier">docbook</phrase><phrase role="special">/</phrase><phrase role="identifier">schema</phrase><phrase role="special">/</phrase><phrase role="identifier">dtd</phrase><phrase role="special">/</phrase><phrase role="number">4.2</phrase> + <phrase role="special">;</phrase> + +<phrase role="comment"># Remove this line if you're not using doxygen</phrase> +<phrase role="identifier">using</phrase> <phrase role="identifier">doxygen</phrase> <phrase role="special">;</phrase> +</programlisting> + <para> + The above steps are enough to get a functional BoostBook setup. Quickbook + will be automatically built when needed. If you want to avoid these rebuilds: + </para> + <orderedlist> + <listitem> + <simpara> + Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase + role="special">/</phrase><phrase role="identifier">tools</phrase><phrase + role="special">/</phrase><phrase role="identifier">quickbook</phrase></code>). + </simpara> + </listitem> + <listitem> + <simpara> + Build the utility by issuing <code><phrase role="identifier">bjam</phrase> + <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Copy the resulting <code><phrase role="identifier">quickbook</phrase></code> + binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase + role="special">/</phrase><phrase role="identifier">bin</phrase><phrase + role="special">.</phrase><phrase role="identifier">v2</phrase></code> + hierarchy) to a safe place. The traditional location is <code><phrase + role="special">/</phrase><phrase role="identifier">usr</phrase><phrase + role="special">/</phrase><phrase role="identifier">local</phrase><phrase + role="special">/</phrase><phrase role="identifier">bin</phrase></code>. + </simpara> + </listitem> + <listitem> + <simpara> + Add the following to your <code><phrase role="identifier">user</phrase><phrase + role="special">-</phrase><phrase role="identifier">config</phrase><phrase + role="special">.</phrase><phrase role="identifier">jam</phrase></code> + file, using the full path of the quickbook executable: + </simpara> + </listitem> + </orderedlist> +<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase> + <phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">local</phrase><phrase role="special">/</phrase><phrase role="identifier">bin</phrase><phrase role="special">/</phrase><phrase role="identifier">quickbook</phrase> + <phrase role="special">;</phrase> +</programlisting> + </section> + </section> + <section id="quickbook.editors"> + <title><link linkend="quickbook.editors">Editor Support</link></title> + <para> + Editing quickbook files is usually done with text editors both simple and powerful. + The following sections list the settings for some editors which can help make + editing quickbook files a bit easier. + </para> + <sidebar role="blurb"> + <para> + <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject> + <textobject> + <phrase>note</phrase> + </textobject> + </inlinemediaobject> You may submit your settings, tips, and suggestions to + the authors, or through the <ulink url="https://lists.sourceforge.net/lists/listinfo/boost-">docs + Boost Docs mailing list</ulink>. + </para> + </sidebar> + <section id="quickbook.editors.scite"> + <title><link linkend="quickbook.editors.scite">Scintilla Text Editor</link></title> + <blockquote> + <para> + <emphasis>Section contributed by Dean Michael Berris</emphasis> + </para> + </blockquote> + <para> + The Scintilla Text Editor (SciTE) is a free source code editor for Win32 + and X. It uses the SCIntilla source code editing component. + </para> + <sidebar role="blurb"> + <para> + <inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject> + <textobject> + <phrase>tip</phrase> + </textobject> + </inlinemediaobject> SciTE can be downloaded from <ulink url="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html</ulink> + </para> + </sidebar> + <para> + You can use the following settings to highlight quickbook tags when editing + quickbook files. + </para> +<programlisting><!--quickbook-escape-prefix-->qbk=*.qbk +lexer.*.qbk=props +use.tabs.$(qbk)=0 +tab.size.$(qbk)=4 +indent.size.$(qbk)=4 +style.props.32=$(font.base) +comment.stream.start.props=[/ +comment.stream.end.props=] +comment.box.start.props=[/ +comment.box.middle.props= +comment.box.end.props=] +<!--quickbook-escape-postfix--></programlisting> + <sidebar role="blurb"> + <para> + <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject> + <textobject> + <phrase>note</phrase> + </textobject> + </inlinemediaobject> Thanks to Rene Rivera for the above SciTE settings. + </para> + </sidebar> + </section> + </section> + <section id="quickbook.faq"> + <title><link linkend="quickbook.faq">Frequently Asked Questions</link></title> + <bridgehead renderas="sect3" id="quickbook.faq.h0"> + <phrase id="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"/><link + linkend="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_">Can + I use QuickBook for non-Boost documentation?</link> + </bridgehead> + <para> + QuickBook can be used for non-Boost documentation with a little extra work. + </para> + <blockquote> + <para> + <emphasis>Faq contributed by Michael Marcin</emphasis> + </para> + </blockquote> + <para> + When building HTML documentation with BoostBook a Boost C++ Libraries header + is added to the files. When using QuickBook to document projects outside of + Boost this is not desirable. This behavior can be overridden at the BoostBook + level by specifying some XSLT options. When using Boost Build version 2 (BBv2) + this can be achieved by adding parameters to the BoostBook target declaration. + </para> + <para> + For example: + </para> +<programlisting>using quickbook ; + +xml my_doc : my_doc.qbk ; + +boostbook standalone + : + my_doc + : + <xsl:param>boost.image.src=images/my_project_logo.png + <xsl:param>boost.image.alt="\"My Project\"" + <xsl:param>boost.image.w=100 + <xsl:param>boost.image.h=50 + <xsl:param>nav.layout=none + ; +</programlisting> + </section> + <section id="quickbook.ref"> + <title><link linkend="quickbook.ref">Quick Reference</link></title> + <para> + [cpp] + </para> + <table frame="all" id="quickbook.ref.t0"> + <title>Syntax Compendium</title> + <tgroup cols="3"> + <thead> + <row> + <entry> + <para> + To do this... + </para> + </entry> + <entry> + <para> + Use this... + </para> + </entry> + <entry> + <para> + See this... + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + comment + </para> + </entry> + <entry> + <para> + <literal>[/ some comment]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.comments">Comments</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <emphasis>italics</emphasis> + </para> + </entry> + <entry> + <para> + <literal>['italics] or /italics/</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link> + and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple + formatting</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <emphasis role="bold">bold</emphasis> + </para> + </entry> + <entry> + <para> + <literal>[*bold] or *bold*</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link> + and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple + formatting</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <emphasis role="underline">underline</emphasis> + </para> + </entry> + <entry> + <para> + <literal>[_underline] or _underline_</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link> + and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple + formatting</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <literal>teletype</literal> + </para> + </entry> + <entry> + <para> + <literal>[^teletype] or =teletype=</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link> + and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple + formatting</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <emphasis role="strikethrough">strikethrough</emphasis> + </para> + </entry> + <entry> + <para> + <literal>[-strikethrough]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link> + and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple + formatting</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + <replaceable>replaceable</replaceable> + </para> + </entry> + <entry> + <para> + <literal>[~replaceable]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.replaceable">Replaceble</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + source mode + </para> + </entry> + <entry> + <para> + <literal>[c++]</literal> or <literal>[python]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + inline code + </para> + </entry> + <entry> + <para> + <literal>`int main();`</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.inline_code">Inline code</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + code block + </para> + </entry> + <entry> + <para> + <literal>``int main();``</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.code">Code</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + code escape + </para> + </entry> + <entry> + <para> + <literal>``from c++ to QuickBook``</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.escape_back">Escaping Back + To QuickBook</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + line break + </para> + </entry> + <entry> + <para> + <literal>[br] or \n</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.line_break">line-break</link> + <emphasis role="bold">DEPRECATED</emphasis> + </para> + </entry> + </row> + <row> + <entry> + <para> + anchor + </para> + </entry> + <entry> + <para> + <literal>[#anchor]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.anchors">Anchors</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + link + </para> + </entry> + <entry> + <para> + <literal>[@http://www.boost.org Boost]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.links">Links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + anchor link + </para> + </entry> + <entry> + <para> + <literal>[link section.anchor Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + refentry link + </para> + </entry> + <entry> + <para> + <literal>[link xml.refentry Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.refentry_links">refentry links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + function link + </para> + </entry> + <entry> + <para> + <literal>[funcref fully::qualified::function_name Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + class link + </para> + </entry> + <entry> + <para> + <literal>[classref fully::qualified::class_name Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + member link + </para> + </entry> + <entry> + <para> + <literal>[memberref fully::qualified::member_name Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + enum link + </para> + </entry> + <entry> + <para> + <literal>[enumref fully::qualified::enum_name Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + macro link + </para> + </entry> + <entry> + <para> + <literal>[macroref MACRO_NAME Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + concept link + </para> + </entry> + <entry> + <para> + <literal>[conceptref ConceptName Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + header link + </para> + </entry> + <entry> + <para> + <literal>[headerref path/to/header.hpp Link text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + escape + </para> + </entry> + <entry> + <para> + <literal>'''escaped text (no processing/formatting)'''</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.escape">Escape</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + single char escape + </para> + </entry> + <entry> + <para> + <literal>\c</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.single_char_escape">Single + char escape</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + images + </para> + </entry> + <entry> + <para> + <literal>[$image.jpg]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.phrase.images">Images</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + begin section + </para> + </entry> + <entry> + <para> + <literal>[section The Section Title]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.section">Section</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + end section + </para> + </entry> + <entry> + <para> + <literal>[endsect]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.section">Section</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + paragraph + </para> + </entry> + <entry> + <para> + No markup. Paragraphs start left-flushed and are terminated by two + or more newlines. + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + ordered list + </para> + </entry> + <entry> +<programlisting><!--quickbook-escape-prefix--># one +# two +# three +<!--quickbook-escape-postfix--></programlisting> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered + lists</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + unordered list + </para> + </entry> + <entry> +<programlisting><!--quickbook-escape-prefix-->* one +* two +* three +<!--quickbook-escape-postfix--></programlisting> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered + lists</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + code + </para> + </entry> + <entry> + <para> + No markup. Preformatted code starts with a space or a tab. + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.code">Code</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + preformatted + </para> + </entry> + <entry> + <para> + <literal>[pre preformatted]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.preformatted">Preformatted</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + block quote + </para> + </entry> + <entry> + <para> + <literal>[:sometext...]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.blockquote">Blockquote</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 1 + </para> + </entry> + <entry> + <para> + <literal>[h1 Heading 1]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 2 + </para> + </entry> + <entry> + <para> + <literal>[h2 Heading 2]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 3 + </para> + </entry> + <entry> + <para> + <literal>[h3 Heading 3]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 4 + </para> + </entry> + <entry> + <para> + <literal>[h4 Heading 4]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 5 + </para> + </entry> + <entry> + <para> + <literal>[h5 Heading 5]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + heading 6 + </para> + </entry> + <entry> + <para> + <literal>[h6 Heading 6]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.headings">Heading</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + macro + </para> + </entry> + <entry> + <para> + <literal>[def macro_identifier some text]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.macros">Macros</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + template + </para> + </entry> + <entry> + <para> + <literal>[template[a b] [a] body [b]]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.templates">Templates</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + blurb + </para> + </entry> + <entry> + <para> + <literal>[blurb advertisement or note...]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.blurbs">Blurbs</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + admonition + </para> + </entry> + <entry> + <para> + <literal>[warning Warning text...]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.admonitions">Admonitions</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + table + </para> + </entry> + <entry> +<programlisting><!--quickbook-escape-prefix-->[table Title +[[a][b][c]] +[[a][b][c]] +] +<!--quickbook-escape-postfix--></programlisting> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.tables">Tables</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + variablelist + </para> + </entry> + <entry> +<programlisting><!--quickbook-escape-prefix-->[variablelist Title +[[a][b]] +[[a][b]] +] +<!--quickbook-escape-postfix--></programlisting> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.variable_lists">Variable Lists</link> + </para> + </entry> + </row> + <row> + <entry> + <para> + include + </para> + </entry> + <entry> + <para> + <literal>[include someother.qbk]</literal> + </para> + </entry> + <entry> + <para> + <link linkend="quickbook.syntax.block.include">Include</link> + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold-html b/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold-html new file mode 100644 index 000000000..0eeaf54e2 --- /dev/null +++ b/src/boost/tools/quickbook/test/quickbook_manual-1_4.gold-html @@ -0,0 +1,4177 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Quickbook 1.4 + </h3> + <div class="authorgroup"> + <h3 class="author"> + Joel de Guzman + </h3> + <h3 class="author"> + Eric Niebler + </h3> + </div> + <p class="copyright"> + 2002, 2004, 2006 Joel de Guzman, Eric Niebler + </p> + <div class="legalnotice"> + <p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> + </div> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#quickbook.intro">Introduction</a> + </li> + <li> + <a href="#quickbook.change_log">Change Log</a> + </li> + <li> + <a href="#quickbook.syntax">Syntax Summary</a> + </li> + <li> + <a href="#quickbook.install">Installation and configuration</a> + </li> + <li> + <a href="#quickbook.editors">Editor Support</a> + </li> + <li> + <a href="#quickbook.faq">Frequently Asked Questions</a> + </li> + <li> + <a href="#quickbook.ref">Quick Reference</a> + </li> + </ul> + </div> + <div id="quickbook.intro"> + <h3> + Introduction + </h3> + <div id="quickbook.intro"> + <blockquote> + <p> + <span class="bold"><strong><span class="emphasis"><em><q>Why program + by hand in five days what you can spend five years of your life automating?</q></em></span></strong></span> + </p> + <p> + -- Terrence Parr, author ANTLR/PCCTS + </p> + </blockquote> + <p> + Well, QuickBook started as a weekend hack. It was originally intended to + be a sample application using <a href="http://spirit.sourceforge.net">Spirit</a>. + What is it? What you are viewing now, this documentation, is autogenerated + by QuickBook. These files were generated from one master: + </p> + <blockquote> + <p> + <a href="../quickbook.qbk">quickbook.qbk</a> + </p> + </blockquote> + <p> + Originally named QuickDoc, this funky tool that never dies evolved into + a funkier tool thanks to Eric Niebler who resurrected the project making + it generate <a href="http://www.boost.org/doc/html/boostbook.html">BoostBook</a> + instead of HTML. The <a href="http://www.boost.org/doc/html/boostbook.html">BoostBook</a> + documentation format is an extension of <a href="http://www.docbook.org/">DocBook</a>, + an SGML or XML based format for describing documentation. + </p> + <p> + QuickBook is a WikiWiki style documentation tool geared towards C++ documentation + using simple rules and markup for simple formatting tasks. QuickBook extends + the WikiWiki concept. Like the WikiWiki, QuickBook documents are simple + text files. A single QuickBook document can generate a fully linked set + of nice HTML and PostScript/PDF documents complete with images and syntax- + colorized source code. + </p> + <p> + Features include: + </p> + <ul> + <li> + <div> + generate <a href="http://www.boost.org/doc/html/boostbook.html">BoostBook</a> + xml, to generate HTML, PostScript and PDF + </div> + </li> + <li> + <div> + simple markup to link to Doxygen-generated entities + </div> + </li> + <li> + <div> + macro system for simple text substitution + </div> + </li> + <li> + <div> + simple markup for italics, bold, preformatted, blurbs, code samples, + tables, URLs, anchors, images, etc. + </div> + </li> + <li> + <div> + automatic syntax coloring of code samples + </div> + </li> + <li> + <div> + CSS support + </div> + </li> + </ul> + </div> + </div> + <div id="quickbook.change_log"> + <h3> + Change Log + </h3> + <div id="quickbook.change_log"> + <h3 id="quickbook.change_log.version_1_3"> + Version 1.3 + </h3> + <ul> + <li> + <div> + Quickbook file inclusion [include]. + </div> + </li> + <li> + <div> + Better xml output (pretty layout). Check out the generated XML. + </div> + </li> + <li> + <div> + Regression testing facility: to make sure your document will always + be compatible (full backward compatibility) regardless of changes to + QuickBook. + </div> + </li> + <li> + <div> + Code cleanup and refactoring. + </div> + </li> + <li> + <div> + Allow phrase markup in the doc-info. + </div> + </li> + <li> + <div> + Preformatted code blocks via ``code`` (double ticks) allows code in + tables and lists, for example. + </div> + </li> + <li> + <div> + Quickbook versioning; allows full backward compatibility. You have + to add [quickbook 1.3] to the doc-info header to enable the new features. + Without this, QuickBook will assume that the document is a pre-1.3 + document. + </div> + </li> + <li> + <div> + Better (intuitive) paragraph termination. Some markups may terminate + a paragraph. Example: +<pre class="programlisting"><span class="special">[</span><span class="identifier">section</span> <span class="identifier">x</span><span class="special">]</span> +<span class="identifier">blah</span><span class="special">...</span> +<span class="special">[</span><span class="identifier">endsect</span><span class="special">]</span></pre> + </div> + </li> + <li> + <div> + Fully qualified section and headers. Subsection names are concatenated + to the ID to avoid clashing. Example: <code><span class="identifier">doc_name</span><span + class="special">.</span><span class="identifier">sect_name</span><span + class="special">.</span><span class="identifier">sub_sect_name</span><span + class="special">.</span><span class="identifier">sub_sub_sect_name</span></code> + </div> + </li> + <li> + <div> + Better &nbsp; and whitespace handling in code snippets. + </div> + </li> + <li> + <div> + [xinclude] fixes up the relative path to the target XML file when input_directory + is not the same as the output_directory. + </div> + </li> + <li> + <div> + Allow untitled tables. + </div> + </li> + <li> + <div> + Allow phrase markups in section titles. + </div> + </li> + <li> + <div> + Allow escaping back to QuickBook from code, code blocks and inline + code. + </div> + </li> + <li> + <div> + Footnotes, with the [footnote This is the footnote] syntax. + </div> + </li> + <li> + <div> + Post-processor bug fix for escaped XML code that it does not recognize. + </div> + </li> + <li> + <div> + Replaceable, with the [~replacement] syntax. + </div> + </li> + <li> + <div> + Generic Headers + </div> + </li> + <li> + <div> + Code changes to allow full recursion (i.e. Collectors and push/pop + functions) + </div> + </li> + <li> + <div> + Various code cleanup/maintenance + </div> + </li> + <li> + <div> + Templates! + </div> + </li> + <li> + <div> + [conceptref] for referencing BoostBook <concept> entities. + </div> + </li> + <li> + <div> + Allow escape of spaces. The escaped space is removed from the output. + Syntax: <code><span class="special">\</span> </code>. + </div> + </li> + <li> + <div> + Nested comments are now allowed. + </div> + </li> + <li> + <div> + Quickbook blocks can nest inside comments. + </div> + </li> + <li> + <div> + <a href="#quickbook.syntax.block.import">Import</a> facility. + </div> + </li> + <li> + <div> + Callouts on imported code + </div> + </li> + <li> + <div> + Simple markups can now span a whole block. + </div> + </li> + <li> + <div> + <a href="#quickbook.syntax.block.blurbs">Blurbs</a>, <a href="#quickbook.syntax.block.admonitions">Admonitions</a> + and table cells (see <a href="#quickbook.syntax.block.tables">Tables</a>) + may now contain paragraphs. + </div> + </li> + <li> + <div> + <code><span class="special">\</span><span class="identifier">n</span></code> + and <code><span class="special">[</span><span class="identifier">br</span><span + class="special">]</span></code> are now deprecated. + </div> + </li> + </ul> + </div> + </div> + <div id="quickbook.syntax"> + <h3> + Syntax Summary + </h3> + <div id="quickbook.syntax"> + <p> + A QuickBook document is composed of one or more blocks. An example of a + block is the paragraph or a C++ code snippet. Some blocks have special + mark-ups. Blocks, except code snippets which have their own grammar (C++ + or Python), are composed of one or more phrases. A phrase can be a simple + contiguous run of characters. Phrases can have special mark-ups. Marked + up phrases can recursively contain other phrases, but cannot contain blocks. + A terminal is a self contained block-level or phrase-level element that + does not nest anything. + </p> + <p> + Blocks, in general, are delimited by two end-of-lines (the block terminator). + Phrases in each block cannot contain a block terminator. This way, syntax + errors such as un-matched closing brackets do not go haywire and corrupt + anything past a single block. + </p> + </div> + <div id="quickbook.syntax.comments"> + <h3> + Comments + </h3> + <div id="quickbook.syntax.comments"> + <p> + Can be placed anywhere. + </p> +<pre class="programlisting">[/ comment (no output generated) ] +</pre> +<pre class="programlisting">[/ comments can be nested [/ some more here] ] +</pre> +<pre class="programlisting">[/ Quickbook blocks can nest inside comments. [*Comment this out too!] ] +</pre> + </div> + </div> + <div id="quickbook.syntax.phrase"> + <h3> + Phrase Level Elements + </h3> + <div id="quickbook.syntax.phrase"> + </div> + <div id="quickbook.syntax.phrase.font_styles"> + <h3> + Font Styles + </h3> + <div id="quickbook.syntax.phrase.font_styles"> +<pre class="programlisting">['italic], [*bold], [_underline], [^teletype], [-strikethrough] +</pre> + <p> + will generate: + </p> + <p> + <span class="emphasis"><em>italic</em></span>, <span class="bold"><strong>bold</strong></span>, + <span class="underline">underline</span>, <tt>teletype</tt>, <span + class="strikethrough">strikethrough</span> + </p> + <p> + Like all non-terminal phrase level elements, this can of course be + nested: + </p> +<pre class="programlisting">[*['bold-italic]] +</pre> + <p> + will generate: + </p> + <p> + <span class="bold"><strong><span class="emphasis"><em>bold-italic</em></span></strong></span> + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.replaceable"> + <h3> + Replaceable + </h3> + <div id="quickbook.syntax.phrase.replaceable"> + <p> + When you want content that may or must be replaced by the user, use + the syntax: + </p> +<pre class="programlisting">[~replacement] +</pre> + <p> + This will generate: + </p> + <p> + <em class="replaceable">replacement</em> + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.quotations"> + <h3> + Quotations + </h3> + <div id="quickbook.syntax.phrase.quotations"> +<pre class="programlisting">["A question that sometimes drives me hazy: am I or are the others crazy?]--Einstein +</pre> + <p> + will generate: + </p> + <p> + <q>A question that sometimes drives me hazy: am I or are the others + crazy?</q>--Einstein + </p> + <p> + Note the proper left and right quote marks. Also, while you can simply + use ordinary quote marks like "quoted", our quotation, above, + will generate correct DocBook quotations (e.g. <quote>quoted</quote>). + </p> + <p> + Like all phrase elements, quotations may be nested. Example: + </p> +<pre class="programlisting">["Here's the rule for bargains: ["Do other men, for they would do you.] That's +the true business precept.] +</pre> + <p> + will generate: + </p> + <p> + <q>Here's the rule for bargains: <q>Do other men, for they would do + you.</q> That's the true business precept.</q> + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.simple_formatting"> + <h3> + Simple formatting + </h3> + <div id="quickbook.syntax.phrase.simple_formatting"> + <p> + Simple markup for formatting text, common in many applications, is + now supported: + </p> +<pre class="programlisting">/italic/, *bold*, _underline_, =teletype= +</pre> + <p> + will generate: + </p> + <p> + <span class="emphasis"><em>italic</em></span>, <span class="bold"><strong>bold</strong></span>, + <span class="underline">underline</span>, <tt>teletype</tt> + </p> + <p> + Unlike QuickBook's standard formatting scheme, the rules for simpler + alternatives are much stricter<a id="quickbook.syntax.phrase.simple_formatting.f0" + href="#footnote-1"><sup class="footnote">[1]</sup></a>. + </p> + <ul> + <li> + <div> + Simple markups cannot nest. You can combine a simple markup with + a nestable markup. + </div> + </li> + <li> + <div> + Simple markups cannot contain any other form of quickbook markup. + </div> + </li> + <li> + <div> + A non-space character must follow the leading markup + </div> + </li> + <li> + <div> + A non-space character must precede the trailing markup + </div> + </li> + <li> + <div> + A space or a punctuation must follow the trailing markup + </div> + </li> + <li> + <div> + If the matching markup cannot be found within a block, the formatting + will not be applied. This is to ensure that un-matched formatting + markups, which can be a common mistake, does not corrupt anything + past a single block. We do not want the rest of the document to + be rendered bold just because we forgot a trailing '*'. A single + block is terminated by two end of lines or the close bracket: ']'. + </div> + </li> + <li> + <div> + A line starting with the star will be interpreted as an unordered + list. See <a href="#quickbook.syntax.block.lists.unordered_lists">Unordered + lists</a>. + </div> + </li> + </ul> + <div id="quickbook.syntax.phrase.simple_formatting.t0" class="table"> + <table> + <caption>More Formatting Samples</caption> + <thead> + <tr> + <th> + <p> + Markup + </p> + </th> + <th> + <p> + Result + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + <tt>*Bold*</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>Bold</strong></span> + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*Is bold*</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>Is bold</strong></span> + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>* Not bold* *Not bold * * Not bold *</tt> + </p> + </td> + <td> + <p> + * Not bold* *Not bold * * Not bold * + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>This*Isn't*Bold (no bold)</tt> + </p> + </td> + <td> + <p> + This*Isn't*Bold (no bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>(*Bold Inside*) (parenthesis not bold)</tt> + </p> + </td> + <td> + <p> + (<span class="bold"><strong>Bold Inside</strong></span>) + (parenthesis not bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*(Bold Outside)* (parenthesis bold)</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>(Bold Outside)</strong></span> + (parenthesis bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>3*4*5 = 60 (no bold)</tt> + </p> + </td> + <td> + <p> + 3*4*5 = 60 (no bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>3 * 4 * 5 = 60 (no bold)</tt> + </p> + </td> + <td> + <p> + 3 * 4 * 5 = 60 (no bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>3 *4* 5 = 60 (4 is bold)</tt> + </p> + </td> + <td> + <p> + 3 <span class="bold"><strong>4</strong></span> 5 = 60 (4 + is bold) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*This is bold* this is not *but this is*</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>This is bold</strong></span> this + is not <span class="bold"><strong>but this is</strong></span> + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*This is bold*.</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>This is bold</strong></span>. + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*B*. (bold B)</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>B</strong></span>. (bold B) + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>['*Bold-Italic*]</tt> + </p> + </td> + <td> + <p> + <span class="emphasis"><em><span class="bold"><strong>Bold-Italic</strong></span></em></span> + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>*side-by*/-side/</tt> + </p> + </td> + <td> + <p> + <span class="bold"><strong>side-by</strong></span><span class="emphasis"><em>-side</em></span> + </p> + </td> + </tr> + </tbody> + </table> + </div> + <p> + As mentioned, simple markups cannot go past a single block. The text + from "have" to "full" in the following paragraph + will be rendered as bold: + </p> +<pre class="programlisting">Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full!* +One for the master, one for the dame, +And one for the little boy who lives down the lane. +</pre> + <p> + Baa baa black sheep, <span class="bold"><strong>have you any wool? + Yes sir, yes sir, three bags full!</strong></span> One for the master, + one for the dame, And one for the little boy who lives down the lane. + </p> + <p> + But in the following paragraph, bold is not applied: + </p> +<pre class="programlisting">Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full! +One for the master, one for the dame, +And one for the little boy who lives down the lane. +</pre> + <p> + Baa baa black sheep, *have you any wool? Yes sir, yes sir, three bags + full! One for the master, one for the dame, And one for the little + boy who lives down the lane. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.inline_code"> + <h3> + Inline code + </h3> + <div id="quickbook.syntax.phrase.inline_code"> + <p> + Inlining code in paragraphs is quite common when writing C++ documentation. + We provide a very simple markup for this. For example, this: + </p> +<pre class="programlisting">This text has inlined code `int main() { return 0; }` in it. +</pre> + <p> + will generate: + </p> + <p> + This text has inlined code <code><span class="keyword">int</span> + <span class="identifier">main</span><span class="special">()</span> + <span class="special">{</span> <span class="keyword">return</span> + <span class="number">0</span><span class="special">;</span> <span class="special">}</span></code> + in it. The code will be syntax highlighted. + </p> + <div class="note"> + <p> + We simply enclose the code with the tick: <tt>"`"</tt>, not the single + quote: <code><span class="string">"'"</span></code>. Note + too that <tt>`some code`</tt> is preferred over <tt>[^some code]</tt>. + </p> + </div> + </div> + </div> + <div id="quickbook.syntax.phrase.code_blocks"> + <h3> + Code blocks + </h3> + <div id="quickbook.syntax.phrase.code_blocks"> + <p> + Preformatted code simply starts with a space or a tab (See <a href="#quickbook.syntax.block.code">Code</a>). + However, such a simple syntax cannot be used as phrase elements in + lists (See <a href="#quickbook.syntax.block.lists.ordered_lists">Ordered + lists</a> and <a href="#quickbook.syntax.block.lists.unordered_lists">Unordered + lists</a>), tables (See <a href="#quickbook.syntax.block.tables">Tables</a>), + etc. Inline code (see above) can. The problem is, inline code does + not allow formatting with newlines, spaces, and tabs. These are lost. + </p> + <p> + We provide a phrase level markup that is a mix between the two. By + using the double-tick, instead of the single-tick, we are telling QuickBook + to use preformatted blocks of code. Example: + </p> +<pre class="programlisting">`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } +`` +</pre> + <p> + will generate: + </p> + <p> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello, World!"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> + <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.source_mode"> + <h3> + Source Mode + </h3> + <div id="quickbook.syntax.phrase.source_mode"> + <p> + If a document contains more than one type of source code then the source + mode may be changed dynamically as the document is processed. All QuickBook + documents are initially in C++ mode by default, though an alternative + initial value may be set in the <a href="#quickbook.syntax.block.document">Document</a> + section. + </p> + <p> + To change the source mode, use the <tt>[source-mode]</tt> markup, where + <tt>source-mode</tt> is one of the supported modes. For example, this: + </p> +<pre class="programlisting">Python's [python] `import` is rather like C++'s [c++] `#include`. A +C++ comment `// looks like this` whereas a Python comment [python] +`# looks like this`. +</pre> + <p> + will generate: + </p> + <p> + Python's <code><span class="keyword">import</span></code> is rather + like C++'s <code><span class="preprocessor">#include</span></code>. + A C++ comment <code><span class="comment">// looks like this</span></code> + whereas a Python comment <code><span class="comment">#looks like this</span></code>. + </p> + <div id="quickbook.syntax.phrase.source_mode.t0" class="table"> + <table> + <caption>Supported Source Modes</caption> + <thead> + <tr> + <th> + <p> + Mode + </p> + </th> + <th> + <p> + Source Mode Markup + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + C++ + </p> + </td> + <td> + <p> + <tt>[c++]</tt> + </p> + </td> + </tr> + <tr> + <td> + <p> + Python + </p> + </td> + <td> + <p> + <tt>[python]</tt> + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="note"> + <p> + The source mode strings are lowercase. + </p> + </div> + </div> + </div> + <div id="quickbook.syntax.phrase.line_break"> + <h3> + line-break + </h3> + <div id="quickbook.syntax.phrase.line_break"> +<pre class="programlisting">[br] +</pre> + <div class="warning"> + <p> + <code><span class="special">[</span><span class="identifier">br</span><span + class="special">]</span></code> is now deprecated. <a href="#quickbook.syntax.block.blurbs">Blurbs</a>, + <a href="#quickbook.syntax.block.admonitions">Admonitions</a> and + table cells (see <a href="#quickbook.syntax.block.tables">Tables</a>) + may now contain paragraphs. + </p> + </div> + </div> + </div> + <div id="quickbook.syntax.phrase.anchors"> + <h3> + Anchors + </h3> + <div id="quickbook.syntax.phrase.anchors"> +<pre class="programlisting">[#named_anchor] +</pre> + <p> + A named anchor is a hook that can be referenced by a link elsewhere + in the document. You can then reference an anchor with <tt>[link named_anchor + Some link text]</tt>. See <a href="#quickbook.syntax.phrase.anchor_links">Anchor + links</a>, <a href="#quickbook.syntax.block.section">Section</a> and + <a href="#quickbook.syntax.block.headings">Heading</a>. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.links"> + <h3> + Links + </h3> + <div id="quickbook.syntax.phrase.links"> +<pre class="programlisting">[@http://www.boost.org this is [*boost's] website....] +</pre> + <p> + will generate: + </p> + <p> + <a href="http://www.boost.org">this is <span class="bold"><strong>boost's</strong></span> + website....</a> + </p> + <p> + URL links where the link text is the link itself is common. Example: + </p> +<pre class="programlisting">see http://spirit.sourceforge.net/ +</pre> + <p> + so, when the text is absent in a link markup, the URL is assumed. Example: + </p> +<pre class="programlisting">see [@http://spirit.sourceforge.net/] +</pre> + <p> + will generate: + </p> + <p> + see <a href="http://spirit.sourceforge.net/">http://spirit.sourceforge.net/</a> + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.anchor_links"> + <h3> + Anchor links + </h3> + <div id="quickbook.syntax.phrase.anchor_links"> + <p> + You can link within a document using: + </p> +<pre class="programlisting">[link section_id.normalized_header_text The link text] +</pre> + <p> + See sections <a href="#quickbook.syntax.block.section">Section</a> + and <a href="#quickbook.syntax.block.headings">Heading</a> for more + info. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.refentry_links"> + <h3> + refentry links + </h3> + <div id="quickbook.syntax.phrase.refentry_links"> + <p> + In addition, you can link internally to an XML refentry like: + </p> +<pre class="programlisting">[link xml.refentry The link text] +</pre> + <p> + This gets converted into <tt><link linkend="xml.refentry">The + link text</link></tt>. + </p> + <p> + Like URLs, the link text is optional. If this is not present, the link + text will automatically be the refentry. Example: + </p> +<pre class="programlisting">[link xml.refentry] +</pre> + <p> + This gets converted into <tt><link linkend="xml.refentry">xml.refentry</link></tt>. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.code_links"> + <h3> + Code Links + </h3> + <div id="quickbook.syntax.phrase.code_links"> + <p> + If you want to link to a function, class, member, enum, concept or + header in the reference section, you can use: + </p> +<pre class="programlisting">[funcref fully::qualified::function_name The link text] +[classref fully::qualified::class_name The link text] +[memberref fully::qualified::member_name The link text] +[enumref fully::qualified::enum_name The link text] +[macroref MACRO_NAME The link text] +[conceptref ConceptName The link text] +[headerref path/to/header.hpp The link text] +</pre> + <p> + Again, the link text is optional. If this is not present, the link + text will automatically be the function, class, member, enum, macro, + concept or header. Example: + </p> +<pre class="programlisting">[classref boost::bar::baz] +</pre> + <p> + would have "boost::bar::baz" as the link text. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.escape"> + <h3> + Escape + </h3> + <div id="quickbook.syntax.phrase.escape"> + <p> + The escape mark-up is used when we don't want to do any processing. + </p> +<pre class="programlisting">''' +escape (no processing/formatting) +''' +</pre> + <p> + Escaping allows us to pass XML markup to <a href="http://www.boost.org/doc/html/boostbook.html">BoostBook</a> + or <a href="http://www.docbook.org/">DocBook</a>. For example: + </p> +<pre class="programlisting">''' +<emphasis role="bold">This is direct XML markup</emphasis> +''' +</pre> + <p> + <span class="bold"><strong>This is direct XML markup</strong></span> + </p> + <div class="important"> + <p> + Be careful when using the escape. The text must conform to <a href="http://www.boost.org/doc/html/boostbook.html">BoostBook</a>/<a + href="http://www.docbook.org/">DocBook</a> syntax. + </p> + </div> + </div> + </div> + <div id="quickbook.syntax.phrase.single_char_escape"> + <h3> + Single char escape + </h3> + <div id="quickbook.syntax.phrase.single_char_escape"> + <p> + The backslash may be used to escape a single punctuation character. + The punctuation immediately after the backslash is passed without any + processing. This is useful when we need to escape QuickBook punctuations + such as <code><span class="special">[</span></code> and <code><span + class="special">]</span></code>. For example, how do you escape the + triple quote? Simple: <tt>\'\'\'</tt> + </p> + <p> + <code><span class="special">\</span><span class="identifier">n</span></code> + has a special meaning. It is used to generate line breaks. + </p> + <div class="warning"> + <p> + <code><span class="special">\</span><span class="identifier">n</span></code> + and <code><span class="special">[</span><span class="identifier">br</span><span + class="special">]</span></code> are now deprecated. <a href="#quickbook.syntax.block.blurbs">Blurbs</a>, + <a href="#quickbook.syntax.block.admonitions">Admonitions</a> and + table cells (see <a href="#quickbook.syntax.block.tables">Tables</a>) + may now contain paragraphs. + </p> + </div> + <p> + The escaped space: <code><span class="special">\</span> </code> also + has a special meaning. The escaped space is removed from the output. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.images"> + <h3> + Images + </h3> + <div id="quickbook.syntax.phrase.images"> +<pre class="programlisting">[$image.jpg] +</pre> + </div> + </div> + <div id="quickbook.syntax.phrase.footnotes"> + <h3> + Footnotes + </h3> + <div id="quickbook.syntax.phrase.footnotes"> + <p> + As of version 1.3, QuickBook supports footnotes. Just put the text + of the footnote in a <code><span class="special">[</span><span class="identifier">footnote</span><span + class="special">]</span></code> block, and the text will be put at + the bottom of the current page. For example, this: + </p> +<pre class="programlisting">[footnote A sample footnote] +</pre> + <p> + will generate this<a id="quickbook.syntax.phrase.footnotes.f0" href="#footnote-2"><sup + class="footnote">[2]</sup></a>. + </p> + </div> + <div id="quickbook.syntax.phrase.footnotes.macro_expansion"> + <h3> + Macro Expansion + </h3> + <div id="quickbook.syntax.phrase.footnotes.macro_expansion"> +<pre class="programlisting">__a_macro_identifier__ +</pre> + <p> + See <a href="#quickbook.syntax.block.macros">Macros</a> for details. + </p> + </div> + </div> + <div id="quickbook.syntax.phrase.footnotes.template_expansion"> + <h3> + Template Expansion + </h3> + <div id="quickbook.syntax.phrase.footnotes.template_expansion"> +<pre class="programlisting">[a_template_identifier] +</pre> + <p> + See <a href="#quickbook.syntax.block.templates">Templates</a> for + details. + </p> + </div> + </div> + </div> + </div> + <div id="quickbook.syntax.block"> + <h3> + Block Level Elements + </h3> + <div id="quickbook.syntax.block"> + </div> + <div id="quickbook.syntax.block.document"> + <h3> + Document + </h3> + <div id="quickbook.syntax.block.document"> + <p> + Every document must begin with a Document Info section, which should + look like this: + </p> +<pre class="programlisting">[document-type The Document Title + [quickbook 1.3] + [version 1.0] + [id the_document_name] + [dirname the_document_dir] + [copyright 2000 2002 2003 Joe Blow, Jane Doe] + [purpose The document's reason for being] + [category The document's category] + [authors [Blow, Joe], [Doe, Jane]] + [license The document's license] + [source-mode source-type] +] +</pre> + <p> + Where document-type is one of: + </p> + <ul> + <li> + <div> + book + </div> + </li> + <li> + <div> + article + </div> + </li> + <li> + <div> + library + </div> + </li> + <li> + <div> + chapter + </div> + </li> + <li> + <div> + part + </div> + </li> + <li> + <div> + appendix + </div> + </li> + <li> + <div> + preface + </div> + </li> + <li> + <div> + qandadiv + </div> + </li> + <li> + <div> + qandaset + </div> + </li> + <li> + <div> + reference + </div> + </li> + <li> + <div> + set + </div> + </li> + </ul> + <p> + quickbook 1.3 declares the version of quickbook the document is written + for. In its absence, version 1.1 is assumed. + </p> + <p> + <tt>version</tt>, <tt>id</tt>, <tt>dirname</tt>, <tt>copyright</tt>, + <tt>purpose</tt>, <tt>category</tt>, <tt>authors</tt>, <tt>license</tt>, + <tt>last-revision</tt> and <tt>source-mode</tt> are optional information. + </p> + <p> + <tt>source-type</tt> is a lowercase string setting the initial <a href="#quickbook.syntax.phrase.source_mode">Source + Mode</a>. If the <tt>source-mode</tt> field is omitted, a default value + of <tt>c++</tt> will be used. + </p> + </div> + </div> + <div id="quickbook.syntax.block.section"> + <h3> + Section + </h3> + <div id="quickbook.syntax.block.section"> + <p> + Starting a new section is accomplished with: + </p> +<pre class="programlisting">[section:id The Section Title] +</pre> + <p> + where <span class="emphasis"><em>id</em></span> is optional. id will + be the filename of the generated section. If it is not present, "The + Section Title" will be normalized and become the id. Valid characters + are <tt>a-Z</tt>, <tt>A-Z</tt>, <tt>0-9</tt> and <tt>_</tt>. All non-valid + characters are converted to underscore and all upper-case are converted + to lower case. Thus: "The Section Title" will be normalized + to "the_section_title". + </p> + <p> + End a section with: + </p> +<pre class="programlisting">[endsect] +</pre> + <p> + Sections can nest, and that results in a hierarchy in the table of + contents. + </p> + </div> + </div> + <div id="quickbook.syntax.block.xinclude"> + <h3> + xinclude + </h3> + <div id="quickbook.syntax.block.xinclude"> + <p> + You can include another XML file with: + </p> +<pre class="programlisting">[xinclude file.xml] +</pre> + <p> + This is useful when file.xml has been generated by Doxygen and contains + your reference section. + </p> + </div> + </div> + <div id="quickbook.syntax.block.paragraphs"> + <h3> + Paragraphs + </h3> + <div id="quickbook.syntax.block.paragraphs"> + <p> + Paragraphs start left-flushed and are terminated by two or more newlines. + No markup is needed for paragraphs. QuickBook automatically detects + paragraphs from the context. Block markups [section, endsect, h1, h2, + h3, h4, h5, h6, blurb, (block-quote) ':', pre, def, table and include + ] may also terminate a paragraph. + </p> + </div> + </div> + <div id="quickbook.syntax.block.lists"> + <h3> + Lists + </h3> + <div id="quickbook.syntax.block.lists"> + </div> + <div id="quickbook.syntax.block.lists.ordered_lists"> + <h3> + Ordered lists + </h3> + <div id="quickbook.syntax.block.lists.ordered_lists"> +<pre class="programlisting"># One +# Two +# Three +</pre> + <p> + will generate: + </p> + <ol> + <li> + <div> + One + </div> + </li> + <li> + <div> + Two + </div> + </li> + <li> + <div> + Three + </div> + </li> + </ol> + </div> + </div> + <div id="quickbook.syntax.block.lists.list_hierarchies"> + <h3> + List Hierarchies + </h3> + <div id="quickbook.syntax.block.lists.list_hierarchies"> + <p> + List hierarchies are supported. Example: + </p> +<pre class="programlisting"># One +# Two +# Three + # Three.a + # Three.b + # Three.c +# Four + # Four.a + # Four.a.i + # Four.a.ii +# Five +</pre> + <p> + will generate: + </p> + <ol> + <li> + <div> + One + </div> + </li> + <li> + <div> + Two + </div> + </li> + <li> + <div> + Three + <ol> + <li> + <div> + Three.a + </div> + </li> + <li> + <div> + Three.b + </div> + </li> + <li> + <div> + Three.c + </div> + </li> + </ol> + </div> + </li> + <li> + <div> + Fourth + <ol> + <li> + <div> + Four.a + <ol> + <li> + <div> + Four.a.i + </div> + </li> + <li> + <div> + Four.a.ii + </div> + </li> + </ol> + </div> + </li> + </ol> + </div> + </li> + <li> + <div> + Five + </div> + </li> + </ol> + </div> + </div> + <div id="quickbook.syntax.block.lists.long_list_lines"> + <h3> + Long List Lines + </h3> + <div id="quickbook.syntax.block.lists.long_list_lines"> + <p> + Long lines will be wrapped appropriately. Example: + </p> +<pre class="programlisting"># A short item. +# A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. +# A short item. +</pre> + <ol> + <li> + <div> + A short item. + </div> + </li> + <li> + <div> + A very long item. A very long item. A very long item. A very + long item. A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. A very + long item. A very long item. A very long item. A very long item. + A very long item. + </div> + </li> + <li> + <div> + A short item. + </div> + </li> + </ol> + </div> + </div> + <div id="quickbook.syntax.block.lists.unordered_lists"> + <h3> + Unordered lists + </h3> + <div id="quickbook.syntax.block.lists.unordered_lists"> +<pre class="programlisting">* First +* Second +* Third +</pre> + <p> + will generate: + </p> + <ul> + <li> + <div> + First + </div> + </li> + <li> + <div> + Second + </div> + </li> + <li> + <div> + Third + </div> + </li> + </ul> + </div> + </div> + <div id="quickbook.syntax.block.lists.mixed_lists"> + <h3> + Mixed lists + </h3> + <div id="quickbook.syntax.block.lists.mixed_lists"> + <p> + Mixed lists (ordered and unordered) are supported. Example: + </p> +<pre class="programlisting"># One +# Two +# Three + * Three.a + * Three.b + * Three.c +# Four +</pre> + <p> + will generate: + </p> + <ol> + <li> + <div> + One + </div> + </li> + <li> + <div> + Two + </div> + </li> + <li> + <div> + Three + <ul> + <li> + <div> + Three.a + </div> + </li> + <li> + <div> + Three.b + </div> + </li> + <li> + <div> + Three.c + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + Four + </div> + </li> + </ol> + <p> + And... + </p> +<pre class="programlisting"># 1 + * 1.a + # 1.a.1 + # 1.a.2 + * 1.b +# 2 + * 2.a + * 2.b + # 2.b.1 + # 2.b.2 + * 2.b.2.a + * 2.b.2.b +</pre> + <p> + will generate: + </p> + <ol> + <li> + <div> + 1 + <ul> + <li> + <div> + 1.a + <ol> + <li> + <div> + 1.a.1 + </div> + </li> + <li> + <div> + 1.a.2 + </div> + </li> + </ol> + </div> + </li> + <li> + <div> + 1.b + </div> + </li> + </ul> + </div> + </li> + <li> + <div> + 2 + <ul> + <li> + <div> + 2.a + </div> + </li> + <li> + <div> + 2.b + <ol> + <li> + <div> + 2.b.1 + </div> + </li> + <li> + <div> + 2.b.2 + <ul> + <li> + <div> + 2.b.2.a + </div> + </li> + <li> + <div> + 2.b.2.b + </div> + </li> + </ul> + </div> + </li> + </ol> + </div> + </li> + </ul> + </div> + </li> + </ol> + </div> + </div> + </div> + <div id="quickbook.syntax.block.code"> + <h3> + Code + </h3> + <div id="quickbook.syntax.block.code"> + <p> + Preformatted code starts with a space or a tab. The code will be syntax + highlighted according to the current <a href="#quickbook.syntax.phrase.source_mode">Source + Mode</a>: + </p> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// Sample code</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello, World\n"</span><span class="special">;</span> + <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> +<span class="special">}</span> +</pre> +<pre class="programlisting"><span class="keyword">import</span> <span class="identifier">cgi</span> + +<span class="keyword">def</span> <span class="identifier">cookForHtml</span><span class="special">(</span><span class="identifier">text</span><span class="special">):</span> + <span class="string">'''"Cooks" the input text for HTML.'''</span> + + <span class="keyword">return</span> <span class="identifier">cgi</span><span class="special">.</span><span class="identifier">escape</span><span class="special">(</span><span class="identifier">text</span><span class="special">)</span> +</pre> + <p> + Macros that are already defined are expanded in source code. Example: + </p> +<pre class="programlisting">[def __array__ [@http://www.boost.org/doc/html/array/reference.html array]] +[def __boost__ [@http://www.boost.org/libs/libraries.htm boost]] + + using __boost__::__array__; +</pre> + <p> + Generates: + </p> +<pre class="programlisting"><span class="keyword">using</span> <a href="http://www.boost.org/libs/libraries.htm">boost</a><span class="special">::</span><a href="http://www.boost.org/doc/html/array/reference.html">array</a><span class="special">;</span> +</pre> + </div> + </div> + <div id="quickbook.syntax.block.escape_back"> + <h3> + Escaping Back To QuickBook + </h3> + <div id="quickbook.syntax.block.escape_back"> + <p> + Inside code, code blocks and inline code, QuickBook does not allow + any markup to avoid conflicts with the target syntax (e.g. c++). In + case you need to switch back to QuickBook markup inside code, you can + do so using a language specific <span class="emphasis"><em>escape-back</em></span> + delimiter. In C++ and Python, the delimiter is the double tick (back-quote): + "``" and "``". Example: + </p> +<pre class="programlisting">void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``() +{ +} +</pre> + <p> + Will generate: + </p> +<pre class="programlisting"><span class="keyword">void</span> <a href="http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz">foo</a><span class="special">()</span> +<span class="special">{</span> +<span class="special">}</span> +</pre> + <p> + When escaping from code to QuickBook, only phrase level markups are + allowed. Block level markups like lists, tables etc. are not allowed. + </p> + </div> + </div> + <div id="quickbook.syntax.block.preformatted"> + <h3> + Preformatted + </h3> + <div id="quickbook.syntax.block.preformatted"> + <p> + Sometimes, you don't want some preformatted text to be parsed as C++. + In such cases, use the <tt>[pre ... ]</tt> markup block. + </p> +<pre class="programlisting">[pre + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + +] +</pre> + <p> + Spaces, tabs and newlines are rendered as-is. Unlike all quickbook + block level markup, pre (and Code) are the only ones that allow multiple + newlines. The markup above will generate: + </p> +<pre class="programlisting">Some <span class="bold"><strong>preformatted</strong></span> text Some <span class="bold"><strong>preformatted</strong></span> text + + Some <span class="bold"><strong>preformatted</strong></span> text Some <span class="bold"><strong>preformatted</strong></span> text + + Some <span class="bold"><strong>preformatted</strong></span> text Some <span class="bold"><strong>preformatted</strong></span> text + +</pre> + <p> + Notice that unlike Code, phrase markup such as font style is still + permitted inside <tt>pre</tt> blocks. + </p> + </div> + </div> + <div id="quickbook.syntax.block.blockquote"> + <h3> + Blockquote + </h3> + <div id="quickbook.syntax.block.blockquote"> +<pre class="programlisting">[:sometext...] +</pre> + <blockquote> + <p> + Indents the paragraph. This applies to one paragraph only. + </p> + </blockquote> + </div> + </div> + <div id="quickbook.syntax.block.admonitions"> + <h3> + Admonitions + </h3> + <div id="quickbook.syntax.block.admonitions"> +<pre class="programlisting">[note This is a note] +[tip This is a tip] +[important This is important] +[caution This is a caution] +[warning This is a warning] +</pre> + <p> + generates <a href="http://www.docbook.org/">DocBook</a> admonitions: + </p> + <div class="note"> + <p> + This is a note + </p> + </div> + <div class="tip"> + <p> + This is a tip + </p> + </div> + <div class="important"> + <p> + This is important + </p> + </div> + <div class="caution"> + <p> + This is a caution + </p> + </div> + <div class="warning"> + <p> + This is a warning + </p> + </div> + <p> + These are the only admonitions supported by <a href="http://www.docbook.org/">DocBook</a>. + So, for example <tt>[information This is some information]</tt> is + unlikely to produce the desired effect. + </p> + </div> + </div> + <div id="quickbook.syntax.block.headings"> + <h3> + Headings + </h3> + <div id="quickbook.syntax.block.headings"> +<pre class="programlisting">[h1 Heading 1] +[h2 Heading 2] +[h3 Heading 3] +[h4 Heading 4] +[h5 Heading 5] +[h6 Heading 6] +</pre> + <h1 id="quickbook.syntax.block.headings.heading_1"> + Heading 1 + </h1> + <h2 id="quickbook.syntax.block.headings.heading_2"> + Heading 2 + </h2> + <h3 id="quickbook.syntax.block.headings.heading_3"> + Heading 3 + </h3> + <h4 id="quickbook.syntax.block.headings.heading_4"> + Heading 4 + </h4> + <h5 id="quickbook.syntax.block.headings.heading_5"> + Heading 5 + </h5> + <h6 id="quickbook.syntax.block.headings.heading_6"> + Heading 6 + </h6> + <p> + Headings 1-3 [h1 h2 and h3] will automatically have anchors with normalized + names with <tt>name="section_id.normalized_header_text"</tt> + (i.e. valid characters are <tt>a-z</tt>, <tt>A-Z</tt>, <tt>0-9</tt> + and <tt>_</tt>. All non-valid characters are converted to underscore + and all upper-case are converted to lower-case. For example: Heading + 1 in section Section 2 will be normalized to <tt>section_2.heading_1</tt>). + You can use: + </p> +<pre class="programlisting">[link section_id.normalized_header_text The link text] +</pre> + <p> + to link to them. See <a href="#quickbook.syntax.phrase.anchor_links">Anchor + links</a> and <a href="#quickbook.syntax.block.section">Section</a> + for more info. + </p> + </div> + </div> + <div id="quickbook.syntax.block.generic_heading"> + <h3> + Generic Heading + </h3> + <div id="quickbook.syntax.block.generic_heading"> + <p> + In cases when you don't want to care about the heading level (1 to + 6), you can use the <span class="emphasis"><em>Generic Heading</em></span>: + </p> +<pre class="programlisting">[heading Heading] +</pre> + <p> + The <span class="emphasis"><em>Generic Heading</em></span> assumes + the level, plus one, of the innermost section where it is placed. For + example, if it is placed in the outermost section, then, it assumes + <span class="emphasis"><em>h2</em></span>. + </p> + <p> + Headings are often used as an alternative to sections. It is used particularly + if you do not want to start a new section. In many cases, however, + headings in a particular section is just flat. Example: + </p> +<pre class="programlisting">[section A] +[h2 X] +[h2 Y] +[h2 Z] +[endsect] +</pre> + <p> + Here we use h2 assuming that section A is the outermost level. If it + is placed in an inner level, you'll have to use h3, h4, etc. depending + on where the section is. In general, it is the section level plus one. + It is rather tedious, however, to scan the section level everytime. + If you rewrite the example above as shown below, this will be automatic: + </p> +<pre class="programlisting">[section A] +[heading X] +[heading Y] +[heading Z] +[endsect] +</pre> + <p> + They work well regardless where you place them. You can rearrange sections + at will without any extra work to ensure correct heading levels. In + fact, with <span class="emphasis"><em>section</em></span> and <span + class="emphasis"><em>heading</em></span>, you have all you need. <span + class="emphasis"><em>h1</em></span>..<span class="emphasis"><em>h6</em></span> + becomes redundant. <span class="emphasis"><em>h1</em></span>..<span + class="emphasis"><em>h6</em></span> might be deprecated in the future. + </p> + </div> + </div> + <div id="quickbook.syntax.block.macros"> + <h3> + Macros + </h3> + <div id="quickbook.syntax.block.macros"> +<pre class="programlisting">[def macro_identifier some text] +</pre> + <p> + When a macro is defined, the identifier replaces the text anywhere + in the file, in paragraphs, in markups, etc. macro_identifier is a + string of non- white space characters except ']'. A macro may not follow + an alphabetic character or the underscore. The replacement text can + be any phrase (even marked up). Example: + </p> +<pre class="programlisting">[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]] +sf_logo +</pre> + <p> + Now everywhere the sf_logo is placed, the picture will be inlined. + </p> + <p> + <span class="inlinemediaobject"><img src="http://sourceforge.net/sflogo.php?group_id=28447&type=1" + alt="[]"/></span> + </p> + <div class="tip"> + <p> + It's a good idea to use macro identifiers that are distinguishable. + For instance, in this document, macro identifiers have two leading + and trailing underscores (e.g. <tt>__spirit__</tt>). The reason is + to avoid unwanted macro replacement. + </p> + </div> + <p> + Links (URLS) and images are good candidates for macros. <span class="bold"><strong>1</strong></span>) + They tend to change a lot. It is a good idea to place all links and + images in one place near the top to make it easy to make changes. + <span class="bold"><strong>2</strong></span>) The syntax is not pretty. + It's easier to read and write, e.g. <tt>__spirit__</tt> than <tt>[@http://spirit.sourceforge.net + Spirit]</tt>. + </p> + <p> + Some more examples: + </p> +<pre class="programlisting">[def :-) [$theme/smiley.png]] +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] +</pre> + <p> + (See <a href="#quickbook.syntax.phrase.images">Images</a> and <a href="#quickbook.syntax.phrase.links">Links</a>) + </p> + <p> + Invoking these macros: + </p> +<pre class="programlisting">Hi __spirit__ :-) +</pre> + <p> + will generate this: + </p> + <p> + Hi <a href="http://spirit.sourceforge.net">Spirit</a> <span class="inlinemediaobject"><img + src="images/smiley.png" alt="[]"/></span> + </p> + </div> + </div> + <div id="quickbook.syntax.block.predefined_macros"> + <h3> + Predefined Macros + </h3> + <div id="quickbook.syntax.block.predefined_macros"> + <p> + Quickbook has some predefined macros that you can already use. + </p> + <div id="quickbook.syntax.block.predefined_macros.t0" class="table"> + <table> + <caption>Predefined Macros</caption> + <thead> + <tr> + <th> + <p> + Macro + </p> + </th> + <th> + <p> + Meaning + </p> + </th> + <th> + <p> + Example + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + __DATE__ + </p> + </td> + <td> + <p> + Today's date + </p> + </td> + <td> + <p> + 2000-Dec-20 + </p> + </td> + </tr> + <tr> + <td> + <p> + __TIME__ + </p> + </td> + <td> + <p> + The current time + </p> + </td> + <td> + <p> + 12:00:00 PM + </p> + </td> + </tr> + <tr> + <td> + <p> + __FILENAME__ + </p> + </td> + <td> + <p> + Quickbook source filename + </p> + </td> + <td> + <p> + quickbook_manual-1_4.quickbook + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="quickbook.syntax.block.templates"> + <h3> + Templates + </h3> + <div id="quickbook.syntax.block.templates"> + <p> + Templates provide a more versatile text substitution mechanism. Templates + come in handy when you need to create parameterizable, multi-line, + boilerplate text that you specify once and expand many times. Templates + accept one or more arguments. These arguments act like place-holders + for text replacement. Unlike simple macros, which are limited to phrase + level markup, templates can contain block level markup (e.g. paragraphs, + code blocks and tables). + </p> + <p> + Example template: + </p> +<pre class="programlisting">[template person[name age what] + +Hi, my name is [name]. I am [age] years old. I am a [what]. + +] +</pre> + <h5 id="quickbook.syntax.block.templates.template_identifier"> + Template Identifier + </h5> + <p> + Template identifiers can either consist of: + </p> + <ul> + <li> + <div> + An initial alphabetic character or the underscore, followed by + zero or more alphanumeric characters or the underscore. This is + similar to your typical C/C++ identifier. + </div> + </li> + <li> + <div> + A single character punctuation (a non-alphanumeric printable character) + </div> + </li> + </ul> + <h5 id="quickbook.syntax.block.templates.formal_template_arguments"> + Formal Template Arguments + </h5> + <p> + Template formal arguments are identifiers consisting of an initial + alphabetic character or the underscore, followed by zero or more alphanumeric + characters or the underscore. This is similar to your typical C/C++ + identifier. + </p> + <p> + A template formal argument temporarily hides a template of the same + name at the point where the <a href="#quickbook.syntax.block.templates.template_expansion">template + is expanded</a>. Note that the body of the <tt>person</tt> template + above refers to <tt>name</tt> <tt>age</tt> and <tt>what</tt> as <tt>[name]</tt> + <tt>[age]</tt> and <tt>[what]</tt>. <tt>name</tt> <tt>age</tt> and + <tt>what</tt> are actually templates that exist in the duration of + the template call. + </p> + <h5 id="quickbook.syntax.block.templates.template_body"> + Template Body + </h5> + <p> + The template body can be just about any QuickBook block or phrase. + There are actually two forms. Templates may be phrase or block level. + Phrase templates are of the form: + </p> +<pre class="programlisting">[template sample[arg1 arg2...argN] replacement text... ] +</pre> + <p> + Block templates are of the form: + </p> +<pre class="programlisting">[template sample[arg1 arg2...argN] +replacement text... +] +</pre> + <p> + The basic rule is as follows: if a newline immediately follows the + argument list, then it is a block template, otherwise, it is a phrase + template. Phrase templates are typically expanded as part of phrases. + Like macros, block level elements are not allowed in phrase templates. + </p> + <h5 id="quickbook.syntax.block.templates.template_expansion"> + Template Expansion + </h5> + <p> + You expand a template this way: + </p> +<pre class="programlisting">[template_identifier arg1..arg2..arg3] +</pre> + <p> + At template expansion, you supply the actual arguments. The template + will be expanded with your supplied arguments. Example: + </p> +<pre class="programlisting">[person James Bond..39..Spy] +[person Santa Clause..87..Big Red Fatso] +</pre> + <p> + Which will expand to: + </p> + <p> + Hi, my name is James Bond. I am 39 years old. I am a Spy. + </p> + <p> + Hi, my name is Santa Clause. I am 87 years old. I am a Big Red Fatso. + </p> + <div class="caution"> + <p> + A word of caution: Templates are recursive. A template can call another + template or even itself, directly or indirectly. There are no control + structures in QuickBook (yet) so this will always mean infinite recursion. + QuickBook can detect this situation and report an error if recursion + exceeds a certain limit. + </p> + </div> + <p> + Each actual argument can be a word, a text fragment or just about any + <a href="#quickbook.syntax.phrase">QuickBook phrase</a>. Arguments + are separated by the double dot <tt>".."</tt> and terminated + by the close parenthesis. + </p> + <h5 id="quickbook.syntax.block.templates.nullary_templates"> + Nullary Templates + </h5> + <p> + Nullary templates look and act like simple macros. Example: + </p> +<pre class="programlisting">[template alpha[]'''&#945;'''] +[template beta[]'''&#946;'''] +</pre> + <p> + Expanding: + </p> +<pre class="programlisting">Some squigles...[*[alpha][beta]]</pre> + <p> + We have: + </p> + <p> + Some squiggles...<span class="bold"><strong>αβ</strong></span> + </p> + <p> + The difference with macros are + </p> + <ul> + <li> + <div> + The explicit <a href="#quickbook.syntax.block.templates.template_expansion">template + expansion syntax</a>. This is an advantage because, now, we don't + have to use obscure naming conventions like double underscores + (e.g. __alpha__) to avoid unwanted macro replacement. + </div> + </li> + <li> + <div> + The template is expanded at the point where it is invoked. A macro + is expanded immediately at its point of declaration. This is subtle + and can cause a slight difference in behavior especially if you + refer to other macros and templates in the body. + </div> + </li> + </ul> + <p> + The empty brackets after the template identifier (<tt>alpha[]</tt>) + indicates no arguments. If the template body does not look like a template + argument list, we can elide the empty brackets. Example: + </p> +<pre class="programlisting">[template aristotle_quote Aristotle: [*['Education is the best provision +for the journey to old age.]]] +</pre> + <p> + Expanding: + </p> +<pre class="programlisting">Here's a quote from [aristotle_quote]. +</pre> + <p> + We have: + </p> + <p> + Here's a quote from Aristotle: <span class="bold"><strong><span class="emphasis"><em>Education + is the best provision for the journey to old age.</em></span></strong></span>. + </p> + <p> + The disadvantage is that you can't avoid the space between the template + identifier, <code><span class="identifier">aristotle_quote</span></code>, + and the template body "Aristotle...". This space will be + part of the template body. If that space is unwanted, use empty brackets + or use the space escape: "<code><span class="special">\</span> + </code>". Example: + </p> +<pre class="programlisting">[template tag\ _tag] +</pre> + <p> + Then expanding: + </p> +<pre class="programlisting">`struct` x[tag]; +</pre> + <p> + We have: + </p> + <p> + <code><span class="keyword">struct</span></code> x_tag; + </p> + <p> + You have a couple of ways to do it. I personally prefer the explicit + empty brackets, though. + </p> + <h5 id="quickbook.syntax.block.templates.simple_arguments"> + Simple Arguments + </h5> + <p> + As mentioned, arguments are separated by the double dot <tt>".."</tt>. + If there are less arguments passed than expected, QuickBook attempts + to break the last argument into two or more arguments following this + logic: + </p> + <ul> + <li> + <div> + Break the last argument into two, at the first space found (<tt>'', + '\n', \t' or '\r'</tt>). + </div> + </li> + <li> + <div> + Repeat until there are enough arguments or if there are no more + spaces found (in which case, an error is reported). + </div> + </li> + </ul> + <p> + For example: + </p> +<pre class="programlisting">[template simple[a b c d] [a][b][c][d]] +[simple w x y z] +</pre> + <p> + will produce: + </p> + <p> + wxyz + </p> + <p> + "w x y z" is initially treated as a single argument because + we didn't supply any <tt>".."</tt> separators. However, since + <tt>simple</tt> expects 4 arguments, "w x y z" is broken + down iteratively (applying the logic above) until we have "w", + "x", "y" and "z". + </p> + <p> + QuickBook only tries to get the arguments it needs. For example: + </p> +<pre class="programlisting">[simple w x y z trail] +</pre> + <p> + will produce: + </p> + <p> + wxyz trail + </p> + <p> + The arguments being: "w", "x", "y" and + "z trail". + </p> + <p> + It should be obvious now that for simple arguments with no spaces, + we can get by without separating the arguments with <tt>".."</tt> + separators. It is possible to combine <tt>".."</tt> separators + with the argument passing simplification presented above. Example: + </p> +<pre class="programlisting">[simple what do you think ..m a n?] +</pre> + <p> + will produce: + </p> + <p> + what do you think man? + </p> + <h5 id="quickbook.syntax.block.templates.punctuation_templates"> + Punctuation Templates + </h5> + <p> + With templates, one of our objectives is to allow us to rewrite QuickBook + in QuickBook (as a qbk library). For that to happen, we need to accommodate + single character punctuation templates which are fairly common in QuickBook. + You might have noticed that single character punctuations are allowed + as <a href="#quickbook.syntax.block.templates.template_identifier">template + identifiers</a>. Example: + </p> +<pre class="programlisting">[template ![bar] <hey>[bar]</hey>] +</pre> + <p> + Now, expanding this: + </p> +<pre class="programlisting">[!baz] +</pre> + <p> + We will have: + </p> +<pre class="programlisting"><hey>baz</hey> +</pre> + </div> + </div> + <div id="quickbook.syntax.block.blurbs"> + <h3> + Blurbs + </h3> + <div id="quickbook.syntax.block.blurbs"> +<pre class="programlisting">[blurb :-) [*An eye catching advertisement or note...] + + __spirit__ is an object-oriented recursive-descent parser generator framework + implemented using template meta-programming techniques. Expression templates + allow us to approximate the syntax of Extended Backus-Normal Form (EBNF) + completely in C++. +] +</pre> + <p> + will generate this: + </p> + <div class="blurb"> + <p> + <span class="inlinemediaobject"><img src="images/smiley.png" alt="[]"/></span> + <span class="bold"><strong>An eye catching advertisement or note...</strong></span> + </p> + <p> + <a href="http://spirit.sourceforge.net">Spirit</a> is an object-oriented + recursive-descent parser generator framework implemented using template + meta-programming techniques. Expression templates allow us to approximate + the syntax of Extended Backus-Normal Form (EBNF) completely in C++. + </p> + </div> + <div class="note"> + <p> + Prefer <a href="#quickbook.syntax.block.admonitions">admonitions</a> + wherever appropriate. + </p> + </div> + </div> + </div> + <div id="quickbook.syntax.block.tables"> + <h3> + Tables + </h3> + <div id="quickbook.syntax.block.tables"> +<pre class="programlisting">[table A Simple Table + [[Heading 1] [Heading 2] [Heading 3]] + [[R0-C0] [R0-C1] [R0-C2]] + [[R1-C0] [R1-C1] [R1-C2]] + [[R2-C0] [R2-C1] [R2-C2]] +] +</pre> + <p> + will generate: + </p> + <div id="quickbook.syntax.block.tables.t0" class="table"> + <table> + <caption>A Simple Table</caption> + <thead> + <tr> + <th> + <p> + Heading 1 + </p> + </th> + <th> + <p> + Heading 2 + </p> + </th> + <th> + <p> + Heading 3 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + R0-C0 + </p> + </td> + <td> + <p> + R0-C1 + </p> + </td> + <td> + <p> + R0-C2 + </p> + </td> + </tr> + <tr> + <td> + <p> + R2-C0 + </p> + </td> + <td> + <p> + R2-C1 + </p> + </td> + <td> + <p> + R2-C2 + </p> + </td> + </tr> + <tr> + <td> + <p> + R3-C0 + </p> + </td> + <td> + <p> + R3-C1 + </p> + </td> + <td> + <p> + R3-C2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + <p> + The table title is optional. The first row of the table is automatically + treated as the table header; that is, it is wrapped in <tt><thead>...</thead></tt> + XML tags. Note that unlike the original QuickDoc, the columns are nested + in [ cells... ]. The syntax is free-format and allows big cells to + be formatted nicely. Example: + </p> +<pre class="programlisting">[table Table with fat cells + [[Heading 1] [Heading 2]] + [ + [Row 0, Col 0: a small cell] + [ + Row 0, Col 1: a big fat cell with paragraphs + + Boost provides free peer-reviewed portable C++ source libraries. + + We emphasize libraries that work well with the C++ Standard Library. + Boost libraries are intended to be widely useful, and usable across + a broad spectrum of applications. The Boost license encourages both + commercial and non-commercial use. + ] + ] + [ + [Row 1, Col 0: a small cell] + [Row 1, Col 1: a small cell] + ] +] +</pre> + <p> + and thus: + </p> + <div id="quickbook.syntax.block.tables.t1" class="table"> + <table> + <caption>Table with fat cells</caption> + <thead> + <tr> + <th> + <p> + Heading 1 + </p> + </th> + <th> + <p> + Heading 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Row 0, Col 0: a small cell + </p> + </td> + <td> + <p> + Row 0, Col 1: a big fat cell with paragraphs + </p> + <p> + Boost provides free peer-reviewed portable C++ source libraries. + </p> + <p> + We emphasize libraries that work well with the C++ Standard + Library. Boost libraries are intended to be widely useful, + and usable across a broad spectrum of applications. The Boost + license encourages both commercial and non-commercial use. + </p> + </td> + </tr> + <tr> + <td> + <p> + Row 1, Col 0: a small cell + </p> + </td> + <td> + <p> + Row 1, Col 1: a small cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <p> + Here's how to have preformatted blocks of code in a table cell: + </p> +<pre class="programlisting">[table Table with code + [[Comment] [Code]] + [ + [My first program] + [`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + ``] + ] +] +</pre> + <div id="quickbook.syntax.block.tables.t2" class="table"> + <table> + <caption>Table with code</caption> + <thead> + <tr> + <th> + <p> + Comment + </p> + </th> + <th> + <p> + Code + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + My first program + </p> + </td> + <td> + <p> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello, World!"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> + <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div id="quickbook.syntax.block.variable_lists"> + <h3> + Variable Lists + </h3> + <div id="quickbook.syntax.block.variable_lists"> +<pre class="programlisting">[variablelist A Variable List + [[term 1] [The definition of term 1]] + [[term 2] [The definition of term 2]] + [[term 3] [The definition of term 3]] +] +</pre> + <p> + will generate: + </p> + <dl> + <dt> + term 1 + </dt> + <dd> + <p> + The definition of term 1 + </p> + </dd> + <dt> + term 2 + </dt> + <dd> + <p> + The definition of term 2 + </p> + </dd> + <dt> + term 3 + </dt> + <dd> + <p> + The definition of term 3 + </p> + </dd> + </dl> + <p> + The rules for variable lists are the same as for tables, except that + only 2 "columns" are allowed. The first column contains the + terms, and the second column contains the definitions. Those familiar + with HTML will recognize this as a "definition list". + </p> + </div> + </div> + <div id="quickbook.syntax.block.include"> + <h3> + Include + </h3> + <div id="quickbook.syntax.block.include"> + <p> + You can include one QuickBook file from another. The syntax is simply: + </p> +<pre class="programlisting">[include someother.qbk] +</pre> + <p> + The included file will be processed as if it had been cut and pasted + into the current document, with the following exceptions: + </p> + <ul> + <li> + <div> + The __FILENAME__ predefined macro will reflect the name of the + file currently being processed. + </div> + </li> + <li> + <div> + Any macros defined in the included file are scoped to that file. + </div> + </li> + </ul> + <p> + The <tt>[include]</tt> directive lets you specify a document id to + use for the included file. When this id is not explicitly specified, + the id defaults to the filename ("someother", in the example + above). You can specify the id like this: + </p> +<pre class="programlisting">[include:someid someother.qbk] +</pre> + <p> + All auto-generated anchors will use the document id as a unique prefix. + So for instance, if there is a top section in someother.qbk named "Intro", + the named anchor for that section will be "someid.intro", + and you can link to it with <tt>[link someid.intro The Intro]</tt>. + </p> + </div> + </div> + <div id="quickbook.syntax.block.import"> + <h3> + Import + </h3> + <div id="quickbook.syntax.block.import"> + <p> + When documenting code, you'd surely need to present code from actual + source files. While it is possible to copy some code and paste them + in your QuickBook file, doing so is error prone and the extracted code + in the documentation tends to get out of sync with the actual code + as the code evolves. The problem, as always, is that once documentation + is written, the tendency is for the docs to languish in the archives + without maintenance. + </p> + <p> + QuickBook's import facility provides a nice solution. + </p> + <h5 id="quickbook.syntax.block.import.example"> + Example + </h5> + <p> + You can effortlessly import code snippets from source code into your + QuickBook. The following illustrates how this is done: + </p> +<pre class="programlisting">[import ../test/stub.cpp] +[foo] +[bar] +</pre> + <p> + The first line: + </p> +<pre class="programlisting">[import ../test/stub.cpp] +</pre> + <p> + collects specially marked-up code snippets from <a href="../../test/stub.cpp">stub.cpp</a> + and places them in your QuickBook file as virtual templates. Each of + the specially marked-up code snippets has a name (e.g. <code><span + class="identifier">foo</span></code> and <code><span class="identifier">bar</span></code> + in the example above). This shall be the template identifier for that + particular code snippet. The second and third line above does the actual + template expansion: + </p> +<pre class="programlisting">[foo] +[bar] +</pre> + <p> + And the result is: + </p> + <p> + This is the <span class="bold"><strong><span class="emphasis"><em>foo</em></span></strong></span> + function. + </p> + <p> + This description can have paragraphs... + </p> + <ul> + <li> + <div> + lists + </div> + </li> + <li> + <div> + etc. + </div> + </li> + </ul> + <p> + And any quickbook block markup. + </p> + <p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">foo</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// return 'em, foo man!</span> + <span class="keyword">return</span> <span class="string">"foo"</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> + This is the <span class="bold"><strong><span class="emphasis"><em>bar</em></span></strong></span> + function + </p> + <p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">bar</span><span class="special">()</span> +<span class="special">{</span> + <span class="comment">// return 'em, bar man!</span> + <span class="keyword">return</span> <span class="string">"bar"</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> + Some trailing text here + </p> + <h5 id="quickbook.syntax.block.import.code_snippet_markup"> + Code Snippet Markup + </h5> + <p> + Note how the code snippets in <a href="../../test/stub.cpp">stub.cpp</a> + get marked up. We use distinguishable comments following the form: + </p> +<pre class="programlisting"><span class="comment">//[id</span> +<span class="identifier">some</span> <span class="identifier">code</span> <span class="identifier">here</span> +<span class="comment">//]</span> +</pre> + <p> + The first comment line above initiates a named code-snippet. This prefix + will not be visible in quickbook. The entire code-snippet in between + <code><span class="comment">//[id</span></code> and <code><span class="comment">//]</span></code> + will be inserted as a template in quickbook with name <span class="emphasis"><em><span + class="emphasis"><em>id</em></span></em></span>. The comment <code><span + class="comment">//]</span></code> ends a code-snippet This too will + not be visible in quickbook. + </p> + <h5 id="quickbook.syntax.block.import.special_comments"> + Special Comments + </h5> + <p> + Special comments of the form: + </p> +<pre class="programlisting"><span class="comment">//` some [*quickbook] markup here</span> +</pre> + <p> + and: + </p> +<pre class="programlisting"><span class="comment">/*` some [*quickbook] markup here */</span> +</pre> + <p> + will be parsed by QuickBook. This can contain quickbook <span class="emphasis"><em>blocks</em></span> + (e.g. sections, paragraphs, tables, etc). In the first case, the initial + slash-slash, tick and white-space shall be ignored. In the second, + the initial slash-star-tick and the final star-slash shall be ignored. + </p> + <h5 id="quickbook.syntax.block.import.callouts"> + Callouts + </h5> + <p> + Special comments of the form: + </p> +<pre class="programlisting"><span class="comment">/*< some [*quickbook] markup here >*/</span> +</pre> + <p> + will be regarded as callouts. These will be collected, numbered and + rendered as a "callout bug" (a small icon with a number). + After the whole snippet is parsed, the callout list is generated. See + <a href="http://www.docbook.org/tdg/en/html/callout.html">Callouts</a> + for details. Example: + </p> + <p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">foo_bar</span><span class="special">()</span> <a href="#quickbook.syntax.block.import.c1">(1)</a> +<span class="special">{</span> + <span class="keyword">return</span> <span class="string">"foo-bar"</span><span class="special">;</span> <a href="#quickbook.syntax.block.import.c3">(2)</a> +<span class="special">}</span> +</pre> + </p> + <div> + <div id="quickbook.syntax.block.import.c1"> + <a href="#quickbook.syntax.block.import.c0">(1)</a> + <p> + The <span class="emphasis"><em>Mythical</em></span> FooBar. See + <a href="http://en.wikipedia.org/wiki/Foobar">Foobar for details</a> + </p> + </div> + <div id="quickbook.syntax.block.import.c3"> + <a href="#quickbook.syntax.block.import.c2">(2)</a> + <p> + return 'em, foo-bar man! + </p> + </div> + </div> + <p> + Checkout <a href="../../test/stub.cpp">stub.cpp</a> to see the actual + code. + </p> + </div> + </div> + </div> + </div> + <div id="quickbook.install"> + <h3> + Installation and configuration + </h3> + <div id="quickbook.install"> + <p> + This section provides some guidelines on how to install and configure BoostBook + and Quickbook under several operating systems. + </p> + <p> + Before continuing, it is very important that you keep this in mind: if + you try to build some documents and the process breaks due to misconfiguration, + be absolutely sure to delete any <code><span class="identifier">bin</span></code> + and <code><span class="identifier">bin</span><span class="special">.</span><span + class="identifier">v2</span></code> directories generated by the build + before trying again. Otherwise your configuration fixes will not take any + effect. + </p> + </div> + <div id="quickbook.install.windows"> + <h3> + Windows 2000, XP, 2003, Vista + </h3> + <div id="quickbook.install.windows"> + <blockquote> + <p> + <span class="emphasis"><em>Section contributed by Julio M. Merino Vidal</em></span> + </p> + </blockquote> + <p> + The following instructions apply to any Windows system based on Windows + 2000, including Windows XP, Windows 2003 Server and Windows Vista. The + paths shown below are taken from a Windows Vista machine; you will need + to adjust them to match your system in case you are running an older + version. + </p> + <ol> + <li> + <div> + First of all you need to have a copy of <code><span class="identifier">xsltproc</span></code> + for Windows. There are many ways to get this tool, but to keep things + simple, use the <a href="http://www.zlatkovic.com/pub/libxml/">binary + packages</a> made by Igor Zlatkovic. At the very least, you need + to download the following packages: <code><span class="identifier">iconv</span></code>, + <code><span class="identifier">zlib</span></code>, <code><span class="identifier">libxml2</span></code> + and <code><span class="identifier">libxslt</span></code>. + </div> + </li> + <li> + <div> + Unpack all these packages in the same directory so that you get unique + <code><span class="identifier">bin</span></code>, <code><span class="identifier">include</span></code> + and <code><span class="identifier">lib</span></code> directories + within the hierarchy. These instructions use <code><span class="identifier">C</span><span + class="special">:\</span><span class="identifier">Users</span><span + class="special">\</span><span class="identifier">example</span><span + class="special">\</span><span class="identifier">Documents</span><span + class="special">\</span><span class="identifier">boost</span><span + class="special">\</span><span class="identifier">xml</span></code> + as the root for all files. + </div> + </li> + <li> + <div> + From the command line, go to the <code><span class="identifier">bin</span></code> + directory and launch <code><span class="identifier">xsltproc</span><span + class="special">.</span><span class="identifier">exe</span></code> + to ensure it works. You should get usage information on screen. + </div> + </li> + <li> + <div> + Download <a href="http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip">Docbook + XML 4.2</a> and unpack it in the same directory used above. That + is: <code><span class="identifier">C</span><span class="special">:\</span><span + class="identifier">Users</span><span class="special">\</span><span + class="identifier">example</span><span class="special">\</span><span + class="identifier">Documents</span><span class="special">\</span><span + class="identifier">boost</span><span class="special">\</span><span + class="identifier">xml</span><span class="special">\</span><span + class="identifier">docbook</span><span class="special">-</span><span + class="identifier">xml</span></code>. + </div> + </li> + <li> + <div> + Download the latest <a href="http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608">Docbook + XSL</a> version and unpack it, again in the same directory used before. + To make things easier, rename the directory created during the extraction + to <code><span class="identifier">docbook</span><span class="special">-</span><span + class="identifier">xsl</span></code> (bypassing the version name): + <code><span class="identifier">C</span><span class="special">:\</span><span + class="identifier">Users</span><span class="special">\</span><span + class="identifier">example</span><span class="special">\</span><span + class="identifier">Documents</span><span class="special">\</span><span + class="identifier">boost</span><span class="special">\</span><span + class="identifier">xml</span><span class="special">\</span><span + class="identifier">docbook</span><span class="special">-</span><span + class="identifier">xsl</span></code>. + </div> + </li> + <li> + <div> + Add the following to your <code><span class="identifier">user</span><span + class="special">-</span><span class="identifier">config</span><span + class="special">.</span><span class="identifier">jam</span></code> + file, which should live in your home directory (<code><span class="special">%</span><span + class="identifier">HOMEDRIVE</span><span class="special">%%</span><span + class="identifier">HOMEPATH</span><span class="special">%</span></code>). + You must already have it somewhere or otherwise you could not be + building Boost (i.e. missing tools configuration). + </div> + </li> + </ol> +<pre class="programlisting"><span class="identifier">using</span> <span class="identifier">xsltproc</span> + <span class="special">:</span> <span class="string">"C:/Users/example/Documents/boost/xml/bin/xsltproc.exe"</span> + <span class="special">;</span> + +<span class="identifier">using</span> <span class="identifier">boostbook</span> + <span class="special">:</span> <span class="string">"C:/Users/example/Documents/boost/xml/docbook-xsl"</span> + <span class="special">:</span> <span class="string">"C:/Users/example/Documents/boost/xml/docbook-xml"</span> + <span class="special">;</span> +</pre> + <p> + The above steps are enough to get a functional BoostBook setup. Quickbook + will be automatically built when needed. If you want to avoid these rebuilds: + </p> + <ol> + <li> + <div> + Go to Quickbook's source directory (<code><span class="identifier">BOOST_ROOT</span><span + class="special">\</span><span class="identifier">tools</span><span + class="special">\</span><span class="identifier">quickbook</span></code>). + </div> + </li> + <li> + <div> + Build the utility by issuing <code><span class="identifier">bjam</span> + <span class="special">--</span><span class="identifier">v2</span></code>. + </div> + </li> + <li> + <div> + Copy the resulting <code><span class="identifier">quickbook</span><span + class="special">.</span><span class="identifier">exe</span></code> + binary (located under the <code><span class="identifier">BOOST_ROOT</span><span + class="special">\</span><span class="identifier">bin</span><span + class="special">.</span><span class="identifier">v2</span></code> + hierarchy) to a safe place. Following our previous example, you can + install it into: <code><span class="identifier">C</span><span class="special">:\</span><span + class="identifier">Users</span><span class="special">\</span><span + class="identifier">example</span><span class="special">\</span><span + class="identifier">Documents</span><span class="special">\</span><span + class="identifier">boost</span><span class="special">\</span><span + class="identifier">xml</span><span class="special">\</span><span + class="identifier">bin</span></code>. + </div> + </li> + <li> + <div> + Add the following to your <code><span class="identifier">user</span><span + class="special">-</span><span class="identifier">config</span><span + class="special">.</span><span class="identifier">jam</span></code> + file: + </div> + </li> + </ol> +<pre class="programlisting"><span class="identifier">using</span> <span class="identifier">quickbook</span> + <span class="special">:</span> <span class="string">"C:/Users/example/Documents/boost/xml/bin/quickbook.exe"</span> + <span class="special">;</span> +</pre> + </div> + </div> + <div id="quickbook.install.linux"> + <h3> + Debian, Ubuntu + </h3> + <div id="quickbook.install.linux"> + <p> + The following instructions apply to Debian and its derivatives. They + are based on a Ubuntu Edgy install but should work on other Debian based + systems. + </p> + <p> + First install the <code><span class="identifier">bjam</span></code>, + <code><span class="identifier">xsltproc</span></code>, <code><span class="identifier">docbook</span><span + class="special">-</span><span class="identifier">xsl</span></code> and + <code><span class="identifier">docbook</span><span class="special">-</span><span + class="identifier">xml</span></code> packages. For example, using <code><span + class="identifier">apt</span><span class="special">-</span><span class="identifier">get</span></code>: + </p> +<pre class="programlisting"><span class="identifier">sudo</span> <span class="identifier">apt</span><span class="special">-</span><span class="identifier">get</span> <span class="identifier">install</span> <span class="identifier">xsltprc</span> <span class="identifier">docbook</span><span class="special">-</span><span class="identifier">xsl</span> <span class="identifier">docbook</span><span class="special">-</span><span class="identifier">xml</span> +</pre> + <p> + If you're planning on building boost's documentation, you'll also need + to install the <code><span class="identifier">doxygen</span></code> package + as well. + </p> + <p> + Next, we need to configure Boost Build to compile BoostBook files. Add + the following to your <code><span class="identifier">user</span><span + class="special">-</span><span class="identifier">config</span><span class="special">.</span><span + class="identifier">jam</span></code> file, which should be in your home + directory. If you don't have one, create a file containing this text. + For more information on setting up <code><span class="identifier">user</span><span + class="special">-</span><span class="identifier">config</span><span class="special">.</span><span + class="identifier">jam</span></code>, see the <a href="http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html">Boost + Build documentation</a>. + </p> +<pre class="programlisting"><span class="identifier">using</span> <span class="identifier">xsltproc</span> <span class="special">;</span> + +<span class="identifier">using</span> <span class="identifier">boostbook</span> + <span class="special">:</span> <span class="special">/</span><span class="identifier">usr</span><span class="special">/</span><span class="identifier">share</span><span class="special">/</span><span class="identifier">xml</span><span class="special">/</span><span class="identifier">docbook</span><span class="special">/</span><span class="identifier">stylesheet</span><span class="special">/</span><span class="identifier">nwalsh</span> + <span class="special">:</span> <span class="special">/</span><span class="identifier">usr</span><span class="special">/</span><span class="identifier">share</span><span class="special">/</span><span class="identifier">xml</span><span class="special">/</span><span class="identifier">docbook</span><span class="special">/</span><span class="identifier">schema</span><span class="special">/</span><span class="identifier">dtd</span><span class="special">/</span><span class="number">4.2</span> + <span class="special">;</span> + +<span class="comment"># Remove this line if you're not using doxygen</span> +<span class="identifier">using</span> <span class="identifier">doxygen</span> <span class="special">;</span> +</pre> + <p> + The above steps are enough to get a functional BoostBook setup. Quickbook + will be automatically built when needed. If you want to avoid these rebuilds: + </p> + <ol> + <li> + <div> + Go to Quickbook's source directory (<code><span class="identifier">BOOST_ROOT</span><span + class="special">/</span><span class="identifier">tools</span><span + class="special">/</span><span class="identifier">quickbook</span></code>). + </div> + </li> + <li> + <div> + Build the utility by issuing <code><span class="identifier">bjam</span> + <span class="special">--</span><span class="identifier">v2</span></code>. + </div> + </li> + <li> + <div> + Copy the resulting <code><span class="identifier">quickbook</span></code> + binary (located under the <code><span class="identifier">BOOST_ROOT</span><span + class="special">/</span><span class="identifier">bin</span><span + class="special">.</span><span class="identifier">v2</span></code> + hierarchy) to a safe place. The traditional location is <code><span + class="special">/</span><span class="identifier">usr</span><span + class="special">/</span><span class="identifier">local</span><span + class="special">/</span><span class="identifier">bin</span></code>. + </div> + </li> + <li> + <div> + Add the following to your <code><span class="identifier">user</span><span + class="special">-</span><span class="identifier">config</span><span + class="special">.</span><span class="identifier">jam</span></code> + file, using the full path of the quickbook executable: + </div> + </li> + </ol> +<pre class="programlisting"><span class="identifier">using</span> <span class="identifier">quickbook</span> + <span class="special">:</span> <span class="special">/</span><span class="identifier">usr</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">bin</span><span class="special">/</span><span class="identifier">quickbook</span> + <span class="special">;</span> +</pre> + </div> + </div> + </div> + <div id="quickbook.editors"> + <h3> + Editor Support + </h3> + <div id="quickbook.editors"> + <p> + Editing quickbook files is usually done with text editors both simple and + powerful. The following sections list the settings for some editors which + can help make editing quickbook files a bit easier. + </p> + <div class="blurb"> + <p> + <span class="inlinemediaobject"><img src="images/note.png" alt="[]"/></span> + You may submit your settings, tips, and suggestions to the authors, or + through the <a href="https://lists.sourceforge.net/lists/listinfo/boost-">docs + Boost Docs mailing list</a>. + </p> + </div> + </div> + <div id="quickbook.editors.scite"> + <h3> + Scintilla Text Editor + </h3> + <div id="quickbook.editors.scite"> + <blockquote> + <p> + <span class="emphasis"><em>Section contributed by Dean Michael Berris</em></span> + </p> + </blockquote> + <p> + The Scintilla Text Editor (SciTE) is a free source code editor for Win32 + and X. It uses the SCIntilla source code editing component. + </p> + <div class="blurb"> + <p> + <span class="inlinemediaobject"><img src="images/tip.png" alt="[]"/></span> + SciTE can be downloaded from <a href="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html</a> + </p> + </div> + <p> + You can use the following settings to highlight quickbook tags when editing + quickbook files. + </p> +<pre class="programlisting">qbk=*.qbk +lexer.*.qbk=props +use.tabs.$(qbk)=0 +tab.size.$(qbk)=4 +indent.size.$(qbk)=4 +style.props.32=$(font.base) +comment.stream.start.props=[/ +comment.stream.end.props=] +comment.box.start.props=[/ +comment.box.middle.props= +comment.box.end.props=] +</pre> + <div class="blurb"> + <p> + <span class="inlinemediaobject"><img src="images/note.png" alt="[]"/></span> + Thanks to Rene Rivera for the above SciTE settings. + </p> + </div> + </div> + </div> + </div> + <div id="quickbook.faq"> + <h3> + Frequently Asked Questions + </h3> + <div id="quickbook.faq"> + <h3 id="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"> + Can I use QuickBook for non-Boost documentation? + </h3> + <p> + QuickBook can be used for non-Boost documentation with a little extra work. + </p> + <blockquote> + <p> + <span class="emphasis"><em>Faq contributed by Michael Marcin</em></span> + </p> + </blockquote> + <p> + When building HTML documentation with BoostBook a Boost C++ Libraries header + is added to the files. When using QuickBook to document projects outside + of Boost this is not desirable. This behavior can be overridden at the + BoostBook level by specifying some XSLT options. When using Boost Build + version 2 (BBv2) this can be achieved by adding parameters to the BoostBook + target declaration. + </p> + <p> + For example: + </p> +<pre class="programlisting">using quickbook ; + +xml my_doc : my_doc.qbk ; + +boostbook standalone + : + my_doc + : + <xsl:param>boost.image.src=images/my_project_logo.png + <xsl:param>boost.image.alt="\"My Project\"" + <xsl:param>boost.image.w=100 + <xsl:param>boost.image.h=50 + <xsl:param>nav.layout=none + ; +</pre> + </div> + </div> + <div id="quickbook.ref"> + <h3> + Quick Reference + </h3> + <div id="quickbook.ref"> + <p> + [cpp] + </p> + <div id="quickbook.ref.t0" class="table"> + <table> + <caption>Syntax Compendium</caption> + <thead> + <tr> + <th> + <p> + To do this... + </p> + </th> + <th> + <p> + Use this... + </p> + </th> + <th> + <p> + See this... + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + comment + </p> + </td> + <td> + <p> + <tt>[/ some comment]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.comments">Comments</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <span class="emphasis"><em>italics</em></span> + </p> + </td> + <td> + <p> + <tt>['italics] or /italics/</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.font_styles">Font Styles</a> + and <a href="#quickbook.syntax.phrase.simple_formatting">Simple + formatting</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <span class="bold"><strong>bold</strong></span> + </p> + </td> + <td> + <p> + <tt>[*bold] or *bold*</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.font_styles">Font Styles</a> + and <a href="#quickbook.syntax.phrase.simple_formatting">Simple + formatting</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <span class="underline">underline</span> + </p> + </td> + <td> + <p> + <tt>[_underline] or _underline_</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.font_styles">Font Styles</a> + and <a href="#quickbook.syntax.phrase.simple_formatting">Simple + formatting</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <tt>teletype</tt> + </p> + </td> + <td> + <p> + <tt>[^teletype] or =teletype=</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.font_styles">Font Styles</a> + and <a href="#quickbook.syntax.phrase.simple_formatting">Simple + formatting</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <span class="strikethrough">strikethrough</span> + </p> + </td> + <td> + <p> + <tt>[-strikethrough]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.font_styles">Font Styles</a> + and <a href="#quickbook.syntax.phrase.simple_formatting">Simple + formatting</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + <em class="replaceable">replaceable</em> + </p> + </td> + <td> + <p> + <tt>[~replaceable]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.replaceable">Replaceble</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + source mode + </p> + </td> + <td> + <p> + <tt>[c++]</tt> or <tt>[python]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.source_mode">Source Mode</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + inline code + </p> + </td> + <td> + <p> + <tt>`int main();`</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.inline_code">Inline code</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + code block + </p> + </td> + <td> + <p> + <tt>``int main();``</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.code">Code</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + code escape + </p> + </td> + <td> + <p> + <tt>``from c++ to QuickBook``</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.escape_back">Escaping Back To + QuickBook</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + line break + </p> + </td> + <td> + <p> + <tt>[br] or \n</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.line_break">line-break</a> + <span class="bold"><strong>DEPRECATED</strong></span> + </p> + </td> + </tr> + <tr> + <td> + <p> + anchor + </p> + </td> + <td> + <p> + <tt>[#anchor]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.anchors">Anchors</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + link + </p> + </td> + <td> + <p> + <tt>[@http://www.boost.org Boost]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.links">Links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + anchor link + </p> + </td> + <td> + <p> + <tt>[link section.anchor Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.anchor_links">Anchor links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + refentry link + </p> + </td> + <td> + <p> + <tt>[link xml.refentry Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.refentry_links">refentry links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + function link + </p> + </td> + <td> + <p> + <tt>[funcref fully::qualified::function_name Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + class link + </p> + </td> + <td> + <p> + <tt>[classref fully::qualified::class_name Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + member link + </p> + </td> + <td> + <p> + <tt>[memberref fully::qualified::member_name Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + enum link + </p> + </td> + <td> + <p> + <tt>[enumref fully::qualified::enum_name Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + macro link + </p> + </td> + <td> + <p> + <tt>[macroref MACRO_NAME Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + concept link + </p> + </td> + <td> + <p> + <tt>[conceptref ConceptName Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + header link + </p> + </td> + <td> + <p> + <tt>[headerref path/to/header.hpp Link text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.code_links">function, class, + member, enum, macro, concept or header links</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + escape + </p> + </td> + <td> + <p> + <tt>'''escaped text (no processing/formatting)'''</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.escape">Escape</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + single char escape + </p> + </td> + <td> + <p> + <tt>\c</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.single_char_escape">Single + char escape</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + images + </p> + </td> + <td> + <p> + <tt>[$image.jpg]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.phrase.images">Images</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + begin section + </p> + </td> + <td> + <p> + <tt>[section The Section Title]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.section">Section</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + end section + </p> + </td> + <td> + <p> + <tt>[endsect]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.section">Section</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + paragraph + </p> + </td> + <td> + <p> + No markup. Paragraphs start left-flushed and are terminated by + two or more newlines. + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.paragraphs">Paragraphs</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + ordered list + </p> + </td> + <td> +<pre class="programlisting"># one +# two +# three +</pre> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.lists.ordered_lists">Ordered + lists</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + unordered list + </p> + </td> + <td> +<pre class="programlisting">* one +* two +* three +</pre> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.lists.unordered_lists">Unordered + lists</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + code + </p> + </td> + <td> + <p> + No markup. Preformatted code starts with a space or a tab. + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.code">Code</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + preformatted + </p> + </td> + <td> + <p> + <tt>[pre preformatted]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.preformatted">Preformatted</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + block quote + </p> + </td> + <td> + <p> + <tt>[:sometext...]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.blockquote">Blockquote</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 1 + </p> + </td> + <td> + <p> + <tt>[h1 Heading 1]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 2 + </p> + </td> + <td> + <p> + <tt>[h2 Heading 2]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 3 + </p> + </td> + <td> + <p> + <tt>[h3 Heading 3]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 4 + </p> + </td> + <td> + <p> + <tt>[h4 Heading 4]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 5 + </p> + </td> + <td> + <p> + <tt>[h5 Heading 5]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + heading 6 + </p> + </td> + <td> + <p> + <tt>[h6 Heading 6]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.headings">Heading</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + macro + </p> + </td> + <td> + <p> + <tt>[def macro_identifier some text]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.macros">Macros</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + template + </p> + </td> + <td> + <p> + <tt>[template[a b] [a] body [b]]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.templates">Templates</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + blurb + </p> + </td> + <td> + <p> + <tt>[blurb advertisement or note...]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.blurbs">Blurbs</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + admonition + </p> + </td> + <td> + <p> + <tt>[warning Warning text...]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.admonitions">Admonitions</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + table + </p> + </td> + <td> +<pre class="programlisting">[table Title +[[a][b][c]] +[[a][b][c]] +] +</pre> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.tables">Tables</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + variablelist + </p> + </td> + <td> +<pre class="programlisting">[variablelist Title +[[a][b]] +[[a][b]] +] +</pre> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.variable_lists">Variable Lists</a> + </p> + </td> + </tr> + <tr> + <td> + <p> + include + </p> + </td> + <td> + <p> + <tt>[include someother.qbk]</tt> + </p> + </td> + <td> + <p> + <a href="#quickbook.syntax.block.include">Include</a> + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + <div class="footnotes"> + <br/> + <hr/> + <div id="footnote-1" class="footnote"> + <p> + <a href="#quickbook.syntax.phrase.simple_formatting.f0"><sup>[1]</sup></a> + Thanks to David Barrett, author of <a href="http://quinthar.com/qwikiwiki/index.php?page=Home">Qwiki</a>, + for sharing these samples and teaching me these obscure formatting rules. + I wasn't sure at all if <a href="http://spirit.sourceforge.net">Spirit</a>, + being more or less a formal EBNF parser, can handle the context sensitivity + and ambiguity. + </p> + </div> + <div id="footnote-2" class="footnote"> + <p> + <a href="#quickbook.syntax.phrase.footnotes.f0"><sup>[2]</sup></a> A sample + footnote + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/quickbook_manual-1_4.quickbook b/src/boost/tools/quickbook/test/quickbook_manual-1_4.quickbook new file mode 100644 index 000000000..00fc9caa1 --- /dev/null +++ b/src/boost/tools/quickbook/test/quickbook_manual-1_4.quickbook @@ -0,0 +1,1981 @@ +[article Quickbook + [quickbook 1.4] + [version 1.4] + [authors [de Guzman, Joel], [Niebler, Eric]] + [copyright 2002 2004 2006 Joel de Guzman, Eric Niebler] + [purpose /WikiWiki/ style documentation tool] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[/ QuickBook Document version 1.3 ] +[/ Sept 24, 2002 ] +[/ Sept 2, 2004 ] +[/ Feb 14, 2005 ] +[/ Sept 13, 2005 ] + +[/ Some links] + +[def __note__ [$images/note.png]] +[def __alert__ [$images/alert.png]] +[def __tip__ [$images/tip.png]] +[def :-) [$images/smiley.png]] +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] +[def __boostbook__ [@http://www.boost.org/doc/html/boostbook.html BoostBook]] +[def __docbook__ [@http://www.docbook.org/ DocBook]] + +[def __comments__ [link quickbook.syntax.comments Comments]] + +[def __font_styles__ [link quickbook.syntax.phrase.font_styles Font Styles]] +[def __quotations__ [link quickbook.syntax.phrase.quotations Quotations]] +[def __replaceable__ [link quickbook.syntax.phrase.replaceable Replaceble]] +[def __simple_formatting__ [link quickbook.syntax.phrase.simple_formatting Simple formatting]] +[def __inline_code__ [link quickbook.syntax.phrase.inline_code Inline code]] +[def __code_blocks__ [link quickbook.syntax.phrase.code_blocks Code blocks]] +[def __source_mode__ [link quickbook.syntax.phrase.source_mode Source Mode]] +[def __line_break__ [link quickbook.syntax.phrase.line_break line-break]] +[def __anchors__ [link quickbook.syntax.phrase.anchors Anchors]] +[def __links__ [link quickbook.syntax.phrase.links Links]] +[def __anchor_links__ [link quickbook.syntax.phrase.anchor_links Anchor links]] +[def __refentry_links__ [link quickbook.syntax.phrase.refentry_links refentry links]] +[def __code_links__ [link quickbook.syntax.phrase.code_links function, class, member, enum, macro, concept or header links]] +[def __escape__ [link quickbook.syntax.phrase.escape Escape]] +[def __single_char_escape__ [link quickbook.syntax.phrase.single_char_escape Single char escape]] +[def __images__ [link quickbook.syntax.phrase.images Images]] + +[def __document__ [link quickbook.syntax.block.document Document]] +[def __section__ [link quickbook.syntax.block.section Section]] +[def __xinclude__ [link quickbook.syntax.block.xinclude xinclude]] +[def __paragraphs__ [link quickbook.syntax.block.paragraphs Paragraphs]] +[def __ordered_lists__ [link quickbook.syntax.block.lists.ordered_lists Ordered lists]] +[def __list_hierarchies__ [link quickbook.syntax.block.lists.list_hierarchies List Hierarchies]] +[def __long_list_lines__ [link quickbook.syntax.block.lists.long_list_lines Long List Lines]] +[def __unordered_lists__ [link quickbook.syntax.block.lists.unordered_lists Unordered lists]] +[def __mixed_lists__ [link quickbook.syntax.block.lists.mixed_lists Mixed lists]] +[def __code__ [link quickbook.syntax.block.code Code]] +[def __escape_back__ [link quickbook.syntax.block.escape_back Escaping Back To QuickBook]] +[def __preformatted__ [link quickbook.syntax.block.preformatted Preformatted]] +[def __blockquote__ [link quickbook.syntax.block.blockquote Blockquote]] +[def __heading__ [link quickbook.syntax.block.headings Heading]] +[def __macros__ [link quickbook.syntax.block.macros Macros]] +[def __templates__ [link quickbook.syntax.block.templates Templates]] +[def __predefined_macros__ [link quickbook.syntax.block.predefined_macros Predefined Macros]] +[def __blurbs__ [link quickbook.syntax.block.blurbs Blurbs]] +[def __admonitions__ [link quickbook.syntax.block.admonitions Admonitions]] +[def __tables__ [link quickbook.syntax.block.tables Tables]] +[def __variable_lists__ [link quickbook.syntax.block.variable_lists Variable Lists]] +[def __include__ [link quickbook.syntax.block.include Include]] +[def __import__ [link quickbook.syntax.block.import Import]] + +[section:intro Introduction] + +[:[*['["Why program by hand in five days what you can spend five years of your +life automating?]]] + +-- Terrence Parr, author ANTLR/PCCTS +] + +Well, QuickBook started as a weekend hack. It was originally intended to be a +sample application using __spirit__. What is it? What you are viewing now, this +documentation, is autogenerated by QuickBook. These files were generated from +one master: + +[:[@../quickbook.qbk quickbook.qbk]] + +Originally named QuickDoc, this funky tool that never dies evolved into a +funkier tool thanks to Eric Niebler who resurrected the project making it +generate __boostbook__ instead of HTML. The __boostbook__ documentation format +is an extension of __docbook__, an SGML or XML based format for describing +documentation. + +QuickBook is a WikiWiki style documentation tool geared towards C++ +documentation using simple rules and markup for simple formatting tasks. +QuickBook extends the WikiWiki concept. Like the WikiWiki, QuickBook documents are +simple text files. A single QuickBook document can generate a fully linked set +of nice HTML and PostScript/PDF documents complete with images and syntax- +colorized source code. + +Features include: + +* generate __boostbook__ xml, to generate HTML, PostScript and PDF +* simple markup to link to Doxygen-generated entities +* macro system for simple text substitution +* simple markup for italics, bold, preformatted, blurbs, code samples, + tables, URLs, anchors, images, etc. +* automatic syntax coloring of code samples +* CSS support + +[endsect] + +[section:change_log Change Log] + +[h3 Version 1.3] + +* Quickbook file inclusion \[include\]. +* Better xml output (pretty layout). Check out the generated XML. +* Regression testing facility: to make sure your document will always be + compatible (full backward compatibility) regardless of changes to + QuickBook. +* Code cleanup and refactoring. +* Allow phrase markup in the doc-info. +* Preformatted code blocks via \`\`code\`\` (double ticks) allows code in tables + and lists, for example. +* Quickbook versioning; allows full backward compatibility. You have to add + \[quickbook 1.3\] to the doc-info header to enable the new features. Without + this, QuickBook will assume that the document is a pre-1.3 document. +* Better (intuitive) paragraph termination. Some markups may terminate a paragraph. + Example:`` + [section x] + blah... + [endsect]`` +* Fully qualified section and headers. Subsection names are concatenated to the + ID to avoid clashing. Example: `doc_name.sect_name.sub_sect_name.sub_sub_sect_name` +* Better and whitespace handling in code snippets. +* \[xinclude\] fixes up the relative path to the target XML file when + input_directory is not the same as the output_directory. +* Allow untitled tables. +* Allow phrase markups in section titles. +* Allow escaping back to QuickBook from code, code blocks and inline code. +* Footnotes, with the \[footnote This is the footnote\] syntax. +* Post-processor bug fix for escaped XML code that it does not recognize. +* Replaceable, with the \[~replacement\] syntax. +* Generic Headers +* Code changes to allow full recursion (i.e. Collectors and push/pop functions) +* Various code cleanup/maintenance +* Templates! +* \[conceptref\] for referencing BoostBook <concept> entities. +* Allow escape of spaces. The escaped space is removed from the output. Syntax: + `\ `. +* Nested comments are now allowed. +* Quickbook blocks can nest inside comments. +* __import__ facility. +* Callouts on imported code +* Simple markups can now span a whole block. +* __blurbs__, __admonitions__ and table cells (see __tables__) may now + contain paragraphs. +* `\n` and `[br]` are now deprecated. + +[endsect] + +[section:syntax Syntax Summary] + +A QuickBook document is composed of one or more blocks. An example of +a block is the paragraph or a C++ code snippet. Some blocks have +special mark-ups. Blocks, except code snippets which have their own +grammar (C++ or Python), are composed of one or more phrases. A phrase +can be a simple contiguous run of characters. Phrases can have special +mark-ups. Marked up phrases can recursively contain other phrases, but +cannot contain blocks. A terminal is a self contained block-level or +phrase-level element that does not nest anything. + +Blocks, in general, are delimited by two end-of-lines (the block terminator). +Phrases in each block cannot contain a block terminator. This way, syntax errors +such as un-matched closing brackets do not go haywire and corrupt anything past +a single block. + +[section Comments] + +Can be placed anywhere. + +[pre +'''[/ comment (no output generated) ]''' +] + +[/ for testing only... ] + +[pre +'''[/ comments can be nested [/ some more here] ]''' +] + +[/ for testing [/ only ] ] + +[pre +'''[/ Quickbook blocks can nest inside comments. [*Comment this out too!] ]''' +] + +[/ for testing [*only ] ] + +[endsect] + +[section:phrase Phrase Level Elements] + +[section Font Styles] + +[pre''' +['italic], [*bold], [_underline], [^teletype], [-strikethrough] +'''] + +will generate: + +['italic], [*bold], [_underline], [^teletype], [-strikethrough] + +Like all non-terminal phrase level elements, this can of course be nested: + +[pre''' +[*['bold-italic]] +'''] + +will generate: + +[*['bold-italic]] + +[endsect] + +[section Replaceable] + +When you want content that may or must be replaced by the user, use the syntax: + +[pre''' +[~replacement] +'''] + +This will generate: + +[~replacement] + +[endsect] + +[section Quotations] + +[pre''' +["A question that sometimes drives me hazy: am I or are the others crazy?]--Einstein +'''] + +will generate: + +["A question that sometimes drives me hazy: am I or are the others crazy?]--Einstein + +Note the proper left and right quote marks. Also, while you can simply use +ordinary quote marks like "quoted", our quotation, above, will generate correct +DocBook quotations (e.g. <quote>quoted</quote>). + +Like all phrase elements, quotations may be nested. Example: + +[pre''' +["Here's the rule for bargains: ["Do other men, for they would do you.] That's +the true business precept.] +'''] + +will generate: + +["Here's the rule for bargains: ["Do other men, for they would do you.] +That's the true business precept.] + +[endsect] +[section Simple formatting] + +Simple markup for formatting text, common in many applications, is now supported: + +[pre''' +/italic/, *bold*, _underline_, =teletype= +'''] + +will generate: + +/italic/, *bold*, _underline_, =teletype= + +Unlike QuickBook's standard formatting scheme, the rules for simpler +alternatives are much stricter[footnote Thanks to David Barrett, author of +[@http://quinthar.com/qwikiwiki/index.php?page=Home Qwiki], for sharing +these samples and teaching me these obscure formatting rules. I wasn't sure +at all if __spirit__, being more or less a formal EBNF parser, can handle +the context sensitivity and ambiguity.]. + +* Simple markups cannot nest. You can combine a simple markup with a nestable markup. +* Simple markups cannot contain any other form of quickbook markup. +* A non-space character must follow the leading markup +* A non-space character must precede the trailing markup +* A space or a punctuation must follow the trailing markup +* If the matching markup cannot be found within a block, the formatting + will not be applied. This is to ensure that un-matched formatting markups, + which can be a common mistake, does not corrupt anything past a single block. + We do not want the rest of the document to be rendered bold just because we + forgot a trailing '*'. A single block is terminated by two end of lines or + the close bracket: ']'. +* A line starting with the star will be interpreted as an unordered list. + See __unordered_lists__. + +[table More Formatting Samples + [[Markup] [Result]] + [[[^'''*Bold*''']] [*Bold*]] + [[[^'''*Is bold*''']] [*Is bold*]] + [[[^'''* Not bold* *Not bold * * Not bold *''']] [* Not bold* *Not bold * * Not bold *]] + [[[^'''This*Isn't*Bold (no bold)''']] [This*Isn't*Bold (no bold)]] + [[[^'''(*Bold Inside*) (parenthesis not bold)''']] [(*Bold Inside*) (parenthesis not bold)]] + [[[^'''*(Bold Outside)* (parenthesis bold)''']] [*(Bold Outside)* (parenthesis bold)]] + [[[^'''3*4*5 = 60 (no bold)''']] [3*4*5 = 60 (no bold)]] + [[[^'''3 * 4 * 5 = 60 (no bold)''']] [3 * 4 * 5 = 60 (no bold)]] + [[[^'''3 *4* 5 = 60 (4 is bold)''']] [3 *4* 5 = 60 (4 is bold)]] + [[[^'''*This is bold* this is not *but this is*''']][*This is bold* this is not *but this is*]] + [[[^'''*This is bold*.''']] [*This is bold*.]] + [[[^'''*B*. (bold B)''']] [*B*. (bold B)]] + [[[^'''['*Bold-Italic*]''']] [['*Bold-Italic*]]] + [[[^'''*side-by*/-side/''']] [*side-by*/-side/]] +] + +As mentioned, simple markups cannot go past a single block. The text +from "have" to "full" in the following paragraph will be rendered as +bold: + +[pre''' +Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full!* +One for the master, one for the dame, +And one for the little boy who lives down the lane. +'''] + +Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full!* +One for the master, one for the dame, +And one for the little boy who lives down the lane. + +But in the following paragraph, bold is not applied: + +[pre''' +Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full! +One for the master, one for the dame, +And one for the little boy who lives down the lane. +'''] + +Baa baa black sheep, *have you any wool? +Yes sir, yes sir, three bags full! +One for the master, one for the dame, +And one for the little boy who lives down the lane. + +[endsect] +[section Inline code] + +Inlining code in paragraphs is quite common when writing C++ documentation. We +provide a very simple markup for this. For example, this: + +[pre''' +This text has inlined code `int main() { return 0; }` in it. +'''] + +will generate: + +This text has inlined code `int main() { return 0; }` in it. The code will be +syntax highlighted. + +[note We simply enclose the code with the tick: [^'''"`"'''], not the +single quote: `"'"`. Note too that [^'''`some code`'''] is preferred over +[^'''[^some code]''']. ] + +[endsect] +[section Code blocks] + +Preformatted code simply starts with a space or a tab (See __code__). +However, such a simple syntax cannot be used as phrase elements in lists +(See __ordered_lists__ and __unordered_lists__), tables (See __tables__), +etc. Inline code (see above) can. The problem is, inline code does not +allow formatting with newlines, spaces, and tabs. These are lost. + +We provide a phrase level markup that is a mix between the two. By using the +double-tick, instead of the single-tick, we are telling QuickBook to use +preformatted blocks of code. Example: + +[pre +\`\` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } +\`\` +] + +will generate: + +`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } +`` + +[endsect] +[section Source Mode] + +If a document contains more than one type of source code then the source +mode may be changed dynamically as the document is processed. All QuickBook +documents are initially in C++ mode by default, though an alternative +initial value may be set in the __document__ section. + +To change the source mode, use the [^\[source-mode\]] markup, where +=source-mode= is one of the supported modes. For example, this: + +[pre''' +Python's [python] `import` is rather like C++'s [c++] `#include`. A +C++ comment `// looks like this` whereas a Python comment [python] +`# looks like this`. +'''] + +will generate: + +Python's [python] `import` is rather like C++'s [c++] `#include`. A +C++ comment `// looks like this` whereas a Python comment [python] +`#looks like this`. + +[table Supported Source Modes + [[Mode] [Source Mode Markup]] + [[C++] [[^\[c++\]]]] + [[Python] [[^\[python\]]]] +] + +[note The source mode strings are lowercase.] + +[endsect] +[section line-break] + +[pre''' +[br] +'''] + +[warning `[br]` is now deprecated. __blurbs__, __admonitions__ and +table cells (see __tables__) may now contain paragraphs.] + +[endsect] +[section Anchors] + +[pre''' +[#named_anchor] +'''] + +A named anchor is a hook that can be referenced by a link elsewhere in the +document. You can then reference an anchor with [^'''[link named_anchor +Some link text]''']. See __anchor_links__, __section__ and __heading__. + +[endsect] +[section Links] + +[pre''' +[@http://www.boost.org this is [*boost's] website....] +'''] + +will generate: + +[@http://www.boost.org this is [*boost's] website....] + +URL links where the link text is the link itself is common. Example: + +[pre''' +see http://spirit.sourceforge.net/ +'''] + +so, when the text is absent in a link markup, the URL is assumed. Example: + +[pre +see '''[@http://spirit.sourceforge.net/]''' +] + +will generate: + +see [@http://spirit.sourceforge.net/] + +[endsect] +[section Anchor links] + +You can link within a document using: + +[pre''' +[link section_id.normalized_header_text The link text] +'''] + +See sections __section__ and __heading__ for more info. + +[endsect] +[section refentry links] + +In addition, you can link internally to an XML refentry like: + +[pre''' +[link xml.refentry The link text] +'''] + +This gets converted into [^<link linkend="xml.refentry">The link text</link>]. + +Like URLs, the link text is optional. If this is not present, the link text will +automatically be the refentry. Example: + +[pre''' +[link xml.refentry] +'''] + +This gets converted into [^<link linkend="xml.refentry">xml.refentry</link>]. + +[endsect] +[section:code_links Code Links] + +If you want to link to a function, class, member, enum, concept or header in the reference +section, you can use: + +[pre''' +[funcref fully::qualified::function_name The link text] +[classref fully::qualified::class_name The link text] +[memberref fully::qualified::member_name The link text] +[enumref fully::qualified::enum_name The link text] +[macroref MACRO_NAME The link text] +[conceptref ConceptName The link text] +[headerref path/to/header.hpp The link text] +'''] + +Again, the link text is optional. If this is not present, the link text will +automatically be the function, class, member, enum, macro, concept or header. Example: + +[pre''' +[classref boost::bar::baz] +'''] + +would have "boost::bar::baz" as the link text. + +[endsect] +[section Escape] + +The escape mark-up is used when we don't want to do any processing. + +[pre +\'\'\' +escape (no processing/formatting) +\'\'\' +] + +Escaping allows us to pass XML markup to __boostbook__ or __docbook__. For example: + +[pre +\'\'\' +<emphasis role="bold">This is direct XML markup</emphasis> +\'\'\' +] + +''' +<emphasis role="bold">This is direct XML markup</emphasis> +''' + +[important Be careful when using the escape. The text must conform to +__boostbook__/__docbook__ syntax.] + +[endsect] +[section Single char escape] + +The backslash may be used to escape a single punctuation character. The +punctuation immediately after the backslash is passed without any processing. +This is useful when we need to escape QuickBook punctuations such as `[` and `]`. +For example, how do you escape the triple quote? Simple: [^\\'\\'\\'] + + +`\n` has a special meaning. It is used to generate line breaks. + +[warning `\n` and `[br]` are now deprecated. __blurbs__, __admonitions__ +and table cells (see __tables__) may now contain paragraphs.] + +The escaped space: `\ ` also has a special meaning. The escaped space is removed +from the output. + +[endsect] +[section Images] + +[pre''' +[$image.jpg] +'''] + +[endsect] +[section Footnotes] + +As of version 1.3, QuickBook supports footnotes. Just put the text of the +footnote in a `[footnote]` block, and the text will be put at the bottom +of the current page. For example, this: + +[pre''' +[footnote A sample footnote] +'''] + +will generate this[footnote A sample footnote]. + +[section Macro Expansion] + +[pre''' +__a_macro_identifier__ +'''] + +See __macros__ for details. + +[endsect] + +[section Template Expansion] + +[pre''' +[a_template_identifier] +'''] + +See __templates__ for details. + +[endsect] + +[endsect] +[endsect] +[section:block Block Level Elements] + +[section Document] + +Every document must begin with a Document Info section, which should look +like this: + +[pre''' +[document-type The Document Title + [quickbook 1.3] + [version 1.0] + [id the_document_name] + [dirname the_document_dir] + [copyright 2000 2002 2003 Joe Blow, Jane Doe] + [purpose The document's reason for being] + [category The document's category] + [authors [Blow, Joe], [Doe, Jane]] + [license The document's license] + [source-mode source-type] +] +'''] + +Where document-type is one of: + +* book +* article +* library +* chapter +* part +* appendix +* preface +* qandadiv +* qandaset +* reference +* set + +quickbook 1.3 declares the version of quickbook the document is written for. +In its absence, version 1.1 is assumed. + +=version=, =id=, =dirname=, =copyright=, =purpose=, =category=, =authors=, +=license=, =last-revision= and =source-mode= are optional information. + +=source-type= is a lowercase string setting the initial __source_mode__. If +the =source-mode= field is omitted, a default value of =c++= will be used. + +[endsect] +[section Section] + +Starting a new section is accomplished with: + +[pre''' +[section:id The Section Title] +'''] + +where /id/ is optional. id will be the filename of the generated section. +If it is not present, "The Section Title" will be normalized and become the id. +Valid characters are =a-Z=, =A-Z=, =0-9= and =_=. All non-valid characters are +converted to underscore and all upper-case are converted to lower case. +Thus: "The Section Title" will be normalized to "the_section_title". + +End a section with: + +[pre''' +[endsect] +'''] + +Sections can nest, and that results in a hierarchy in the table of contents. + +[endsect] +[section xinclude] + +You can include another XML file with: + +[pre''' +[xinclude file.xml] +'''] + +This is useful when file.xml has been generated by Doxygen and contains your +reference section. + +[endsect] +[section Paragraphs] + +Paragraphs start left-flushed and are terminated by two or more newlines. No +markup is needed for paragraphs. QuickBook automatically detects paragraphs from +the context. Block markups \[section, endsect, h1, h2, h3, h4, h5, h6, blurb, +(block-quote) ':', pre, def, table and include \] may also terminate a paragraph. + +[endsect] + +[section Lists] +[section Ordered lists] + +[pre +# One +# Two +# Three +] + +will generate: + +# One +# Two +# Three + +[endsect] +[section List Hierarchies] + +List hierarchies are supported. Example: + +[pre +# One +# Two +# Three + # Three.a + # Three.b + # Three.c +# Four + # Four.a + # Four.a.i + # Four.a.ii +# Five +] + +will generate: + +# One +# Two +# Three + # Three.a + # Three.b + # Three.c +# Fourth + # Four.a + # Four.a.i + # Four.a.ii +# Five + +[endsect] +[section Long List Lines] + +Long lines will be wrapped appropriately. Example: + +[pre +# A short item. +# A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. +# A short item. +] + +# A short item. +# A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. + A very long item. A very long item. A very long item. +# A short item. + +[endsect] +[section Unordered lists] + +[pre''' +* First +* Second +* Third +'''] + +will generate: + +* First +* Second +* Third + +[endsect] +[section Mixed lists] + +Mixed lists (ordered and unordered) are supported. Example: + +[pre''' +# One +# Two +# Three + * Three.a + * Three.b + * Three.c +# Four +'''] + +will generate: + +# One +# Two +# Three + * Three.a + * Three.b + * Three.c +# Four + +And... + +[pre''' +# 1 + * 1.a + # 1.a.1 + # 1.a.2 + * 1.b +# 2 + * 2.a + * 2.b + # 2.b.1 + # 2.b.2 + * 2.b.2.a + * 2.b.2.b +'''] + +will generate: + +# 1 + * 1.a + # 1.a.1 + # 1.a.2 + * 1.b +# 2 + * 2.a + * 2.b + # 2.b.1 + # 2.b.2 + * 2.b.2.a + * 2.b.2.b + +[endsect] +[endsect] + +[section Code] + +Preformatted code starts with a space or a tab. The code will be +syntax highlighted according to the current __source_mode__: + +[c++] + + #include <iostream> + + int main() + { + // Sample code + std::cout << "Hello, World\n"; + return 0; + } + +[python] + + import cgi + + def cookForHtml(text): + '''"Cooks" the input text for HTML.''' + + return cgi.escape(text) + +[c++] + +Macros that are already defined are expanded in source code. Example: + +[pre''' +[def __array__ [@http://www.boost.org/doc/html/array/reference.html array]] +[def __boost__ [@http://www.boost.org/libs/libraries.htm boost]] + + using __boost__::__array__; +'''] + +Generates: + +[def __array__ [@http://www.boost.org/doc/html/array/reference.html array]] +[def __boost__ [@http://www.boost.org/libs/libraries.htm boost]] + + using __boost__::__array__; + +[endsect] +[section:escape_back Escaping Back To QuickBook] + +Inside code, code blocks and inline code, QuickBook does not allow any +markup to avoid conflicts with the target syntax (e.g. c++). In case you +need to switch back to QuickBook markup inside code, you can do so using a +language specific /escape-back/ delimiter. In C++ and Python, the delimiter +is the double tick (back-quote): "\`\`" and "\`\`". Example: + +[pre''' +void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``() +{ +} +'''] + +Will generate: + + void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``() + { + } + +When escaping from code to QuickBook, only phrase level markups are +allowed. Block level markups like lists, tables etc. are not allowed. + +[endsect] +[section Preformatted] + +Sometimes, you don't want some preformatted text to be parsed as C++. In such +cases, use the [^[pre ... \]] markup block. + +[pre''' +[pre + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + +] +'''] + +Spaces, tabs and newlines are rendered as-is. Unlike all quickbook block level +markup, pre (and Code) are the only ones that allow multiple newlines. The +markup above will generate: + +[pre + +Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + + Some *preformatted* text Some *preformatted* text + +] + +Notice that unlike Code, phrase markup such as font style is still permitted +inside =pre= blocks. + +[endsect] +[section Blockquote] + +[pre +'''[:sometext...]''' +] + +[:Indents the paragraph. This applies to one paragraph only.] + +[endsect] +[section Admonitions] + +[pre''' +[note This is a note] +[tip This is a tip] +[important This is important] +[caution This is a caution] +[warning This is a warning] +'''] + +generates __docbook__ admonitions: + +[note This is a note] +[tip This is a tip] +[important This is important] +[caution This is a caution] +[warning This is a warning] + +These are the only admonitions supported by __docbook__. So, +for example [^\[information This is some information\]] is unlikely +to produce the desired effect. + +[endsect] +[section Headings] + +[pre''' +[h1 Heading 1] +[h2 Heading 2] +[h3 Heading 3] +[h4 Heading 4] +[h5 Heading 5] +[h6 Heading 6] +'''] + +[h1 Heading 1] +[h2 Heading 2] +[h3 Heading 3] +[h4 Heading 4] +[h5 Heading 5] +[h6 Heading 6] + +Headings 1-3 \[h1 h2 and h3\] will automatically have anchors with normalized +names with [^name="section_id.normalized_header_text"] (i.e. valid characters are +=a-z=, =A-Z=, =0-9= and =_=. All non-valid characters are converted to underscore +and all upper-case are converted to lower-case. For example: Heading +1 in section Section 2 will be normalized to [^section_2.heading_1]). You can use: + +[pre''' +[link section_id.normalized_header_text The link text] +'''] + +to link to them. See __anchor_links__ and __section__ for more info. + +[endsect] +[section Generic Heading] + +In cases when you don't want to care about the heading level (1 to 6), you +can use the /Generic Heading/: + +[pre''' +[heading Heading] +'''] + +The /Generic Heading/ assumes the level, plus one, of the innermost section +where it is placed. For example, if it is placed in the outermost section, +then, it assumes /h2/. + +Headings are often used as an alternative to sections. It is used +particularly if you do not want to start a new section. In many cases, +however, headings in a particular section is just flat. Example: + +[pre''' +[section A] +[h2 X] +[h2 Y] +[h2 Z] +[endsect] +'''] + +Here we use h2 assuming that section A is the outermost level. If it is +placed in an inner level, you'll have to use h3, h4, etc. depending on +where the section is. In general, it is the section level plus one. It is +rather tedious, however, to scan the section level everytime. If you +rewrite the example above as shown below, this will be automatic: + +[pre''' +[section A] +[heading X] +[heading Y] +[heading Z] +[endsect] +'''] + +They work well regardless where you place them. You can rearrange sections +at will without any extra work to ensure correct heading levels. In fact, +with /section/ and /heading/, you have all you need. /h1/../h6/ becomes +redundant. /h1/../h6/ might be deprecated in the future. + +[endsect] +[section Macros] + +[pre''' +[def macro_identifier some text] +'''] + +When a macro is defined, the identifier replaces the text anywhere in the +file, in paragraphs, in markups, etc. macro_identifier is a string of non- +white space characters except '\]'. A macro may not follow an alphabetic +character or the underscore. The replacement text can be any phrase (even +marked up). Example: + +[pre''' +[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]] +sf_logo +'''] + +Now everywhere the sf_logo is placed, the picture will be inlined. + +[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]] +sf_logo + +[tip It's a good idea to use macro identifiers that are distinguishable. +For instance, in this document, macro identifiers have two leading and +trailing underscores (e.g. [^'''__spirit__''']). The reason is to avoid +unwanted macro replacement.] + +Links (URLS) and images are good candidates for macros. *1*) They tend to +change a lot. It is a good idea to place all links and images in one place near the top +to make it easy to make changes. *2*) The syntax is not pretty. It's easier to read and +write, e.g. [^'''__spirit__'''] than [^'''[@http://spirit.sourceforge.net Spirit]''']. + +Some more examples: + +[pre''' +[def :-) [$theme/smiley.png]] +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] +'''] + +(See __images__ and __links__) + +Invoking these macros: + +[pre''' +Hi __spirit__ :-) +'''] + +will generate this: + +Hi __spirit__ :-) + +[endsect] +[section Predefined Macros] + +Quickbook has some predefined macros that you can already use. + +[table Predefined Macros + [[Macro] [Meaning] [Example]] + [['''__DATE__'''] [Today's date] [__DATE__]] + [['''__TIME__'''] [The current time] [__TIME__]] + [['''__FILENAME__'''] [Quickbook source filename] [__FILENAME__]] +] + +[endsect] +[section Templates] + +Templates provide a more versatile text substitution mechanism. Templates +come in handy when you need to create parameterizable, multi-line, +boilerplate text that you specify once and expand many times. Templates +accept one or more arguments. These arguments act like place-holders for +text replacement. Unlike simple macros, which are limited to phrase level +markup, templates can contain block level markup (e.g. paragraphs, code +blocks and tables). + +Example template: + +[pre''' +[template person[name age what] + +Hi, my name is [name]. I am [age] years old. I am a [what]. + +] +'''] + +[template person[name age what] + +Hi, my name is [name]. I am [age] years old. I am a [what]. + +] + +[heading Template Identifier] + +Template identifiers can either consist of: + +* An initial alphabetic character or the underscore, followed by + zero or more alphanumeric characters or the underscore. This is + similar to your typical C/C++ identifier. +* A single character punctuation (a non-alphanumeric printable character) + +[heading Formal Template Arguments] + +Template formal arguments are identifiers consisting of an initial +alphabetic character or the underscore, followed by zero or more +alphanumeric characters or the underscore. This is similar to your typical +C/C++ identifier. + +A template formal argument temporarily hides a template of the same name at +the point where the [link quickbook.syntax.block.templates.template_expansion +template is expanded]. Note that the body of the [^person] template above +refers to [^name] [^age] and [^what] as [^\[name\]] [^\[age\]] and +[^\[what\]]. [^name] [^age] and [^what] are actually templates that exist +in the duration of the template call. + +[heading Template Body] + +The template body can be just about any QuickBook block or phrase. There +are actually two forms. Templates may be phrase or block level. Phrase +templates are of the form: + +[pre''' +[template sample[arg1 arg2...argN] replacement text... ] +'''] + +Block templates are of the form: + +[pre''' +[template sample[arg1 arg2...argN] +replacement text... +] +'''] + +The basic rule is as follows: if a newline immediately follows the argument +list, then it is a block template, otherwise, it is a phrase template. +Phrase templates are typically expanded as part of phrases. Like macros, +block level elements are not allowed in phrase templates. + +[heading Template Expansion] + +You expand a template this way: + +[pre''' +[template_identifier arg1..arg2..arg3] +'''] + +At template expansion, you supply the actual arguments. The template will +be expanded with your supplied arguments. Example: + +[pre''' +[person James Bond..39..Spy] +[person Santa Clause..87..Big Red Fatso] +'''] + +Which will expand to: + +[person James Bond..39..Spy] +[person Santa Clause..87..Big Red Fatso] + +[caution A word of caution: Templates are recursive. A template can call +another template or even itself, directly or indirectly. There are no +control structures in QuickBook (yet) so this will always mean infinite +recursion. QuickBook can detect this situation and report an error if +recursion exceeds a certain limit.] + +Each actual argument can be a word, a text fragment or just about any [link +quickbook.syntax.phrase QuickBook phrase]. Arguments are separated by the +double dot [^".."] and terminated by the close parenthesis. + +[heading Nullary Templates] + +Nullary templates look and act like simple macros. Example: + +[pre''' +[template alpha[]'''&#945;'''] +[template beta[]'''&#946;'''] +'''] + +[template alpha[]'''α'''] +[template beta[]'''β'''] + +Expanding: + +[pre'''Some squigles...[*[alpha][beta]]'''] + +We have: + +Some squiggles...[*[alpha][beta]] + +The difference with macros are + +* The explicit [link quickbook.syntax.block.templates.template_expansion + template expansion syntax]. This is an advantage because, now, we don't + have to use obscure naming conventions like double underscores (e.g. + \_\_alpha\_\_) to avoid unwanted + macro replacement. +* The template is expanded at the point where it is invoked. A macro is + expanded immediately at its point of declaration. This is subtle and + can cause a slight difference in behavior especially if you refer to + other macros and templates in the body. + +The empty brackets after the template identifier ([^alpha\[\]]) indicates no +arguments. If the template body does not look like a template argument list, we +can elide the empty brackets. Example: + +[pre''' +[template aristotle_quote Aristotle: [*['Education is the best provision +for the journey to old age.]]] +'''] + +[template aristotle_quote\ Aristotle: [*['Education is the best provision +for the journey to old age.]]] + +Expanding: + +[pre''' +Here's a quote from [aristotle_quote]. +'''] + +We have: + +Here's a quote from [aristotle_quote]. + +The disadvantage is that you can't avoid the space between the template +identifier, `aristotle_quote`, and the template body "Aristotle...". This space +will be part of the template body. If that space is unwanted, use empty +brackets or use the space escape: "`\ `". Example: + +[pre''' +[template tag\ _tag] +'''] + +[template tag\ _tag] + +Then expanding: + +[pre''' +`struct` x[tag]; +'''] + +We have: + +`struct` x[tag]; + +You have a couple of ways to do it. I personally prefer the explicit empty +brackets, though. + +[heading Simple Arguments] + +As mentioned, arguments are separated by the double dot [^".."]. If there +are less arguments passed than expected, QuickBook attempts to break the +last argument into two or more arguments following this logic: + +* Break the last argument into two, at the first space found ([^'', '\\n', + \\t' or '\\r']). +* Repeat until there are enough arguments or if there are no more spaces + found (in which case, an error is reported). + +For example: + +[pre''' +[template simple[a b c d] [a][b][c][d]] +[simple w x y z] +'''] + +will produce: + +[template simple[a b c d] [a][b][c][d]] +[simple w x y z] + +"w x y z" is initially treated as a single argument because we didn't +supply any [^".."] separators. However, since [^simple] expects 4 +arguments, "w x y z" is broken down iteratively (applying the logic above) +until we have "w", "x", "y" and "z". + +QuickBook only tries to get the arguments it needs. For example: + +[pre''' +[simple w x y z trail] +'''] + +will produce: + +[simple w x y z trail] + +The arguments being: "w", "x", "y" and "z trail". + +It should be obvious now that for simple arguments with no spaces, we can +get by without separating the arguments with [^".."] separators. It is +possible to combine [^".."] separators with the argument passing +simplification presented above. Example: + +[pre''' +[simple what do you think ..m a n?] +'''] + +will produce: + +[simple what do you think ..m a n?] + +[heading Punctuation Templates] + +With templates, one of our objectives is to allow us to rewrite QuickBook +in QuickBook (as a qbk library). For that to happen, we need to accommodate +single character punctuation templates which are fairly common in +QuickBook. You might have noticed that single character punctuations are +allowed as [link quickbook.syntax.block.templates.template_identifier +template identifiers]. Example: + +[pre''' +[template ![bar] '''<hey>'''[bar]'''</hey>'''] +'''] + +Now, expanding this: + +[pre''' +[!baz] +'''] + +We will have: + +[pre +<hey>baz</hey> +] + +[endsect] +[section Blurbs] + +[pre''' +[blurb :-) [*An eye catching advertisement or note...] + + __spirit__ is an object-oriented recursive-descent parser generator framework + implemented using template meta-programming techniques. Expression templates + allow us to approximate the syntax of Extended Backus-Normal Form (EBNF) + completely in C++. +] +'''] + +will generate this: + +[blurb :-) [*An eye catching advertisement or note...] + + __spirit__ is an object-oriented recursive-descent parser generator + framework implemented using template meta-programming techniques. Expression + templates allow us to approximate the syntax of Extended Backus-Normal Form + (EBNF) completely in C++. +] + +[note Prefer [link quickbook.syntax.block.admonitions admonitions] wherever +appropriate.] + +[endsect] +[section Tables] + +[pre''' +[table A Simple Table + [[Heading 1] [Heading 2] [Heading 3]] + [[R0-C0] [R0-C1] [R0-C2]] + [[R1-C0] [R1-C1] [R1-C2]] + [[R2-C0] [R2-C1] [R2-C2]] +] +'''] + +will generate: + +[table A Simple Table + [[Heading 1] [Heading 2] [Heading 3]] + [[R0-C0] [R0-C1] [R0-C2]] + [[R2-C0] [R2-C1] [R2-C2]] + [[R3-C0] [R3-C1] [R3-C2]] +] + +The table title is optional. The first row of the table is automatically +treated as the table header; that is, it is wrapped in +[^<thead>...</thead>] XML tags. Note that unlike the original QuickDoc, the +columns are nested in [ cells... ]. The syntax is free-format and allows +big cells to be formatted nicely. Example: + +[pre''' +[table Table with fat cells + [[Heading 1] [Heading 2]] + [ + [Row 0, Col 0: a small cell] + [ + Row 0, Col 1: a big fat cell with paragraphs + + Boost provides free peer-reviewed portable C++ source libraries. + + We emphasize libraries that work well with the C++ Standard Library. + Boost libraries are intended to be widely useful, and usable across + a broad spectrum of applications. The Boost license encourages both + commercial and non-commercial use. + ] + ] + [ + [Row 1, Col 0: a small cell] + [Row 1, Col 1: a small cell] + ] +] +'''] + +and thus: + +[table Table with fat cells + [[Heading 1] [Heading 2]] + [ + [Row 0, Col 0: a small cell] + [ + Row 0, Col 1: a big fat cell with paragraphs + + Boost provides free peer-reviewed portable C++ source libraries. + + We emphasize libraries that work well with the C++ Standard Library. + Boost libraries are intended to be widely useful, and usable across + a broad spectrum of applications. The Boost license encourages both + commercial and non-commercial use. + ] + ] + [ + [Row 1, Col 0: a small cell] + [Row 1, Col 1: a small cell] + ] +] + +Here's how to have preformatted blocks of code in a table cell: + +[pre''' +[table Table with code + [[Comment] [Code]] + [ + [My first program] + ['''\`\` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + \`\`'''] + ] +] +'''] + +[table Table with code + [[Comment] [Code]] + [ + [My first program] + [`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + ``] + ] +] + +[endsect] +[section Variable Lists] + +[pre''' +[variablelist A Variable List + [[term 1] [The definition of term 1]] + [[term 2] [The definition of term 2]] + [[term 3] [The definition of term 3]] +] +'''] + +will generate: + +[variablelist A Variable List + [[term 1] [The definition of term 1]] + [[term 2] [The definition of term 2]] + [[term 3] [The definition of term 3]] +] + +The rules for variable lists are the same as for tables, except that +only 2 "columns" are allowed. The first column contains the terms, and +the second column contains the definitions. Those familiar with HTML +will recognize this as a "definition list". + +[endsect] +[section Include] + +You can include one QuickBook file from another. The syntax is simply: + +[pre''' +[include someother.qbk] +'''] + +The included file will be processed as if it had been cut and pasted +into the current document, with the following exceptions: + +* The '''__FILENAME__''' predefined macro will reflect the name of the + file currently being processed. +* Any macros defined in the included file are scoped to that file. + +The [^\[include\]] directive lets you specify a document id to use for the +included file. When this id is not explicitly specified, the id defaults to +the filename ("someother", in the example above). You can specify the id +like this: + +[pre''' +[include:someid someother.qbk] +'''] + +All auto-generated anchors will use the document id as a unique prefix. So +for instance, if there is a top section in someother.qbk named "Intro", the +named anchor for that section will be "someid.intro", and you can link to +it with [^\[link someid.intro The Intro\]]. + +[endsect] + +[section Import] + +When documenting code, you'd surely need to present code from actual source +files. While it is possible to copy some code and paste them in your QuickBook +file, doing so is error prone and the extracted code in the documentation tends +to get out of sync with the actual code as the code evolves. The problem, as +always, is that once documentation is written, the tendency is for the docs to +languish in the archives without maintenance. + +QuickBook's import facility provides a nice solution. + +[heading Example] + +You can effortlessly import code snippets from source code into your QuickBook. +The following illustrates how this is done: + +[pre''' +[import ../test/stub.cpp] +[foo] +[bar] +'''] + +The first line: + +[pre''' +[import ../test/stub.cpp] +'''] + +collects specially marked-up code snippets from [@../../test/stub.cpp stub.cpp] +and places them in your QuickBook file as virtual templates. Each of the +specially marked-up code snippets has a name (e.g. `foo` and `bar` in the +example above). This shall be the template identifier for that particular code +snippet. The second and third line above does the actual template expansion: + +[pre''' +[foo] +[bar] +'''] + +And the result is: + +[import ../test/stub.cpp] +[foo] +[bar] + +[heading Code Snippet Markup] + +Note how the code snippets in [@../../test/stub.cpp stub.cpp] get marked up. We +use distinguishable comments following the form: + + //[id + some code here + //] + +The first comment line above initiates a named code-snippet. This prefix will +not be visible in quickbook. The entire code-snippet in between `//[id` and +`//]` will be inserted as a template in quickbook with name ['/id/]. The comment +`//]` ends a code-snippet This too will not be visible in quickbook. + +[heading Special Comments] + +Special comments of the form: + + //` some [*quickbook] markup here + +and: + + /*` some [*quickbook] markup here */ + +will be parsed by QuickBook. This can contain quickbook /blocks/ (e.g. sections, +paragraphs, tables, etc). In the first case, the initial slash-slash, tick and +white-space shall be ignored. In the second, the initial slash-star-tick and the +final star-slash shall be ignored. + +[heading Callouts] + +Special comments of the form: + + /*< some [*quickbook] markup here >*/ + +will be regarded as callouts. These will be collected, numbered and +rendered as a "callout bug" (a small icon with a number). After the +whole snippet is parsed, the callout list is generated. See +[@http://www.docbook.org/tdg/en/html/callout.html Callouts] for details. +Example: + +[foo_bar] + +Checkout [@../../test/stub.cpp stub.cpp] to see the actual code. + +[endsect] + +[endsect] +[endsect] + +[section:install Installation and configuration] + +This section provides some guidelines on how to install and configure +BoostBook and Quickbook under several operating systems. + +Before continuing, it is very important that you keep this in mind: if you +try to build some documents and the process breaks due to misconfiguration, +be absolutely sure to delete any `bin` and `bin.v2` directories generated +by the build before trying again. Otherwise your configuration fixes will +not take any effect. + +[section:windows Windows 2000, XP, 2003, Vista] + +[python] + +[:['Section contributed by Julio M. Merino Vidal]] + +The following instructions apply to any Windows system based on Windows +2000, including Windows XP, Windows 2003 Server and Windows Vista. The +paths shown below are taken from a Windows Vista machine; you will need to +adjust them to match your system in case you are running an older version. + +# First of all you need to have a copy of `xsltproc` for Windows. There + are many ways to get this tool, but to keep things simple, use the + [@http://www.zlatkovic.com/pub/libxml/ binary packages] made by Igor + Zlatkovic. At the very least, you need to download the following + packages: `iconv`, `zlib`, `libxml2` and `libxslt`. + +# Unpack all these packages in the same directory so that you get unique + `bin`, `include` and `lib` directories within the hierarchy. These + instructions use `C:\Users\example\Documents\boost\xml` as the root for + all files. + +# From the command line, go to the `bin` directory and launch + `xsltproc.exe` to ensure it works. You should get usage information on + screen. + +# Download [@http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip Docbook XML + 4.2] and unpack it in the same directory used above. That is: + `C:\Users\example\Documents\boost\xml\docbook-xml`. + +# Download the latest + [@http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608 + Docbook XSL] version and unpack it, again in the same directory + used before. To make things easier, rename the directory created + during the extraction to `docbook-xsl` (bypassing the version name): + `C:\Users\example\Documents\boost\xml\docbook-xsl`. + +# Add the following to your `user-config.jam` file, which should live in + your home directory (`%HOMEDRIVE%%HOMEPATH%`). You must already have it + somewhere or otherwise you could not be building Boost (i.e. missing + tools configuration). + + using xsltproc + : "C:/Users/example/Documents/boost/xml/bin/xsltproc.exe" + ; + + using boostbook + : "C:/Users/example/Documents/boost/xml/docbook-xsl" + : "C:/Users/example/Documents/boost/xml/docbook-xml" + ; + +The above steps are enough to get a functional BoostBook setup. Quickbook +will be automatically built when needed. If you want to avoid these +rebuilds: + +# Go to Quickbook's source directory (`BOOST_ROOT\tools\quickbook`). + +# Build the utility by issuing `bjam --v2`. + +# Copy the resulting `quickbook.exe` binary (located under the + `BOOST_ROOT\bin.v2` hierarchy) to a safe place. Following our previous + example, you can install it into: + `C:\Users\example\Documents\boost\xml\bin`. + +# Add the following to your `user-config.jam` file: + + using quickbook + : "C:/Users/example/Documents/boost/xml/bin/quickbook.exe" + ; + +[endsect] + +[section:linux Debian, Ubuntu] + +The following instructions apply to Debian and its derivatives. They are based +on a Ubuntu Edgy install but should work on other Debian based systems. + +First install the `bjam`, `xsltproc`, `docbook-xsl` and `docbook-xml` packages. +For example, using `apt-get`: + + sudo apt-get install xsltprc docbook-xsl docbook-xml + +If you're planning on building boost's documentation, you'll also need to +install the `doxygen` package as well. + +Next, we need to configure Boost Build to compile BoostBook files. Add the +following to your `user-config.jam` file, which should be in your home +directory. If you don't have one, create a file containing this text. For more +information on setting up `user-config.jam`, see the +[@http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html Boost +Build documentation]. + + using xsltproc ; + + using boostbook + : /usr/share/xml/docbook/stylesheet/nwalsh + : /usr/share/xml/docbook/schema/dtd/4.2 + ; + + # Remove this line if you're not using doxygen + using doxygen ; + +The above steps are enough to get a functional BoostBook setup. Quickbook +will be automatically built when needed. If you want to avoid these +rebuilds: + +# Go to Quickbook's source directory (`BOOST_ROOT/tools/quickbook`). + +# Build the utility by issuing `bjam --v2`. + +# Copy the resulting `quickbook` binary (located under the + `BOOST_ROOT/bin.v2` hierarchy) to a safe place. The traditional location is + `/usr/local/bin`. + +# Add the following to your `user-config.jam` file, using the full path of the + quickbook executable: + + using quickbook + : /usr/local/bin/quickbook + ; + +[endsect] +[endsect] [/Installation and configuration] + +[section:editors Editor Support] + +Editing quickbook files is usually done with text editors both simple and +powerful. The following sections list the settings for some editors which can +help make editing quickbook files a bit easier. + +[blurb __note__ You may submit your settings, tips, and suggestions to the +authors, or through the [@https://lists.sourceforge.net/lists/listinfo/boost- +docs Boost Docs mailing list].] + +[section:scite Scintilla Text Editor] + +[:['Section contributed by Dean Michael Berris]] + +The Scintilla Text Editor (SciTE) is a free source code editor for Win32 and X. +It uses the SCIntilla source code editing component. + +[blurb __tip__ SciTE can be downloaded from [@http://www.scintilla.org/SciTE.html]] + +You can use the following settings to highlight quickbook tags when +editing quickbook files. + +[pre''' +qbk=*.qbk +lexer.*.qbk=props +use.tabs.$(qbk)=0 +tab.size.$(qbk)=4 +indent.size.$(qbk)=4 +style.props.32=$(font.base) +comment.stream.start.props=[/ +comment.stream.end.props=] +comment.box.start.props=[/ +comment.box.middle.props= +comment.box.end.props=] +'''] + +[blurb __note__ Thanks to Rene Rivera for the above SciTE settings.] + +[endsect] [/scite] +[endsect] [/editors] + +[section:faq Frequently Asked Questions] + +[heading Can I use QuickBook for non-Boost documentation?] + +QuickBook can be used for non-Boost documentation with a little extra work. + +[:['Faq contributed by Michael Marcin]] + +When building HTML documentation with BoostBook a Boost C++ Libraries header +is added to the files. When using QuickBook to document projects outside of +Boost this is not desirable. This behavior can be overridden at the BoostBook +level by specifying some XSLT options. When using Boost Build version 2 (BBv2) +this can be achieved by adding parameters to the BoostBook target declaration. + +For example: +[pre +using quickbook ; + +xml my_doc : my_doc.qbk ; + +boostbook standalone + : + my_doc + : + <xsl:param>boost.image.src=images/my_project_logo.png + <xsl:param>boost.image.alt="\\"My Project\\"" + <xsl:param>boost.image.w=100 + <xsl:param>boost.image.h=50 + <xsl:param>nav.layout=none + ; +] + +[endsect] [/faq] + +[section:ref Quick Reference] + +[cpp] + +[template ordered_list_sample[] +[pre''' +# one +# two +# three +'''] +] + +[template unordered_list_sample[] +[pre''' +* one +* two +* three +'''] +] + +[template table_sample[] +[pre''' +[table Title +[[a][b][c]] +[[a][b][c]] +] +'''] +] + +[template var_list_sample[] +[pre''' +[variablelist Title +[[a][b]] +[[a][b]] +] +'''] +] + + +[table Syntax Compendium + [[To do this...] [Use this...] [See this...]] + [[comment] [[^'''[/ some comment]''']] [__comments__]] + [[['italics]] [[^'''['italics] or /italics/''']] [__font_styles__ and __simple_formatting__]] + [[[*bold]] [[^'''[*bold] or *bold*''']] [__font_styles__ and __simple_formatting__]] + [[[_underline]] [[^'''[_underline] or _underline_''']] [__font_styles__ and __simple_formatting__]] + [[[^teletype]] [[^'''[^teletype] or =teletype=''']] [__font_styles__ and __simple_formatting__]] + [[[-strikethrough]] [[^'''[-strikethrough]''']] [__font_styles__ and __simple_formatting__]] + [[[~replaceable]] [[^'''[~replaceable]''']] [__replaceable__]] + [[source mode] [[^\[c++\]] or [^\[python\]]] [__source_mode__]] + [[inline code] [[^'''`int main();`''']] [__inline_code__]] + [[code block] [[^'''``int main();``''']] [__code__]] + [[code escape] [[^'''``from c++ to QuickBook``''']] [__escape_back__]] + [[line break] [[^'''[br] or \n''']] [__line_break__ *DEPRECATED*]] + [[anchor] [[^'''[#anchor]''']] [__anchors__]] + [[link] [[^'''[@http://www.boost.org Boost]''']] [__links__]] + [[anchor link] [[^'''[link section.anchor Link text]''']] [__anchor_links__]] + [[refentry link] [[^'''[link xml.refentry Link text]''']] [__refentry_links__]] + [[function link] [[^'''[funcref fully::qualified::function_name Link text]''']] [__code_links__]] + [[class link] [[^'''[classref fully::qualified::class_name Link text]''']] [__code_links__]] + [[member link] [[^'''[memberref fully::qualified::member_name Link text]''']] [__code_links__]] + [[enum link] [[^'''[enumref fully::qualified::enum_name Link text]''']] [__code_links__]] + [[macro link] [[^'''[macroref MACRO_NAME Link text]''']] [__code_links__]] + [[concept link] [[^'''[conceptref ConceptName Link text]''']] [__code_links__]] + [[header link] [[^'''[headerref path/to/header.hpp Link text]''']] [__code_links__]] + [[escape] [[^\'\'\'escaped text (no processing/formatting)\'\'\']] [__escape__]] + [[single char escape] [[^\\c]] [__single_char_escape__]] + [[images] [[^'''[$image.jpg]''']] [__images__]] + [[begin section] [[^'''[section The Section Title]''']] [__section__]] + [[end section] [[^'''[endsect]''']] [__section__]] + [[paragraph] [No markup. Paragraphs start left-flushed and are terminated by two or more newlines.] [__paragraphs__]] + [[ordered list] [[ordered_list_sample]] [__ordered_lists__]] + [[unordered list] [[unordered_list_sample]] [__unordered_lists__]] + [[code] [No markup. Preformatted code starts with a space or a tab.] [__code__]] + [[preformatted] [[^'''[pre preformatted]''']] [__preformatted__]] + [[block quote] [[^'''[:sometext...]''']] [__blockquote__]] + [[heading 1] [[^'''[h1 Heading 1]''']] [__heading__]] + [[heading 2] [[^'''[h2 Heading 2]''']] [__heading__]] + [[heading 3] [[^'''[h3 Heading 3]''']] [__heading__]] + [[heading 4] [[^'''[h4 Heading 4]''']] [__heading__]] + [[heading 5] [[^'''[h5 Heading 5]''']] [__heading__]] + [[heading 6] [[^'''[h6 Heading 6]''']] [__heading__]] + [[macro] [[^'''[def macro_identifier some text]''']] [__macros__]] + [[template] [[^'''[template[a b] [a] body [b]]''']] [__templates__]] + [[blurb] [[^'''[blurb advertisement or note...]''']] [__blurbs__]] + [[admonition] [[^'''[warning Warning text...]''']] [__admonitions__]] + [[table] [[table_sample]] [__tables__]] + [[variablelist] [[var_list_sample]] [__variable_lists__]] + [[include] [[^'''[include someother.qbk]''']] [__include__]] +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/regen-gold.sh b/src/boost/tools/quickbook/test/regen-gold.sh new file mode 100644 index 000000000..c1f9b8e8e --- /dev/null +++ b/src/boost/tools/quickbook/test/regen-gold.sh @@ -0,0 +1,47 @@ +#============================================================================== +# Copyright (c) 2017-2018 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +#!/usr/bin/env bash + +cd $(dirname $0) + +cd .. +b2 -q || exit 1 +cd - + +find . -name "*.gold" | while read gold_file +do + flags="--debug" + + quickbook_file=$(echo $gold_file | sed 's/[.]gold/.quickbook/') + html_file=$(echo $gold_file | sed 's/[.]gold/.gold-html/') + + if [[ $gold_file =~ .*xinclude/.*-alt\.gold ]] + then + quickbook_file=$(echo $quickbook_file | sed 's/-alt\.quickbook/.quickbook/') + flags="$flags --xinclude-base xinclude/sub" + elif [[ $gold_file =~ .*xinclude/.*\.gold ]] + then + flags="$flags --xinclude-base xinclude/../.." + fi + + if [[ $gold_file =~ .*include/filename[-_]path.* ]] + then + flags="$flags -I include/sub" + fi + + if [[ $gold_file =~ .*command_line_macro.* ]] + then + flags="$flags -D__macro__=*bold* -D__empty__" + fi + + ../../../dist/bin/quickbook $quickbook_file $flags --output-file $gold_file || + echo "*** Error generating boostbook from $quickbook_file" + ../../../dist/bin/quickbook $quickbook_file $flags --output-file $html_file --output-format onehtml || + echo "*** Error generating html from $quickbook_file" +done diff --git a/src/boost/tools/quickbook/test/role-1_6.gold b/src/boost/tools/quickbook/test/role-1_6.gold new file mode 100644 index 000000000..bdb4b58ef --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_6.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="quickbook_role_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Quickbook Role Test</title> + <para> + <phrase role="keyword">Keyword</phrase> <phrase role="keyword"></phrase> [role] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/role-1_6.gold-html b/src/boost/tools/quickbook/test/role-1_6.gold-html new file mode 100644 index 000000000..536c82745 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_6.gold-html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Quickbook Role Test + </h3> + <p> + <span class="keyword">Keyword</span> <span class="keyword"></span> [role] + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/role-1_6.quickbook b/src/boost/tools/quickbook/test/role-1_6.quickbook new file mode 100644 index 000000000..0982b9cd9 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_6.quickbook @@ -0,0 +1,5 @@ +[article Quickbook Role Test +[quickbook 1.6] +] + +[role keyword Keyword] [role keyword] [role] diff --git a/src/boost/tools/quickbook/test/role-1_7-fail.quickbook b/src/boost/tools/quickbook/test/role-1_7-fail.quickbook new file mode 100644 index 000000000..b01d16e23 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Quickbook Role Fail Test +[quickbook 1.7] +] + +[role] diff --git a/src/boost/tools/quickbook/test/role-1_7.gold b/src/boost/tools/quickbook/test/role-1_7.gold new file mode 100644 index 000000000..4cd7d5bb7 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_7.gold @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="quickbook_role_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Quickbook Role Test</title> + <para> + <phrase role="keyword">Keyword</phrase> <phrase role="keyword"></phrase> + </para> + <para> + road <phrase role="red">Red</phrase> <phrase role="red"></phrase> <phrase role="three-colours-red">Three + Colours Red</phrase> <phrase role="red-road">Red Road</phrase> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/role-1_7.gold-html b/src/boost/tools/quickbook/test/role-1_7.gold-html new file mode 100644 index 000000000..7e2eb0122 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_7.gold-html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Quickbook Role Test + </h3> + <p> + <span class="keyword">Keyword</span> <span class="keyword"></span> + </p> + <p> + road <span class="red">Red</span> <span class="red"></span> <span class="three-colours-red">Three + Colours Red</span> <span class="red-road">Red Road</span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/role-1_7.quickbook b/src/boost/tools/quickbook/test/role-1_7.quickbook new file mode 100644 index 000000000..17bf44952 --- /dev/null +++ b/src/boost/tools/quickbook/test/role-1_7.quickbook @@ -0,0 +1,13 @@ +[article Quickbook Role Test +[quickbook 1.7] +] + +[role keyword Keyword] [role keyword] + +[template r red] +[template r2 road] +[r2] +[role [r] Red] [role [r]] +[role three-colours-[r] Three Colours Red] +[role [r]-[r2] Red Road] + diff --git a/src/boost/tools/quickbook/test/section-1_4.gold b/src/boost/tools/quickbook/test/section-1_4.gold new file mode 100644 index 000000000..07ba43a2c --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_4.gold @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="section_id_1_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Section Id 1.4</title> + <section id="section_id_1_4.id_test1"> + <title><link linkend="section_id_1_4.id_test1">Quickbook section id test</link></title> + </section> + <section id="section_id_1_4.id_test2"> + <title><link linkend="section_id_1_4.id_test2">Quickbook section id test</link></title> + </section> + <section id="section_id_1_4.quickbook_section_no_id_test_1"> + <title><link linkend="section_id_1_4.quickbook_section_no_id_test_1">Quickbook + section no id test 1</link></title> + </section> + <section id="section_id_1_4.___quickbook_section_no_id_test_2"> + <title><link linkend="section_id_1_4.___quickbook_section_no_id_test_2">++ Quickbook + section no id test 2</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/section-1_4.gold-html b/src/boost/tools/quickbook/test/section-1_4.gold-html new file mode 100644 index 000000000..948b8a9d7 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_4.gold-html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Section Id 1.4 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_id_1_4.id_test1">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_4.id_test2">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_4.quickbook_section_no_id_test_1">Quickbook section + no id test 1</a> + </li> + <li> + <a href="#section_id_1_4.___quickbook_section_no_id_test_2">++ Quickbook + section no id test 2</a> + </li> + </ul> + </div> + <div id="section_id_1_4.id_test1"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_4.id_test1"> + </div> + </div> + <div id="section_id_1_4.id_test2"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_4.id_test2"> + </div> + </div> + <div id="section_id_1_4.quickbook_section_no_id_test_1"> + <h3> + Quickbook section no id test 1 + </h3> + <div id="section_id_1_4.quickbook_section_no_id_test_1"> + </div> + </div> + <div id="section_id_1_4.___quickbook_section_no_id_test_2"> + <h3> + ++ Quickbook section no id test 2 + </h3> + <div id="section_id_1_4.___quickbook_section_no_id_test_2"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/section-1_4.quickbook b/src/boost/tools/quickbook/test/section-1_4.quickbook new file mode 100644 index 000000000..6dd2beece --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_4.quickbook @@ -0,0 +1,12 @@ +[article Section Id 1.4 + [quickbook 1.4] +] + +[section:id_test1 Quickbook section id test] +[endsect] +[section :id_test2 Quickbook section id test] +[endsect:id_test2] +[section: Quickbook section no id test 1] +[endsect] +[section:++ Quickbook section no id test 2] +[endsect] diff --git a/src/boost/tools/quickbook/test/section-1_5-unclosed.gold b/src/boost/tools/quickbook/test/section-1_5-unclosed.gold new file mode 100644 index 000000000..b86c556ec --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5-unclosed.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unclosed_section" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Unclosed section</title> + <section id="unclosed_section.unclosed"> + <title><link linkend="unclosed_section.unclosed">Unclosed Section should be closed + with a warning</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/section-1_5-unclosed.gold-html b/src/boost/tools/quickbook/test/section-1_5-unclosed.gold-html new file mode 100644 index 000000000..b756717b7 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5-unclosed.gold-html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Unclosed section + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#unclosed_section.unclosed">Unclosed Section should be closed + with a warning</a> + </li> + </ul> + </div> + <div id="unclosed_section.unclosed"> + <h3> + Unclosed Section should be closed with a warning + </h3> + <div id="unclosed_section.unclosed"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/section-1_5-unclosed.quickbook b/src/boost/tools/quickbook/test/section-1_5-unclosed.quickbook new file mode 100644 index 000000000..49b70f491 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5-unclosed.quickbook @@ -0,0 +1,5 @@ +[article Unclosed section +[quickbook 1.5] +] + +[section:unclosed Unclosed Section should be closed with a warning]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/section-1_5.gold b/src/boost/tools/quickbook/test/section-1_5.gold new file mode 100644 index 000000000..13ec9eba2 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5.gold @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="section_id_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Section Id 1.5</title> + <section id="section_id_1_5.id_test1"> + <title><link linkend="section_id_1_5.id_test1">Quickbook section id test</link></title> + </section> + <section id="section_id_1_5.id_test2"> + <title><link linkend="section_id_1_5.id_test2">Quickbook section id test</link></title> + </section> + <section id="section_id_1_5.id_test3"> + <title><link linkend="section_id_1_5.id_test3">Quickbook section id test</link></title> + </section> + <section id="section_id_1_5.___quickbook_section_no_id_test"> + <title><link linkend="section_id_1_5.___quickbook_section_no_id_test">++ Quickbook + section no id test</link></title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/section-1_5.gold-html b/src/boost/tools/quickbook/test/section-1_5.gold-html new file mode 100644 index 000000000..6089cf1ac --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5.gold-html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Section Id 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_id_1_5.id_test1">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_5.id_test2">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_5.id_test3">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_5.___quickbook_section_no_id_test">++ Quickbook + section no id test</a> + </li> + </ul> + </div> + <div id="section_id_1_5.id_test1"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_5.id_test1"> + </div> + </div> + <div id="section_id_1_5.id_test2"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_5.id_test2"> + </div> + </div> + <div id="section_id_1_5.id_test3"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_5.id_test3"> + </div> + </div> + <div id="section_id_1_5.___quickbook_section_no_id_test"> + <h3> + ++ Quickbook section no id test + </h3> + <div id="section_id_1_5.___quickbook_section_no_id_test"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/section-1_5.quickbook b/src/boost/tools/quickbook/test/section-1_5.quickbook new file mode 100644 index 000000000..223a7e6c8 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_5.quickbook @@ -0,0 +1,12 @@ +[article Section Id 1.5 + [quickbook 1.5] +] + +[section:id_test1 Quickbook section id test] +[endsect] +[section :id_test2 Quickbook section id test] +[endsect:id_test2] +[section: id_test3 Quickbook section id test] +[endsect] +[section:++ Quickbook section no id test] +[endsect] diff --git a/src/boost/tools/quickbook/test/section-1_7.gold b/src/boost/tools/quickbook/test/section-1_7.gold new file mode 100644 index 000000000..02cb4c7d1 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_7.gold @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="section_id_1_7" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Section Id 1.7</title> + <section id="section_id_1_7.quickbook_section_no_id_test"> + <title><link linkend="section_id_1_7.quickbook_section_no_id_test">Quickbook + section no id test</link></title> + </section> + <section id="section_id_1_7.id_test1"> + <title><link linkend="section_id_1_7.id_test1">Quickbook section id test</link></title> + </section> + <section id="section_id_1_7.id_test2"> + <title><link linkend="section_id_1_7.id_test2">Quickbook section id test</link></title> + </section> + <section id="section_id_1_7.id_test3_quickbook_section_id_te"> + <title><link linkend="section_id_1_7.id_test3_quickbook_section_id_te">id_test3 + Quickbook section id test</link></title> + </section> + <section id="section_id_1_7.--"> + <title><link linkend="section_id_1_7.--">Quickbook section odd id test</link></title> + </section> + <section id="section_id_1_7.sect-abc"> + <title><link linkend="section_id_1_7.sect-abc">Section with template in id</link></title> + </section> + <section id="section_id_1_7.link_section_id_1_7_id_test1_lin"> + <title><link linkend="section_id_1_7.id_test1">Link in title</link></title> + </section> + <section id="section_id_1_7.link_section_id_1_7_id_test1_li0"> + <title><link linkend="section_id_1_7.id_test1">Link</link> in title</title> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/section-1_7.gold-html b/src/boost/tools/quickbook/test/section-1_7.gold-html new file mode 100644 index 000000000..0d44ad8a2 --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_7.gold-html @@ -0,0 +1,100 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Section Id 1.7 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_id_1_7.quickbook_section_no_id_test">Quickbook section + no id test</a> + </li> + <li> + <a href="#section_id_1_7.id_test1">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_7.id_test2">Quickbook section id test</a> + </li> + <li> + <a href="#section_id_1_7.id_test3_quickbook_section_id_te">id_test3 Quickbook + section id test</a> + </li> + <li> + <a href="#section_id_1_7.--">Quickbook section odd id test</a> + </li> + <li> + <a href="#section_id_1_7.sect-abc">Section with template in id</a> + </li> + <li> + <a href="#section_id_1_7.link_section_id_1_7_id_test1_lin"><a href="#section_id_1_7.id_test1">Link + in title</a></a> + </li> + <li> + <a href="#section_id_1_7.link_section_id_1_7_id_test1_li0"><a href="#section_id_1_7.id_test1">Link</a> + in title</a> + </li> + </ul> + </div> + <div id="section_id_1_7.quickbook_section_no_id_test"> + <h3> + Quickbook section no id test + </h3> + <div id="section_id_1_7.quickbook_section_no_id_test"> + </div> + </div> + <div id="section_id_1_7.id_test1"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_7.id_test1"> + </div> + </div> + <div id="section_id_1_7.id_test2"> + <h3> + Quickbook section id test + </h3> + <div id="section_id_1_7.id_test2"> + </div> + </div> + <div id="section_id_1_7.id_test3_quickbook_section_id_te"> + <h3> + id_test3 Quickbook section id test + </h3> + <div id="section_id_1_7.id_test3_quickbook_section_id_te"> + </div> + </div> + <div id="section_id_1_7.--"> + <h3> + Quickbook section odd id test + </h3> + <div id="section_id_1_7.--"> + </div> + </div> + <div id="section_id_1_7.sect-abc"> + <h3> + Section with template in id + </h3> + <div id="section_id_1_7.sect-abc"> + </div> + </div> + <div id="section_id_1_7.link_section_id_1_7_id_test1_lin"> + <h3> + <a href="#section_id_1_7.id_test1">Link in title</a> + </h3> + <div id="section_id_1_7.link_section_id_1_7_id_test1_lin"> + </div> + </div> + <div id="section_id_1_7.link_section_id_1_7_id_test1_li0"> + <h3> + <a href="#section_id_1_7.id_test1">Link</a> in title + </h3> + <div id="section_id_1_7.link_section_id_1_7_id_test1_li0"> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/section-1_7.quickbook b/src/boost/tools/quickbook/test/section-1_7.quickbook new file mode 100644 index 000000000..9c8baeb0c --- /dev/null +++ b/src/boost/tools/quickbook/test/section-1_7.quickbook @@ -0,0 +1,23 @@ +[article Section Id 1.7 + [quickbook 1.7] +] + +[section Quickbook section no id test] +[endsect] +[section:id_test1 Quickbook section id test] +[endsect] +[section :id_test2 Quickbook section id test] +[endsect:id_test2] +[section: id_test3 Quickbook section id test] +[endsect] +[section:-- Quickbook section odd id test] +[endsect] + +[template thing[] abc] +[section:sect-[thing] Section with template in id] +[endsect] + +[section [link section_id_1_7.id_test1 Link in title]] +[endsect] +[section [link section_id_1_7.id_test1 Link] in title] +[endsect] diff --git a/src/boost/tools/quickbook/test/simple_markup-1_5.gold b/src/boost/tools/quickbook/test/simple_markup-1_5.gold new file mode 100644 index 000000000..4d044ceb4 --- /dev/null +++ b/src/boost/tools/quickbook/test/simple_markup-1_5.gold @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="simple_markup_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Simple Markup Test</title> + <section id="simple_markup_test.simple_markup"> + <title><link linkend="simple_markup_test.simple_markup">Simple Markup</link></title> + <para> + <emphasis>italic</emphasis> <emphasis role="bold">bold</emphasis> <emphasis + role="underline">underline</emphasis> <literal>teletype</literal> + </para> + <para> + //not italic// **not bold** __not underline__ ==not teletype== + </para> + <para> + <emphasis role="underline">odd__ edge case</emphasis> + </para> + <para> + not__underlined__hopefully + </para> + <para> + (<emphasis role="bold">bold</emphasis>) <emphasis role="underline">und/er/lined</emphasis> + </para> + <para> + <emphasis>all/italic</emphasis> * not bold* + </para> + <para> + /not italic <ulink url="http://www.boost.org/"><emphasis role="bold">bold</emphasis></ulink> + </para> + <para> + not_underlined_ + </para> + <para> + _Should not underline escaped markup_. _or this escaped_ markup form. + </para> + <para> + <literal>Matti Meik\u00E4l\u00E4inen</literal> + </para> + <para> + <literal>replaced</literal> + </para> + <para> + <emphasis role="underline">replaced</emphasis> + </para> + <para> + <literal>_mac\ ro_</literal> + </para> + <para> + <emphasis>italic\</emphasis> + </para> + <para> + These shouldn't be interepted as markup: == // ** + </para> + <para> + <literal><</literal> <literal>\<</literal> <literal>\\<</literal> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/simple_markup-1_5.gold-html b/src/boost/tools/quickbook/test/simple_markup-1_5.gold-html new file mode 100644 index 000000000..3e07c9b81 --- /dev/null +++ b/src/boost/tools/quickbook/test/simple_markup-1_5.gold-html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Simple Markup Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#simple_markup_test.simple_markup">Simple Markup</a> + </li> + </ul> + </div> + <div id="simple_markup_test.simple_markup"> + <h3> + Simple Markup + </h3> + <div id="simple_markup_test.simple_markup"> + <p> + <span class="emphasis"><em>italic</em></span> <span class="bold"><strong>bold</strong></span> + <span class="underline">underline</span> <tt>teletype</tt> + </p> + <p> + //not italic// **not bold** __not underline__ ==not teletype== + </p> + <p> + <span class="underline">odd__ edge case</span> + </p> + <p> + not__underlined__hopefully + </p> + <p> + (<span class="bold"><strong>bold</strong></span>) <span class="underline">und/er/lined</span> + </p> + <p> + <span class="emphasis"><em>all/italic</em></span> * not bold* + </p> + <p> + /not italic <a href="http://www.boost.org/"><span class="bold"><strong>bold</strong></span></a> + </p> + <p> + not_underlined_ + </p> + <p> + _Should not underline escaped markup_. _or this escaped_ markup form. + </p> + <p> + <tt>Matti Meik\u00E4l\u00E4inen</tt> + </p> + <p> + <tt>replaced</tt> + </p> + <p> + <span class="underline">replaced</span> + </p> + <p> + <tt>_mac\ ro_</tt> + </p> + <p> + <span class="emphasis"><em>italic\</em></span> + </p> + <p> + These shouldn't be interepted as markup: == // ** + </p> + <p> + <tt><</tt> <tt>\<</tt> <tt>\\<</tt> + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/simple_markup-1_5.quickbook b/src/boost/tools/quickbook/test/simple_markup-1_5.quickbook new file mode 100644 index 000000000..c8277fb32 --- /dev/null +++ b/src/boost/tools/quickbook/test/simple_markup-1_5.quickbook @@ -0,0 +1,42 @@ +[article Simple Markup Test +[quickbook 1.5] +] + +[def _macro_ replaced] + +[section Simple Markup] + +/italic/ *bold* _underline_ =teletype= + +//not italic// **not bold** __not underline__ ==not teletype== + +_odd__ edge case_ + +not__underlined__hopefully + +(*bold*) _und/er/lined_ + +/all/italic/ * not bold* + +/not italic [@http://www.boost.org/ *bold*] + +not_underlined_ + +_Should not underline '''escaped''' markup_. +_or this '''escaped_ markup''' form. + +=Matti Meik\u00E4l\u00E4inen= + +=_macro_= + +__macro__ + +=_mac\ ro_= + +/italic\/ + +These shouldn't be interepted as markup: == // ** + +=<= =\<= =\\<= + +[endsect] diff --git a/src/boost/tools/quickbook/test/snippets/Jamfile.v2 b/src/boost/tools/quickbook/test/snippets/Jamfile.v2 new file mode 100644 index 000000000..6765dff9e --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/Jamfile.v2 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test/snippets ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test pass_thru ] + [ quickbook-test unbalanced_snippet1-1_5 ] + [ quickbook-error-test unbalanced_snippet1-1_6-fail ] + [ quickbook-error-test unbalanced_snippet2-1_6-fail ] + ; diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.cpp b/src/boost/tools/quickbook/test/snippets/pass_thru.cpp new file mode 100644 index 000000000..c5c120a17 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.cpp @@ -0,0 +1,33 @@ +// clang-format off + +//[foo_cpp_copyright +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +//] + +//[foo_cpp +struct Foo{ + + Foo()//=; +//<- + : x( 10 ) + {} +//-> + +//<- + int x; +//-> +}; + +/*= +int main() +{ + Foo x; +} +*/ +//] diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.gold b/src/boost/tools/quickbook/test/snippets/pass_thru.gold new file mode 100644 index 000000000..dde5deb19 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.gold @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="pass_thru_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Pass thru test</title> + <para> +<programlisting><phrase role="comment">/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/</phrase> +</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">struct</phrase> <phrase role="identifier">Foo</phrase><phrase role="special">{</phrase> + + <phrase role="identifier">Foo</phrase><phrase role="special">();</phrase> + +<phrase role="special">};</phrase> + + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">Foo</phrase> <phrase role="identifier">x</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">:</phrase> + <phrase role="keyword">print</phrase><phrase role="special">(</phrase><phrase role="string">'foo'</phrase><phrase role="special">)</phrase> +</programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html b/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html new file mode 100644 index 000000000..ba0237ddb --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Pass thru test + </h3> + <p> +<pre class="programlisting"><span class="comment">/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/</span> +</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Foo</span><span class="special">{</span> + + <span class="identifier">Foo</span><span class="special">();</span> + +<span class="special">};</span> + + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">Foo</span> <span class="identifier">x</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">:</span> + <span class="keyword">print</span><span class="special">(</span><span class="string">'foo'</span><span class="special">)</span> +</pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.py b/src/boost/tools/quickbook/test/snippets/pass_thru.py new file mode 100644 index 000000000..412cee420 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.py @@ -0,0 +1,13 @@ +# Copyright (c) 2011 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +#[foo_py +def foo: + #=print('foo') + #<- + print('bar') + #-> +#]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook b/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook new file mode 100644 index 000000000..7e8319478 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook @@ -0,0 +1,12 @@ +[article Pass thru test +[quickbook 1.5] +] + +[import pass_thru.cpp] +[import pass_thru.py] + +[foo_cpp_copyright] + +[foo_cpp] + +[foo_py]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold new file mode 100644 index 000000000..1f9115c0f --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unbalanced_snippet_fail_test_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Unbalanced snippet fail test 1</title> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html new file mode 100644 index 000000000..af90d9d35 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Unbalanced snippet fail test 1 + </h3> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook new file mode 100644 index 000000000..7fdde6afd --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook @@ -0,0 +1,8 @@ +[article Unbalanced snippet fail test 1 +[quickbook 1.5] +] + +[import unbalanced_snippet1.cpp] +[import unbalanced_snippet2.cpp] + +[unclosed]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook new file mode 100644 index 000000000..c2fb98ec0 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook @@ -0,0 +1,7 @@ +[article Unbalanced snippet fail test 1 +[quickbook 1.6] +] + +[import unbalanced_snippet1.cpp] + +[unclosed]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp new file mode 100644 index 000000000..ee5983912 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp @@ -0,0 +1,11 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//[unclosed + +int main() {} diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook new file mode 100644 index 000000000..a06a16448 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook @@ -0,0 +1,5 @@ +[article Unbalanced snippet fail test 2 +[quickbook 1.6] +] + +[import unbalanced_snippet2.cpp] diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp new file mode 100644 index 000000000..b2fcb247b --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp @@ -0,0 +1,9 @@ +//] + +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ diff --git a/src/boost/tools/quickbook/test/source_mode-1_7.gold b/src/boost/tools/quickbook/test/source_mode-1_7.gold new file mode 100644 index 000000000..2cc454a6d --- /dev/null +++ b/src/boost/tools/quickbook/test/source_mode-1_7.gold @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="source_mode_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Source Mode Test</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row> + <entry> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </entry> + <entry> +<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> +<programlisting>Plain text...</programlisting> + <para> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code> but <code>plain + text</code>. + </para> + <itemizedlist> + <listitem> + <simpara> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code> + </simpara> + </listitem> + <listitem> + <simpara> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code> + </simpara> + </listitem> + <listitem> + <simpara> + <code>int main() {}</code> + </simpara> + </listitem> + </itemizedlist> + <para> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code> and <code><phrase + role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> + <phrase role="special">{}</phrase></code> should both be C++ highlighted. <code>int + main() {}</code> shouldn't be, but <code><phrase role="keyword">int</phrase> + <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase + role="special">{}</phrase></code> should. + </para> + <para> + <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase + role="special">()</phrase> <phrase role="special">{}</phrase></code>. Not highlighted: + <code>int main() {}</code>. + </para> + <section id="source_mode_test.cpp"> + <title><link linkend="source_mode_test.cpp">C++ section</link></title> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/source_mode-1_7.gold-html b/src/boost/tools/quickbook/test/source_mode-1_7.gold-html new file mode 100644 index 000000000..f5b16981c --- /dev/null +++ b/src/boost/tools/quickbook/test/source_mode-1_7.gold-html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Source Mode Test + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#source_mode_test.cpp">C++ section</a> + </li> + </ul> + </div> + <div class="informaltable"> + <table> + <tbody> + <tr> + <td> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </td> + <td> +<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span> <span class="special">{}</span></pre> + </td> + </tr> + </tbody> + </table> + </div> +<pre class="programlisting">Plain text...</pre> + <p> + <code><span class="keyword">int</span> <span class="identifier">main</span><span + class="special">()</span> <span class="special">{}</span></code> but <code>plain + text</code>. + </p> + <ul> + <li> + <div> + <code><span class="keyword">int</span> <span class="identifier">main</span><span + class="special">()</span> <span class="special">{}</span></code> + </div> + </li> + <li> + <div> + <code><span class="keyword">int</span> <span class="identifier">main</span><span + class="special">()</span> <span class="special">{}</span></code> + </div> + </li> + <li> + <div> + <code>int main() {}</code> + </div> + </li> + </ul> + <p> + <code><span class="keyword">int</span> <span class="identifier">main</span><span + class="special">()</span> <span class="special">{}</span></code> and <code><span + class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> + <span class="special">{}</span></code> should both be C++ highlighted. <code>int + main() {}</code> shouldn't be, but <code><span class="keyword">int</span> + <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></code> + should. + </p> + <p> + <code><span class="keyword">int</span> <span class="identifier">main</span><span + class="special">()</span> <span class="special">{}</span></code>. Not highlighted: + <code>int main() {}</code>. + </p> + <div id="source_mode_test.cpp"> + <h3> + C++ section + </h3> + <div id="source_mode_test.cpp"> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/source_mode-1_7.quickbook b/src/boost/tools/quickbook/test/source_mode-1_7.quickbook new file mode 100644 index 000000000..9388867c8 --- /dev/null +++ b/src/boost/tools/quickbook/test/source_mode-1_7.quickbook @@ -0,0 +1,24 @@ +[quickbook 1.7] +[source-mode teletype] +[article Source Mode Test] + +[!c++][table [[``int main() {}``][``void foo() {}``]]] +``Plain text...`` + +[!c++]`int main() {}` but `plain text`. + +[!c++] +* `int main() {}` +* `int main() {}` +* [teletype] `int main() {}` [/ shouldn't be highlighted] + +[!c++] +`int main() {}` and `int main() {}` should both be C++ highlighted. +[!teletype]`int main() {}` shouldn't be, but `int main() {}` should. + +[!c++] `int main() {}`. Not highlighted: `int main() {}`. + +[!c++] +[section:cpp C++ section] +``int main() {}`` +[endsect] diff --git a/src/boost/tools/quickbook/test/src/text_diff.cpp b/src/boost/tools/quickbook/test/src/text_diff.cpp new file mode 100644 index 000000000..cee521173 --- /dev/null +++ b/src/boost/tools/quickbook/test/src/text_diff.cpp @@ -0,0 +1,96 @@ +// +// Copyright (c) 2005 João Abecasis +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#include <cstring> +#include <fstream> +#include <iostream> +#include <iterator> +#include <vector> + +#include <boost/spirit/include/classic_primitives.hpp> +#include <boost/spirit/include/classic_scanner.hpp> + +namespace spirit = boost::spirit::classic; + +typedef std::istream_iterator<char, char> iterator; +typedef spirit::scanner<iterator> scanner; + +int main(int argc, char* argv[]) +{ + std::vector<char*> args; + bool usage_error = false; + + for (int i = 1; i < argc; ++i) { + if (std::strncmp(argv[i], "--", 2) == 0) { + if (strcmp(argv[i], "--strict") == 0) { + // Ignore --strict because the build file accidentally + // uses it. Why yes, this is a horrible hack. + } + else { + std::cerr << "ERROR: Invalid flag: " << argv[i] << std::endl; + usage_error = true; + } + } + else { + args.push_back(argv[i]); + } + } + + if (!usage_error && args.size() != 2) { + std::cerr << "ERROR: Wrong number of arguments." << std::endl; + usage_error = true; + } + + if (usage_error) { + std::cout << "Usage:\n\t" << argv[0] << " file1 file2" << std::endl; + return 1; + } + + std::ifstream file1(args[0], std::ios_base::binary | std::ios_base::in), + file2(args[1], std::ios_base::binary | std::ios_base::in); + + if (!file1 || !file2) { + std::cerr << "ERROR: Unable to open one or both files." << std::endl; + return 2; + } + + file1.unsetf(std::ios_base::skipws); + file2.unsetf(std::ios_base::skipws); + + iterator iter_file1(file1), iter_file2(file2); + + scanner scan1(iter_file1, iterator()), scan2(iter_file2, iterator()); + + std::size_t line = 1, column = 1; + + while (!scan1.at_end() && !scan2.at_end()) { + if (spirit::eol_p.parse(scan1)) { + if (!spirit::eol_p.parse(scan2)) { + std::cout << "Files differ at line " << line << ", column " + << column << '.' << std::endl; + return 3; + } + + ++line, column = 1; + continue; + } + + if (*scan1 != *scan2) { + std::cout << "Files differ at line " << line << ", column " + << column << '.' << std::endl; + return 4; + } + + ++scan1, ++scan2, ++column; + } + + if (scan1.at_end() != scan2.at_end()) { + std::cout << "Files differ in length." << std::endl; + return 5; + } +} diff --git a/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold new file mode 100644 index 000000000..c062eaab8 --- /dev/null +++ b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="stray_close_bracket_1_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Stray close bracket 1.1</title> + <para> + X]Y + </para> +</article> diff --git a/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold-html b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold-html new file mode 100644 index 000000000..094ac4655 --- /dev/null +++ b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.gold-html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Stray close bracket 1.1 + </h3> + <p> + X]Y + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/stray_close_bracket-1_1.quickbook b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.quickbook new file mode 100644 index 000000000..3866bdb7c --- /dev/null +++ b/src/boost/tools/quickbook/test/stray_close_bracket-1_1.quickbook @@ -0,0 +1,3 @@ +[article Stray close bracket 1.1] + +X]Y diff --git a/src/boost/tools/quickbook/test/stray_close_bracket-1_7-fail.quickbook b/src/boost/tools/quickbook/test/stray_close_bracket-1_7-fail.quickbook new file mode 100644 index 000000000..6798b679c --- /dev/null +++ b/src/boost/tools/quickbook/test/stray_close_bracket-1_7-fail.quickbook @@ -0,0 +1,5 @@ +[article Stray close bracket 1.1 + [quickbook 1.7] +] + +X]Y diff --git a/src/boost/tools/quickbook/test/stub.c b/src/boost/tools/quickbook/test/stub.c new file mode 100644 index 000000000..f7f83cfe8 --- /dev/null +++ b/src/boost/tools/quickbook/test/stub.c @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +/*` +This should appear when =stub.c= is included. + +[foo_c] +*/ + +/*[foo_c */ + /*` + This is the C [*['foo]] function. + + This description can have paragraphs... + + * lists + * etc. + + And any quickbook block markup. + */ +char* foo() +{ + // return 'em, foo man! + return "foo"; +} +/*]*/ diff --git a/src/boost/tools/quickbook/test/stub.cpp b/src/boost/tools/quickbook/test/stub.cpp new file mode 100644 index 000000000..ef0f03432 --- /dev/null +++ b/src/boost/tools/quickbook/test/stub.cpp @@ -0,0 +1,86 @@ +/*============================================================================= + Copyright (c) 2006 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// clang-format off + +/*` This should appear when =stub.cpp= is included. */ + +#include <string> + +//[ bar +//` This is the [*/bar/] function +std::string bar() +{ + // return 'em, bar man! + return "bar"; +} +/*` +Some trailing text here +*/ +//] + +//[ foo + /*` + This is the [*['foo]] function. + + This description can have paragraphs... + + * lists + * etc. + + And any quickbook block markup. + */ +std::string foo() +{ + // return 'em, foo man! + return "foo"; +} +//] + +//[ foo_bar +std::string foo_bar() /*< The /Mythical/ FooBar. + See [@http://en.wikipedia.org/wiki/Foobar Foobar for details] >*/ +{ + return "foo-bar"; /*< return 'em, foo-bar man! >*/ +} +//] + +//[ class_ +class x +{ +public: + + /*<< Constructor >>*/ + x() : n(0) + { + } + + /*<< Destructor >>*/ + ~x() + { + } + + /*<< Get the `n` member variable >>*/ + int get() const + { + return n; /*<- this will be ignored by quickbook ->*/ + } + + /*<< Set the `n` member variable >>*/ + void set(int n_) + { + n = n_; + } +//<- this will be ignored by quickbook +private: + + int n; +//-> +}; +//] diff --git a/src/boost/tools/quickbook/test/stub.py b/src/boost/tools/quickbook/test/stub.py new file mode 100644 index 000000000..48ba87e0c --- /dev/null +++ b/src/boost/tools/quickbook/test/stub.py @@ -0,0 +1,27 @@ +# Copyright 2009 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +#` This should appear when =stub.py= is included. + +#[foo_py +"""` + This is the Python [*['foo]] function. + + This description can have paragraphs... + + * lists + * etc. + + And any quickbook block markup. +""" + +def foo(): + # return 'em, foo man! + return "foo" + +#] + +print foo()
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/svg-1_1.gold b/src/boost/tools/quickbook/test/svg-1_1.gold new file mode 100644 index 000000000..a8a49b06a --- /dev/null +++ b/src/boost/tools/quickbook/test/svg-1_1.gold @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="svg_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>SVG test</title> + <para> + <inlinemediaobject><imageobject><imagedata contentdepth="513.25690" contentwidth="745.60706" + fileref="images/open_clipart_library_logo.svg" format="SVG"></imagedata></imageobject> + <textobject> + <phrase>open_clipart_library_logo</phrase> + </textobject> + </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="images/missing_image.svg" + format="SVG"></imagedata></imageobject> + <textobject> + <phrase>missing_image</phrase> + </textobject> + </inlinemediaobject> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/svg-1_1.gold-html b/src/boost/tools/quickbook/test/svg-1_1.gold-html new file mode 100644 index 000000000..643e7762a --- /dev/null +++ b/src/boost/tools/quickbook/test/svg-1_1.gold-html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + SVG test + </h3> + <p> + <span class="inlinemediaobject"><img src="images/open_clipart_library_logo.svg" + alt="[]"/></span> <span class="inlinemediaobject"><img src="images/missing_image.svg" + alt="[]"/></span> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/svg-1_1.quickbook b/src/boost/tools/quickbook/test/svg-1_1.quickbook new file mode 100644 index 000000000..71b811a8c --- /dev/null +++ b/src/boost/tools/quickbook/test/svg-1_1.quickbook @@ -0,0 +1,4 @@ +[article SVG test] + +[$images/open_clipart_library_logo.svg] +[$images/missing_image.svg] diff --git a/src/boost/tools/quickbook/test/table-1_3.gold b/src/boost/tools/quickbook/test/table-1_3.gold new file mode 100644 index 000000000..fcda21570 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_3.gold @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="table_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Table 1.3</title> + <table frame="all" id="table_tests.t0"> + <title>Table 2</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests.t1"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.t2"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.t3"> + <title>Title [/ ] containing a comment</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.t4"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.t5"> + <title>[[Title]]</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <section id="table_tests.section1"> + <title><link linkend="table_tests.section1">Section 1</link></title> + <table frame="all" id="table_tests.section1.t0"> + <title>A & B</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + A + </para> + </entry> + <entry> + <para> + B + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + a + </para> + </entry> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.t1"> + <title>Empty Table</title> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.t2"> + <title>Table with an empty cell</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + <para> + x + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.t3"> + <title>Indentation</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Header 1. Paragraph 1 + </para> + <para> + Header 1. Paragraph 2 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Row 1. Cell 1. + </para> + </entry> + <entry> + <para> + Row 1. Cell 2. + </para> + <para> + Row 1. Cell 2. Paragraph 2. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.t4"> + <title>Nested Tables</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Header 1 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <table frame="all" id="table_tests.section1.t5"> + <title>Inner Table</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + 1.1 + </para> + </entry> + <entry> + <para> + 1.2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + 2.1 + </para> + </entry> + <entry> + <para> + 2.2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </entry> + </row> + <row> + <entry> + <para> + Something. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <anchor id="id1"/> + <table frame="all" id="table_tests.section1.t6"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + <anchor id="id2"/>a<anchor id="id3"/> + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/table-1_3.gold-html b/src/boost/tools/quickbook/test/table-1_3.gold-html new file mode 100644 index 000000000..99a126a92 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_3.gold-html @@ -0,0 +1,368 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Table 1.3 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#table_tests.section1">Section 1</a> + </li> + </ul> + </div> + <div id="table_tests.t0" class="table"> + <table> + <caption>Table 2</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.t1" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.t2" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.t3" class="table"> + <table> + <caption>Title [/ ] containing a comment</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.t4" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.t5" class="table"> + <table> + <caption>[[Title]]</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1"> + <h3> + Section 1 + </h3> + <div id="table_tests.section1"> + <div id="table_tests.section1.t0" class="table"> + <table> + <caption>A & B</caption> + <thead> + <tr> + <th> + <p> + A + </p> + </th> + <th> + <p> + B + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + a + </p> + </td> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.t1" class="table"> + <table> + <caption>Empty Table</caption> + <tbody> + </tbody> + </table> + </div> + <div id="table_tests.section1.t2" class="table"> + <table> + <caption>Table with an empty cell</caption> + <tbody> + <tr> + <td> + <p> + x + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.t3" class="table"> + <table> + <caption>Indentation</caption> + <thead> + <tr> + <th> + <p> + Header 1. Paragraph 1 + </p> + <p> + Header 1. Paragraph 2 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Row 1. Cell 1. + </p> + </td> + <td> + <p> + Row 1. Cell 2. + </p> + <p> + Row 1. Cell 2. Paragraph 2. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.t4" class="table"> + <table> + <caption>Nested Tables</caption> + <thead> + <tr> + <th> + <p> + Header 1 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <div id="table_tests.section1.t5" class="table"> + <table> + <caption>Inner Table</caption> + <thead> + <tr> + <th> + <p> + 1.1 + </p> + </th> + <th> + <p> + 1.2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + 2.1 + </p> + </td> + <td> + <p> + 2.2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + </td> + </tr> + <tr> + <td> + <p> + Something. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <span id="id1"></span> + <div id="table_tests.section1.t6" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + <span id="id2"></span>a<span id="id3"></span> + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/table-1_3.quickbook b/src/boost/tools/quickbook/test/table-1_3.quickbook new file mode 100644 index 000000000..1dc048911 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_3.quickbook @@ -0,0 +1,113 @@ +[article Table 1.3 + [quickbook 1.3] + [id table_tests] +] + +[table Table 2 + [[Heading]] + [[cell]] +] + +[table + [[Heading]] + [[cell]] +] + +[table [/ Comment?] Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] Title + [[Heading]] + [[cell]] +] + +[table Title [/ ] containing a comment + [[Heading]] + [[cell]] +] + +[/ These two might be considered to be a bug. ] + +[table [/ Multi line +comment] + Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + [[Title]] + [[Heading]] + [[cell]] +] + +[section:section1 Section 1] + +[table A & B + [[A][B]] + [[a][b]] +] + +[table Empty Table +] + +[table Table with an empty cell +[[x]]] + +[table Indentation + [ + [ + Header 1. Paragraph 1 + + Header 1. Paragraph 2 + ] + [ + Header 2 + ] + ] + [ + [ + Row 1. Cell 1. + ] + [ + Row 1. Cell 2. + + Row 1. Cell 2. Paragraph 2. + ] + ] +] + +[table Nested Tables + [ + [ + Header 1 + ] + [ + Header 2 + ] + ] + [ + [ + [table Inner Table + [[1.1][1.2]] + [[2.1][2.2]] + ] + ] + ] + [ + [ + Something. + ] + ] +] + +[#id1] +[table Table with anchors +[[[#id2]a[#id3]]][[b]] +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/table-1_5.gold b/src/boost/tools/quickbook/test/table-1_5.gold new file mode 100644 index 000000000..838a400fa --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_5.gold @@ -0,0 +1,442 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="table_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Table 1.5</title> + <table frame="all" id="table_tests.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.table_2"> + <title>Table 2</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="table_tests.table4"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests._table5_"> + <title>-table5-</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title0"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title_______containing_a_comment"> + <title>Title [/ ] containing a comment</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title1"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.__title__"> + <title>[[Title]]</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <section id="table_tests.section1"> + <title><link linkend="table_tests.section1">Section 1</link></title> + <table frame="all" id="table_tests.section1.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.a___b"> + <title>A & B</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + A + </para> + </entry> + <entry> + <para> + B + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + a + </para> + </entry> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.empty_table"> + <title>Empty Table</title> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.table_with_an_empty_cell"> + <title>Table with an empty cell</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + <para> + x + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.indentation"> + <title>Indentation</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Header 1. Paragraph 1 + </para> + <para> + Header 1. Paragraph 2 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Row 1. Cell 1. + </para> + </entry> + <entry> + <para> + Row 1. Cell 2. + </para> + <para> + Row 1. Cell 2. Paragraph 2. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.nested_tables"> + <title>Nested Tables</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Header 1 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <table frame="all" id="table_tests.section1.inner_table"> + <title>Inner Table</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + 1.1 + </para> + </entry> + <entry> + <para> + 1.2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + 2.1 + </para> + </entry> + <entry> + <para> + 2.2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </entry> + </row> + <row> + <entry> + <para> + Something. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <anchor id="id1"/> + <table frame="all" id="table_tests.section1.table_with_anchors"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + <anchor id="id2"/>a<anchor id="id3"/> + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/table-1_5.gold-html b/src/boost/tools/quickbook/test/table-1_5.gold-html new file mode 100644 index 000000000..49c999883 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_5.gold-html @@ -0,0 +1,459 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Table 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#table_tests.section1">Section 1</a> + </li> + </ul> + </div> + <div id="table_tests.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table_2" class="table"> + <table> + <caption>Table 2</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table4" class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests._table5_" class="table"> + <table> + <caption>-table5-</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title0" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title_______containing_a_comment" class="table"> + <table> + <caption>Title [/ ] containing a comment</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title1" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.__title__" class="table"> + <table> + <caption>[[Title]]</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1"> + <h3> + Section 1 + </h3> + <div id="table_tests.section1"> + <div id="table_tests.section1.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.a___b" class="table"> + <table> + <caption>A & B</caption> + <thead> + <tr> + <th> + <p> + A + </p> + </th> + <th> + <p> + B + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + a + </p> + </td> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.empty_table" class="table"> + <table> + <caption>Empty Table</caption> + <tbody> + </tbody> + </table> + </div> + <div id="table_tests.section1.table_with_an_empty_cell" class="table"> + <table> + <caption>Table with an empty cell</caption> + <tbody> + <tr> + <td> + <p> + x + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.indentation" class="table"> + <table> + <caption>Indentation</caption> + <thead> + <tr> + <th> + <p> + Header 1. Paragraph 1 + </p> + <p> + Header 1. Paragraph 2 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Row 1. Cell 1. + </p> + </td> + <td> + <p> + Row 1. Cell 2. + </p> + <p> + Row 1. Cell 2. Paragraph 2. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.nested_tables" class="table"> + <table> + <caption>Nested Tables</caption> + <thead> + <tr> + <th> + <p> + Header 1 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <div id="table_tests.section1.inner_table" class="table"> + <table> + <caption>Inner Table</caption> + <thead> + <tr> + <th> + <p> + 1.1 + </p> + </th> + <th> + <p> + 1.2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + 2.1 + </p> + </td> + <td> + <p> + 2.2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + </td> + </tr> + <tr> + <td> + <p> + Something. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <span id="id1"></span> + <div id="table_tests.section1.table_with_anchors" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + <span id="id2"></span>a<span id="id3"></span> + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/table-1_5.quickbook b/src/boost/tools/quickbook/test/table-1_5.quickbook new file mode 100644 index 000000000..7ab15b1ac --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_5.quickbook @@ -0,0 +1,133 @@ +[article Table 1.5 + [quickbook 1.5] + [id table_tests] +] + +[table:table1 Table 1 + [[Heading]] + [[cell]] +] + +[table Table 2 + [[Heading]] + [[cell]] +] + +[table + [[Heading]] + [[cell]] +] + +[table:table4 + [[Heading]] + [[cell]] +] + +[table:-table5- + [[Heading]] + [[cell]] +] + +[table [/ Comment?] Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] Title + [[Heading]] + [[cell]] +] + +[table Title [/ ] containing a comment + [[Heading]] + [[cell]] +] + +[/ These two might be considered to be a bug. ] + +[table [/ Multi line +comment] + Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + [[Title]] + [[Heading]] + [[cell]] +] + +[section:section1 Section 1] + +[table:table1 Table 1 + [[Heading]] + [[cell]] +] + +[table A & B + [[A][B]] + [[a][b]] +] + +[table Empty Table +] + +[table Table with an empty cell +[[x]]] + +[table Indentation + [ + [ + Header 1. Paragraph 1 + + Header 1. Paragraph 2 + ] + [ + Header 2 + ] + ] + [ + [ + Row 1. Cell 1. + ] + [ + Row 1. Cell 2. + + Row 1. Cell 2. Paragraph 2. + ] + ] +] + +[table Nested Tables + [ + [ + Header 1 + ] + [ + Header 2 + ] + ] + [ + [ + [table Inner Table + [[1.1][1.2]] + [[2.1][2.2]] + ] + ] + ] + [ + [ + Something. + ] + ] +] + +[#id1] +[table Table with anchors +[[[#id2]a[#id3]]][[b]] +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/table-1_6.gold b/src/boost/tools/quickbook/test/table-1_6.gold new file mode 100644 index 000000000..3abe6b0d2 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_6.gold @@ -0,0 +1,478 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="table_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Table 1.6</title> + <table frame="all" id="table_tests.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.table_2"> + <title>Table 2</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="table_tests.table4"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests.table5"> + <title>-table5-</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title0"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title_containing_a_comment"> + <title>Title containing a comment</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title1"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests.title_on_multiple_lines_with_bol"> + <title>Title on multiple lines with <emphasis role="bold">bold</emphasis> text?</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <section id="table_tests.section1"> + <title><link linkend="table_tests.section1">Section 1</link></title> + <table frame="all" id="table_tests.section1.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.a_b"> + <title>A & B</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + A + </para> + </entry> + <entry> + <para> + B + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + a + </para> + </entry> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.empty_table"> + <title>Empty Table</title> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.table_with_an_empty_cell"> + <title>Table with an empty cell</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + <para> + x + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.indentation"> + <title>Indentation</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Header 1. Paragraph 1 + </para> + <para> + Header 1. Paragraph 2 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Row 1. Cell 1. + </para> + </entry> + <entry> + <para> + Row 1. Cell 2. + </para> + <para> + Row 1. Cell 2. Paragraph 2. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.nested_tables"> + <title>Nested Tables</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Header 1 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <table frame="all" id="table_tests.section1.inner_table"> + <title>Inner Table</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + 1.1 + </para> + </entry> + <entry> + <para> + 1.2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + 2.1 + </para> + </entry> + <entry> + <para> + 2.2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </entry> + </row> + <row> + <entry> + <para> + Something. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <anchor id="id1"/> + <table frame="all" id="table_tests.section1.table_with_anchors"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + <anchor id="id2"/>a<anchor id="id3"/> + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/table-1_6.gold-html b/src/boost/tools/quickbook/test/table-1_6.gold-html new file mode 100644 index 000000000..83690c32e --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_6.gold-html @@ -0,0 +1,496 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Table 1.6 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#table_tests.section1">Section 1</a> + </li> + </ul> + </div> + <div id="table_tests.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table_2" class="table"> + <table> + <caption>Table 2</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table4" class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table5" class="table"> + <table> + <caption>-table5-</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title0" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title_containing_a_comment" class="table"> + <table> + <caption>Title containing a comment</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title1" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title_on_multiple_lines_with_bol" class="table"> + <table> + <caption>Title on multiple lines with <span class="bold"><strong>bold</strong></span> + text?</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1"> + <h3> + Section 1 + </h3> + <div id="table_tests.section1"> + <div id="table_tests.section1.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.a_b" class="table"> + <table> + <caption>A & B</caption> + <thead> + <tr> + <th> + <p> + A + </p> + </th> + <th> + <p> + B + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + a + </p> + </td> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.empty_table" class="table"> + <table> + <caption>Empty Table</caption> + <tbody> + </tbody> + </table> + </div> + <div id="table_tests.section1.table_with_an_empty_cell" class="table"> + <table> + <caption>Table with an empty cell</caption> + <tbody> + <tr> + <td> + <p> + x + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.indentation" class="table"> + <table> + <caption>Indentation</caption> + <thead> + <tr> + <th> + <p> + Header 1. Paragraph 1 + </p> + <p> + Header 1. Paragraph 2 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Row 1. Cell 1. + </p> + </td> + <td> + <p> + Row 1. Cell 2. + </p> + <p> + Row 1. Cell 2. Paragraph 2. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.nested_tables" class="table"> + <table> + <caption>Nested Tables</caption> + <thead> + <tr> + <th> + <p> + Header 1 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <div id="table_tests.section1.inner_table" class="table"> + <table> + <caption>Inner Table</caption> + <thead> + <tr> + <th> + <p> + 1.1 + </p> + </th> + <th> + <p> + 1.2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + 2.1 + </p> + </td> + <td> + <p> + 2.2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + </td> + </tr> + <tr> + <td> + <p> + Something. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <span id="id1"></span> + <div id="table_tests.section1.table_with_anchors" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + <span id="id2"></span>a<span id="id3"></span> + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/table-1_6.quickbook b/src/boost/tools/quickbook/test/table-1_6.quickbook new file mode 100644 index 000000000..332e07060 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_6.quickbook @@ -0,0 +1,134 @@ +[article Table 1.6 + [quickbook 1.6] + [id table_tests] +] + +[table:table1 Table 1 [[Heading]][[cell]]] + +[table Table 2 + [[Heading]] + [[cell]] +] + +[table + [[Heading]] + [[cell]] +] + +[table:table4 + [[Heading]] + [[cell]] +] + +[table:-table5- + [[Heading]] + [[cell]] +] + +[table [/ Comment?] Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] Title + [[Heading]] + [[cell]] +] + +[table Title [/ ] containing a comment + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + [[Heading]] + [[Cell 1]] + [[Cell 2]] +] + +[table Title on multiple + lines with *bold* text? + [[Heading]] + [[Cell 1]] + [[Cell 2]] +] + +[section:section1 Section 1] + +[table:table1 Table 1 + [[Heading]] + [[cell]] +] + +[table A & B + [[A][B]] + [[a][b]] +] + +[table Empty Table] + +[table Table with an empty cell +[[x]]] + +[table Indentation + [ + [ + Header 1. Paragraph 1 + + Header 1. Paragraph 2 + ] + [ + Header 2 + ] + ] + [ + [ + Row 1. Cell 1. + ] + [ + Row 1. Cell 2. + + Row 1. Cell 2. Paragraph 2. + ] + ] +] + +[table Nested Tables + [ + [ + Header 1 + ] + [ + Header 2 + ] + ] + [ + [ + [table Inner Table + [[1.1][1.2]] + [[2.1][2.2]] + ] + ] + ] + [ + [ + Something. + ] + ] +] + +[#id1] +[table Table with anchors +[[[#id2]a[#id3]]][[b]] +] + +[endsect] diff --git a/src/boost/tools/quickbook/test/table-1_7.gold b/src/boost/tools/quickbook/test/table-1_7.gold new file mode 100644 index 000000000..6b8eafabf --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_7.gold @@ -0,0 +1,520 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="table_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Table 1.7</title> + <table frame="all" id="table_tests.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.table_2"> + <title>Table 2</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="table_tests.table4"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all" id="table_tests.-table5-"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests.title"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title0"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title_containing_a_comment"> + <title>Title containing a comment</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.title1"> + <title>Title</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <informaltable frame="all"> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <table frame="all" id="table_tests.title_on_multiple_lines_with_bol"> + <title>Title on multiple lines with <emphasis role="bold">bold</emphasis> text?</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Cell 1 + </para> + </entry> + </row> + <row> + <entry> + <para> + Cell 2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <section id="table_tests.section1"> + <title><link linkend="table_tests.section1">Section 1</link></title> + <table frame="all" id="table_tests.section1.table1"> + <title>Table 1</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Heading + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + cell + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.a_b"> + <title>A & B</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + A + </para> + </entry> + <entry> + <para> + B + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + a + </para> + </entry> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.empty_table"> + <title>Empty Table</title> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.table_with_an_empty_cell"> + <title>Table with an empty cell</title> + <tgroup cols="1"> + <tbody> + <row> + <entry> + <para> + x + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.indentation"> + <title>Indentation</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + Header 1. Paragraph 1 + </para> + <para> + Header 1. Paragraph 2 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + Row 1. Cell 1. + </para> + </entry> + <entry> + <para> + Row 1. Cell 2. + </para> + <para> + Row 1. Cell 2. Paragraph 2. + </para> + </entry> + </row> + <row> + <entry> + <para> + Row 2. Cell 1. + </para> + <itemizedlist> + <listitem> + <simpara> + Row 2. Cell 1. List item 1. + </simpara> + </listitem> + <listitem> + <simpara> + Row 2. Cell 1. List item 2. + </simpara> + </listitem> + </itemizedlist> + </entry> + <entry> + <para> + Row 2. Cell 2. + </para> + <itemizedlist> + <listitem> + <simpara> + Row 2. Cell 2. List item 1. + </simpara> + </listitem> + <listitem> + <simpara> + Row 2. Cell 2. List item 2. + </simpara> + </listitem> + </itemizedlist> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.nested_tables"> + <title>Nested Tables</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + Header 1 + </para> + </entry> + <entry> + <para> + Header 2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <table frame="all" id="table_tests.section1.inner_table"> + <title>Inner Table</title> + <tgroup cols="2"> + <thead> + <row> + <entry> + <para> + 1.1 + </para> + </entry> + <entry> + <para> + 1.2 + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + 2.1 + </para> + </entry> + <entry> + <para> + 2.2 + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + </entry> + </row> + <row> + <entry> + <para> + Something. + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <anchor id="id1"/> + <table frame="all" id="table_tests.section1.table_with_anchors"> + <title>Table with anchors</title> + <tgroup cols="1"> + <thead> + <row> + <entry> + <para> + <anchor id="id2"/>a<anchor id="id3"/> + </para> + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + <para> + b + </para> + </entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="all" id="table_tests.section1.id123"> + <title>Table with template id</title> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </table> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/table-1_7.gold-html b/src/boost/tools/quickbook/test/table-1_7.gold-html new file mode 100644 index 000000000..90dc27274 --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_7.gold-html @@ -0,0 +1,538 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Table 1.7 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#table_tests.section1">Section 1</a> + </li> + </ul> + </div> + <div id="table_tests.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table_2" class="table"> + <table> + <caption>Table 2</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.table4" class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.-table5-" class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title0" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title_containing_a_comment" class="table"> + <table> + <caption>Title containing a comment</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title1" class="table"> + <table> + <caption>Title</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.title_on_multiple_lines_with_bol" class="table"> + <table> + <caption>Title on multiple lines with <span class="bold"><strong>bold</strong></span> + text?</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Cell 1 + </p> + </td> + </tr> + <tr> + <td> + <p> + Cell 2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1"> + <h3> + Section 1 + </h3> + <div id="table_tests.section1"> + <div id="table_tests.section1.table1" class="table"> + <table> + <caption>Table 1</caption> + <thead> + <tr> + <th> + <p> + Heading + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + cell + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.a_b" class="table"> + <table> + <caption>A & B</caption> + <thead> + <tr> + <th> + <p> + A + </p> + </th> + <th> + <p> + B + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + a + </p> + </td> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.empty_table" class="table"> + <table> + <caption>Empty Table</caption> + <tbody> + </tbody> + </table> + </div> + <div id="table_tests.section1.table_with_an_empty_cell" class="table"> + <table> + <caption>Table with an empty cell</caption> + <tbody> + <tr> + <td> + <p> + x + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.indentation" class="table"> + <table> + <caption>Indentation</caption> + <thead> + <tr> + <th> + <p> + Header 1. Paragraph 1 + </p> + <p> + Header 1. Paragraph 2 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + Row 1. Cell 1. + </p> + </td> + <td> + <p> + Row 1. Cell 2. + </p> + <p> + Row 1. Cell 2. Paragraph 2. + </p> + </td> + </tr> + <tr> + <td> + <p> + Row 2. Cell 1. + </p> + <ul> + <li> + <div> + Row 2. Cell 1. List item 1. + </div> + </li> + <li> + <div> + Row 2. Cell 1. List item 2. + </div> + </li> + </ul> + </td> + <td> + <p> + Row 2. Cell 2. + </p> + <ul> + <li> + <div> + Row 2. Cell 2. List item 1. + </div> + </li> + <li> + <div> + Row 2. Cell 2. List item 2. + </div> + </li> + </ul> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.nested_tables" class="table"> + <table> + <caption>Nested Tables</caption> + <thead> + <tr> + <th> + <p> + Header 1 + </p> + </th> + <th> + <p> + Header 2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <div id="table_tests.section1.inner_table" class="table"> + <table> + <caption>Inner Table</caption> + <thead> + <tr> + <th> + <p> + 1.1 + </p> + </th> + <th> + <p> + 1.2 + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + 2.1 + </p> + </td> + <td> + <p> + 2.2 + </p> + </td> + </tr> + </tbody> + </table> + </div> + </td> + </tr> + <tr> + <td> + <p> + Something. + </p> + </td> + </tr> + </tbody> + </table> + </div> + <span id="id1"></span> + <div id="table_tests.section1.table_with_anchors" class="table"> + <table> + <caption>Table with anchors</caption> + <thead> + <tr> + <th> + <p> + <span id="id2"></span>a<span id="id3"></span> + </p> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <p> + b + </p> + </td> + </tr> + </tbody> + </table> + </div> + <div id="table_tests.section1.id123" class="table"> + <table> + <caption>Table with template id</caption> + <tbody> + </tbody> + </table> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/table-1_7.quickbook b/src/boost/tools/quickbook/test/table-1_7.quickbook new file mode 100644 index 000000000..84d68f71d --- /dev/null +++ b/src/boost/tools/quickbook/test/table-1_7.quickbook @@ -0,0 +1,151 @@ +[article Table 1.7 + [quickbook 1.7] + [id table_tests] +] + +[table:table1 Table 1 [[Heading]][[cell]]] + +[table Table 2 + [[Heading]] + [[cell]] +] + +[table + [[Heading]] + [[cell]] +] + +[table:table4 + [[Heading]] + [[cell]] +] + +[table:-table5- + [[Heading]] + [[cell]] +] + +[table [/ Comment?] Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] Title + [[Heading]] + [[cell]] +] + +[table Title [/ ] containing a comment + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + Title + [[Heading]] + [[cell]] +] + +[table [/ Multi line +comment] + [[Heading]] + [[Cell 1]] + [[Cell 2]] +] + +[table Title on multiple + lines with *bold* text? + [[Heading]] + [[Cell 1]] + [[Cell 2]] +] + +[section:section1 Section 1] + +[table:table1 Table 1 + [[Heading]] + [[cell]] +] + +[table A & B + [[A][B]] + [[a][b]] +] + +[table Empty Table] + +[table Table with an empty cell +[[x]]] + +[table Indentation + [ + [ + Header 1. Paragraph 1 + + Header 1. Paragraph 2 + ] + [ + Header 2 + ] + ] + [ + [ + Row 1. Cell 1. + ] + [ + Row 1. Cell 2. + + Row 1. Cell 2. Paragraph 2. + ] + ] + [ + [ +Row 2. Cell 1. + +* Row 2. Cell 1. List item 1. +* Row 2. Cell 1. List item 2. + ] + [ + Row 2. Cell 2. + + * Row 2. Cell 2. List item 1. + * Row 2. Cell 2. List item 2. + ] + ] +] + +[table Nested Tables + [ + [ + Header 1 + ] + [ + Header 2 + ] + ] + [ + [ + [table Inner Table + [[1.1][1.2]] + [[2.1][2.2]] + ] + ] + ] + [ + [ + Something. + ] + ] +] + +[#id1] +[table Table with anchors +[[[#id2]a[#id3]]][[b]] +] + +[template id_value[] id123] +[table:[id_value] Table with template id] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_arguments1-1_1-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments1-1_1-fail.quickbook new file mode 100644 index 000000000..d2622373d --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments1-1_1-fail.quickbook @@ -0,0 +1,10 @@ +[article Expect template to fail because there are too many arguments. +] + +[template unary[x] [x]] + +[section Failure] + +[unary a..b ] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_arguments1-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments1-1_5-fail.quickbook new file mode 100644 index 000000000..335306a27 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments1-1_5-fail.quickbook @@ -0,0 +1,11 @@ +[article Expect template to fail because there are too many arguments. + [quickbook 1.5] +] + +[template unary[x] [x]] + +[section Failure] + +[unary a..b ] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_arguments2-1_1-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments2-1_1-fail.quickbook new file mode 100644 index 000000000..4f8133708 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments2-1_1-fail.quickbook @@ -0,0 +1,10 @@ +[article Expect template to fail because there are not enough arguments. +] + +[template ternary[x y z] [x][y][z]] + +[section Failure] + +[ternary a b ] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_arguments2-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments2-1_5-fail.quickbook new file mode 100644 index 000000000..1c45e09c7 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments2-1_5-fail.quickbook @@ -0,0 +1,6 @@ +[article Expect template to fail because there are not enough arguments on 1.5. + [quickbook 1.5] +] + +[template ternary[x y z] {[x]-[y]-[z]}] +[ternary 1..2 3 4]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/template_arguments3-1_1-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments3-1_1-fail.quickbook new file mode 100644 index 000000000..83b2daa90 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments3-1_1-fail.quickbook @@ -0,0 +1,10 @@ +[article Expect template to fail because there are no arguments. +] + +[template ternary[x y z] [x][y][z]] + +[section Failure] + +[ternary] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_arguments3-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_arguments3-1_5-fail.quickbook new file mode 100644 index 000000000..cd6618241 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_arguments3-1_5-fail.quickbook @@ -0,0 +1,11 @@ +[article Expect template to fail because there are no arguments. + [quickbook 1.5] +] + +[template ternary[x y z] [x][y][z]] + +[section Failure] + +[ternary] + +[endsect] diff --git a/src/boost/tools/quickbook/test/template_section-1_5.gold b/src/boost/tools/quickbook/test/template_section-1_5.gold new file mode 100644 index 000000000..af270acb1 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section-1_5.gold @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="section_in_a_template" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Section in a template</title> + <para> + Some text before the section. + </para> + <section id="section_in_a_template.test"> + <title><link linkend="section_in_a_template.test">Test</link></title> + <para> + Hello. + </para> + <bridgehead renderas="sect3" id="section_in_a_template.test.h0"> + <phrase id="section_in_a_template.test.just_to_test_id_generation"/><link linkend="section_in_a_template.test.just_to_test_id_generation">Just + to test id generation</link> + </bridgehead> + <para> + Goodbye. + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/template_section-1_5.gold-html b/src/boost/tools/quickbook/test/template_section-1_5.gold-html new file mode 100644 index 000000000..a21f78004 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section-1_5.gold-html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Section in a template + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#section_in_a_template.test">Test</a> + </li> + </ul> + </div> + <p> + Some text before the section. + </p> + <div id="section_in_a_template.test"> + <h3> + Test + </h3> + <div id="section_in_a_template.test"> + <p> + Hello. + </p> + <h3 id="section_in_a_template.test.just_to_test_id_generation"> + Just to test id generation + </h3> + <p> + Goodbye. + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/template_section-1_5.quickbook b/src/boost/tools/quickbook/test/template_section-1_5.quickbook new file mode 100644 index 000000000..670654a23 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section-1_5.quickbook @@ -0,0 +1,20 @@ +[article Section in a template + [quickbook 1.5] +] + +[template nestedsection[] + +Some text before the section. + +[section Test] + +Hello. + +[heading Just to test id generation] + +Goodbye. + +[endsect] +] + +[nestedsection]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/template_section1-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_section1-1_5-fail.quickbook new file mode 100644 index 000000000..60b34830a --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section1-1_5-fail.quickbook @@ -0,0 +1,9 @@ +[article Template should contain balanced sections + [quickbook 1.5] +] + +[template begin_no_end[] +[section Test] +] + +[begin_no_end]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/template_section2-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_section2-1_5-fail.quickbook new file mode 100644 index 000000000..5445e88e3 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section2-1_5-fail.quickbook @@ -0,0 +1,10 @@ +[article Template should contain balanced sections + [quickbook 1.5] +] + +[template end_before_begin[] +[endsect] +[section Test] +] + +[end_before_begin]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/template_section3-1_5-fail.quickbook b/src/boost/tools/quickbook/test/template_section3-1_5-fail.quickbook new file mode 100644 index 000000000..237a9f0d1 --- /dev/null +++ b/src/boost/tools/quickbook/test/template_section3-1_5-fail.quickbook @@ -0,0 +1,9 @@ +[article Template should contain balanced sections + [quickbook 1.5] +] + +[template end_no_begin[] +[endsect] +] + +[end_no_begin]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/templates-1_3.gold b/src/boost/tools/quickbook/test/templates-1_3.gold new file mode 100644 index 000000000..ed3668fda --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_3.gold @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="templates" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Templates</title> + <section id="templates.templates"> + <title><link linkend="templates.templates">Templates</link></title> + <para> + nullary_arg + </para> + <para> + foo baz + </para> + <para> + foo baz + </para> + <para> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </para> + <para> + <hey>baz</hey> + </para> + <para> + This is a complete paragraph. madagascar madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar.... blah blah blah...... + </para> + <para> + zoom peanut zoom + </para> + <para> + exactly xanadu + </para> + <para> + wx + </para> + <para> + wxyz wxyz trail + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> "Hello, World" <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + x<superscript>2</superscript> + </para> + <para> + α<superscript>2</superscript> + </para> + <para> + x<superscript>2</superscript> + </para> + <para> + got a banana? + </para> + <para> + .0 00 + </para> + <para> + [fool] + </para> + </section> + <section id="templates.empty_templates"> + <title><link linkend="templates.empty_templates">Empty Templates</link></title> + </section> + <section id="templates.nested_templates"> + <title><link linkend="templates.nested_templates">Nested Templates</link></title> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start phrase template. Hello! End phrase template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start phrase template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End phrase template. + </para> + <para> + Post + </para> + <para> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </para> + </section> + <section id="templates.block_markup"> + <title><link linkend="templates.block_markup">Block Markup</link></title> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + <para/> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + <para> + Paragraphs 1 + </para> + <para> + Paragraphs 2 + </para> + <itemizedlist> + <listitem> + <simpara> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <para/> + </listitem> + <listitem> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </listitem> + <listitem> + <simpara> + Paragraphs 1 + </simpara> + <simpara> + Paragraphs 2 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="templates.escaped_templates"> + <title><link linkend="templates.escaped_templates">Escaped templates</link></title> + <para> + <thingbob>Not real boostbook</thingbob> <thingbob>Also not real boostbook</thingbob> + <thingbob>More fake boostbook</thingbob> <thingbob>Final fake boostbook</thingbob> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/templates-1_3.gold-html b/src/boost/tools/quickbook/test/templates-1_3.gold-html new file mode 100644 index 000000000..1696e949e --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_3.gold-html @@ -0,0 +1,240 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Templates + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#templates.templates">Templates</a> + </li> + <li> + <a href="#templates.empty_templates">Empty Templates</a> + </li> + <li> + <a href="#templates.nested_templates">Nested Templates</a> + </li> + <li> + <a href="#templates.block_markup">Block Markup</a> + </li> + <li> + <a href="#templates.escaped_templates">Escaped templates</a> + </li> + </ul> + </div> + <div id="templates.templates"> + <h3> + Templates + </h3> + <div id="templates.templates"> + <p> + nullary_arg + </p> + <p> + foo baz + </p> + <p> + foo baz + </p> + <p> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </p> + <p> + baz + </p> + <p> + This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... + </p> + <p> + zoom peanut zoom + </p> + <p> + exactly xanadu + </p> + <p> + wx + </p> + <p> + wxyz wxyz trail + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> "Hello, World" <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="special">}</span> +</pre> + <p> + x<sup>2</sup> + </p> + <p> + α<sup>2</sup> + </p> + <p> + x<sup>2</sup> + </p> + <p> + got a banana? + </p> + <p> + .0 00 + </p> + <p> + [fool] + </p> + </div> + </div> + <div id="templates.empty_templates"> + <h3> + Empty Templates + </h3> + <div id="templates.empty_templates"> + </div> + </div> + <div id="templates.nested_templates"> + <h3> + Nested Templates + </h3> + <div id="templates.nested_templates"> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start phrase template. Hello! End phrase template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start phrase template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End phrase template. + </p> + <p> + Post + </p> + <p> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </p> + </div> + </div> + <div id="templates.block_markup"> + <h3> + Block Markup + </h3> + <div id="templates.block_markup"> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + <p> + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + <p> + Paragraphs 1 + </p> + <p> + Paragraphs 2 + </p> + <ul> + <li> + <div> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + </div> + </li> + <li> + <p> + </p> + </li> + <li> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </li> + <li> + <div> + Paragraphs 1 + </div> + <div> + Paragraphs 2 + </div> + </li> + </ul> + </div> + </div> + <div id="templates.escaped_templates"> + <h3> + Escaped templates + </h3> + <div id="templates.escaped_templates"> + <p> + Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/templates-1_3.quickbook b/src/boost/tools/quickbook/test/templates-1_3.quickbook new file mode 100644 index 000000000..a6d434878 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_3.quickbook @@ -0,0 +1,216 @@ +[article Templates + [quickbook 1.3] +] + +[section Templates] + +[/-------------------------------- nullary arg ] + +[template foo0 nullary_arg] + +[foo0] + +[/-------------------------------- unary arg, phrase syle ] + +[template foo1[bar] foo [bar]] + +[foo1 baz] + +[/-------------------------------- unary arg, block syle ] + +[template foo2[bar] +foo [bar] +] + +[foo2 baz] + +[template foo3[bar] +This is a complete paragraph. [bar] [bar] [bar] [bar] [bar] +[bar] [bar] [bar] [bar].... blah blah blah...... +] + +[foo3 kalamazoo] + +[/-------------------------------- unary arg, using punctuation ] + +[template ![bar] '''<hey>'''[bar]'''</hey>'''] + +[!baz] + +[/-------------------------------- recursive templates ] + +[template foo4[bar] +[foo3 [bar]] +] + +[foo3 madagascar] + +[template foo5[x] zoom [x]] +[template foo6[x] [x] zoom] + +[foo6[foo5 peanut]] + +[template kinda_weird[x y] [x] [y]] + +[kinda_weird exactly..xanadu] + + +[/-------------------------------- space delimitted args ] + +[template simple1[a b] [a][b]] + +[simple1 w x] + +[template simple2[a b c d] [a][b][c][d]] + +[simple2 w x y z][simple2 w x y z trail] + +[/-------------------------------- John's templates ] + +[template code[x] + int main() + { + std::cout << ``[x]`` << std::endl; + } +] + +[code "Hello\, World"] + +[template alpha '''α'''] +[template pow[a b] [a]'''<superscript>'''[b]'''</superscript>''' ] +[template super[text]'''<superscript>'''[text]'''</superscript>''' ] + +[pow x 2] + +[pow [alpha] 2] + +x[super 2] + +[/-------------------------------- Some more ] + +[template banana got a banana?] +[template plantation[bananarama] [bananarama]] + +[plantation [banana]] + +[/-------------------------------- Not a bug (there was a syntax error here) ] + +[template join1[a b] [b][a]] +[template join2[a b] [a][b]] +[template test[x] [join1 [join2 0 [x]]...0]] +[test 0] + +[/-------------------------------- Mismatched template ] + +[template foo 1] +[fool] + +[template blah 10] + +[endsect] + +[section Empty Templates] + +[template empty1] +[template empty2 ] +[template empty3 [/comment]] +[template empty4 [/comment] + +] +[template empty5 +] +[template empty6 + +] +[template empty7 +[/comment] +] +[template empty8 + +[/comment] +] +[template empty_arg1[x]] +[template empty_arg2[x y]] + +[empty1] +[empty2] +[empty3] +[empty4] +[empty5] +[empty6] +[empty7] +[empty8] +[empty_arg1 1] +[empty_arg2 1 2] + +[endsect] + +[/----------------------------------- Nested templates ] + +[section Nested Templates] + +[template block[content] + +Start block template. + +[content] + +End block template. +] + +[template phrase[content] Start phrase template. [content] End phrase template.] + +Pre [block [block Hello!]] Post + +Pre [block [phrase Hello!]] Post + +Pre [phrase [block Hello!]] Post + +Pre [phrase [phrase Hello!]] Post + +[endsect] + +[/----------------------------------- Block Markup ] + +[section Block Markup] + +[template list +* a +* b] + +[template horizontal +----] + +[template codeblock + int main() {}] + +[template paragraphs +Paragraphs 1 + +Paragraphs 2 +] + +[list][horizontal][codeblock][paragraphs] + +* [list] +* [horizontal] +* [codeblock] +* [paragraphs] + +[endsect] + +[/----------------------------------- Escaped templates ] + +[section Escaped templates] + +[template raw_markup <thingbob>Not real boostbook</thingbob>] +[template | <thingbob>Also not real boostbook</thingbob>] +[template escaped1 [|] [`|]] +[template escaped2 [x] [`x]] + +[`raw_markup] +[`|] +[escaped1 <thingbob>More fake boostbook</thingbob>] +[escaped2 <thingbob>Final fake boostbook</thingbob>] + +[endsect] diff --git a/src/boost/tools/quickbook/test/templates-1_4.gold b/src/boost/tools/quickbook/test/templates-1_4.gold new file mode 100644 index 000000000..40c244369 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_4.gold @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="template_1_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Template 1.4</title> + <para> + dynamic scoping + </para> + <para> + old + </para> + <para> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {[1-2} {1..2-3} {1..2-3} + </para> + <para> + {[binary 1 2-3} 4] + </para> + <para> + {1-2-3} {1-2-3} {1-2-3 4} {1 2-3-4} {[1-2-3} + </para> + <section id="template_1_4.escaped_templates"> + <title><link linkend="template_1_4.escaped_templates">Escaped templates</link></title> + <para> + <thingbob>Not real boostbook</thingbob> <thingbob>Also not real boostbook</thingbob> + <thingbob>More fake boostbook</thingbob> <thingbob>Final fake boostbook</thingbob> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/templates-1_4.gold-html b/src/boost/tools/quickbook/test/templates-1_4.gold-html new file mode 100644 index 000000000..344d09eac --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_4.gold-html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Template 1.4 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#template_1_4.escaped_templates">Escaped templates</a> + </li> + </ul> + </div> + <p> + dynamic scoping + </p> + <p> + old + </p> + <p> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {[1-2} {1..2-3} {1..2-3} + </p> + <p> + {[binary 1 2-3} 4] + </p> + <p> + {1-2-3} {1-2-3} {1-2-3 4} {1 2-3-4} {[1-2-3} + </p> + <div id="template_1_4.escaped_templates"> + <h3> + Escaped templates + </h3> + <div id="template_1_4.escaped_templates"> + <p> + Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/templates-1_4.quickbook b/src/boost/tools/quickbook/test/templates-1_4.quickbook new file mode 100644 index 000000000..3fb893748 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_4.quickbook @@ -0,0 +1,53 @@ +[article Template 1.4 + [quickbook 1.4] +] + +[/ 1.4 uses dynamic scoping ] + +[template x static scoping] +[template foo1[] [x]] +[template foo2[x] [foo1]] +[foo2 dynamic scoping] + +[/ In 1.4 template arguments are scoped at the point they are used] + +[template y new] +[template foo3[a y] [a]] +[foo3 [y] old] + +[/ 1.4 template arguments] + +[template binary[x y] {[x]-[y]}] +[binary 1..2] [/ {1-2} ] +[binary 1 2] [/ {1-2} ] +[binary 1..2 3 4] [/ {1-2 3 4} ] +[binary 1 2..3 4] [/ {1 2-3 4} ] +[binary 1 2 3..4] [/ {1 2 3-4} ] +[binary [1..2] [/ {(1-2} but with a square bracket ] +[binary 1.\.2..3] [/ {1..2-3} ] +[binary 1.\.2 3] [/ {1..2-3} ] + +[binary [binary 1 2..3] 4] [/ {[binary 1 2-3} 4] ] + +[template ternary[x y z] {[x]-[y]-[z]}] +[ternary 1..2..3] [/ {1-2-3} ] +[ternary 1 2 3] [/ {1-2-3} ] +[ternary 1..2 3 4] [/ {1-2-3 4} ] +[ternary 1 2..3 4] [/ {1 2-3-4} ] +[ternary [1..2..3] [/ {(1-2-3} (but with a square bracket) ] + +[/----------------------------------- Escaped templates ] + +[section Escaped templates] + +[template raw_markup <thingbob>Not real boostbook</thingbob>] +[template | <thingbob>Also not real boostbook</thingbob>] +[template escaped1 [|] [`|]] +[template escaped2 [x] [`x]] + +[`raw_markup] +[`|] +[escaped1 <thingbob>More fake boostbook</thingbob>] +[escaped2 <thingbob>Final fake boostbook</thingbob>] + +[endsect] diff --git a/src/boost/tools/quickbook/test/templates-1_5.gold b/src/boost/tools/quickbook/test/templates-1_5.gold new file mode 100644 index 000000000..9577f1a91 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_5.gold @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="template_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Template 1.5</title> + <section id="template_1_5.templates"> + <title><link linkend="template_1_5.templates">Templates</link></title> + <para> + nullary_arg + </para> + <para> + foo baz + </para> + <para> + foo baz + </para> + <para> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </para> + <para> + <hey>baz</hey> + </para> + <para> + This is a complete paragraph. madagascar madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar.... blah blah blah...... + </para> + <para> + zoom peanut zoom + </para> + <para> + exactly xanadu + </para> + <para> + wx + </para> + <para> + wxyz wxyz trail + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> "Hello, World" <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + x<superscript>2</superscript> + </para> + <para> + α<superscript>2</superscript> + </para> + <para> + x<superscript>2</superscript> + </para> + <para> + got a banana? + </para> + <para> + .0 00 + </para> + <para> + [fool] + </para> + </section> + <section id="template_1_5.empty_templates"> + <title><link linkend="template_1_5.empty_templates">Empty Templates</link></title> + </section> + <section id="template_1_5.nested_templates"> + <title><link linkend="template_1_5.nested_templates">Nested Templates</link></title> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start phrase template. Hello! End phrase template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start phrase template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End phrase template. + </para> + <para> + Post + </para> + <para> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </para> + </section> + <section id="template_1_5.block_markup"> + <title><link linkend="template_1_5.block_markup">Block Markup</link></title> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + <para/> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + <para> + Paragraphs 1 + </para> + <para> + Paragraphs 2 + </para> + <itemizedlist> + <listitem> + <simpara> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <para/> + </listitem> + <listitem> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </listitem> + <listitem> + <simpara> + Paragraphs 1 + </simpara> + <simpara> + Paragraphs 2 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="template_1_5.static_scoping"> + <title><link linkend="template_1_5.static_scoping">Static Scoping</link></title> + <para> + static scoping + </para> + <para> + [a] + </para> + <para> + new + </para> + <para> + foo foo + </para> + </section> + <section id="template_1_5.template_arguments"> + <title><link linkend="template_1_5.template_arguments">Template Arguments</link></title> + <para> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </para> + <para> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </para> + <para> + {[1-2] 3} {[1-2] 3} {[1-2} + </para> + <para> + {1-2-3} {1-2-3} + </para> + </section> + <section id="template_1_5.block_and_phrase_templates"> + <title><link linkend="template_1_5.block_and_phrase_templates">Block and phrase + templates</link></title> + <para> + Some <emphasis role="bold">text</emphasis> + </para> + <para> + A <emphasis>paragraph</emphasis>. + </para> + <para> + Some *text* A <emphasis>paragraph</emphasis>. + </para> + <para> + <index type="things"><title>Things</title></index> + </para> + </section> + <section id="template_1_5.escaped_templates"> + <title><link linkend="template_1_5.escaped_templates">Escaped templates</link></title> + <para> + <thingbob>Not real boostbook</thingbob> <thingbob>Also not real boostbook</thingbob> + <thingbob>More fake boostbook</thingbob> <thingbob>Final fake boostbook</thingbob> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/templates-1_5.gold-html b/src/boost/tools/quickbook/test/templates-1_5.gold-html new file mode 100644 index 000000000..f557f0ac2 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_5.gold-html @@ -0,0 +1,308 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Template 1.5 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#template_1_5.templates">Templates</a> + </li> + <li> + <a href="#template_1_5.empty_templates">Empty Templates</a> + </li> + <li> + <a href="#template_1_5.nested_templates">Nested Templates</a> + </li> + <li> + <a href="#template_1_5.block_markup">Block Markup</a> + </li> + <li> + <a href="#template_1_5.static_scoping">Static Scoping</a> + </li> + <li> + <a href="#template_1_5.template_arguments">Template Arguments</a> + </li> + <li> + <a href="#template_1_5.block_and_phrase_templates">Block and phrase templates</a> + </li> + <li> + <a href="#template_1_5.escaped_templates">Escaped templates</a> + </li> + </ul> + </div> + <div id="template_1_5.templates"> + <h3> + Templates + </h3> + <div id="template_1_5.templates"> + <p> + nullary_arg + </p> + <p> + foo baz + </p> + <p> + foo baz + </p> + <p> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </p> + <p> + baz + </p> + <p> + This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... + </p> + <p> + zoom peanut zoom + </p> + <p> + exactly xanadu + </p> + <p> + wx + </p> + <p> + wxyz wxyz trail + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> "Hello, World" <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="special">}</span> +</pre> + <p> + x<sup>2</sup> + </p> + <p> + α<sup>2</sup> + </p> + <p> + x<sup>2</sup> + </p> + <p> + got a banana? + </p> + <p> + .0 00 + </p> + <p> + [fool] + </p> + </div> + </div> + <div id="template_1_5.empty_templates"> + <h3> + Empty Templates + </h3> + <div id="template_1_5.empty_templates"> + </div> + </div> + <div id="template_1_5.nested_templates"> + <h3> + Nested Templates + </h3> + <div id="template_1_5.nested_templates"> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start phrase template. Hello! End phrase template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start phrase template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End phrase template. + </p> + <p> + Post + </p> + <p> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </p> + </div> + </div> + <div id="template_1_5.block_markup"> + <h3> + Block Markup + </h3> + <div id="template_1_5.block_markup"> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + <p> + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + <p> + Paragraphs 1 + </p> + <p> + Paragraphs 2 + </p> + <ul> + <li> + <div> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + </div> + </li> + <li> + <p> + </p> + </li> + <li> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </li> + <li> + <div> + Paragraphs 1 + </div> + <div> + Paragraphs 2 + </div> + </li> + </ul> + </div> + </div> + <div id="template_1_5.static_scoping"> + <h3> + Static Scoping + </h3> + <div id="template_1_5.static_scoping"> + <p> + static scoping + </p> + <p> + [a] + </p> + <p> + new + </p> + <p> + foo foo + </p> + </div> + </div> + <div id="template_1_5.template_arguments"> + <h3> + Template Arguments + </h3> + <div id="template_1_5.template_arguments"> + <p> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </p> + <p> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </p> + <p> + {[1-2] 3} {[1-2] 3} {[1-2} + </p> + <p> + {1-2-3} {1-2-3} + </p> + </div> + </div> + <div id="template_1_5.block_and_phrase_templates"> + <h3> + Block and phrase templates + </h3> + <div id="template_1_5.block_and_phrase_templates"> + <p> + Some <span class="bold"><strong>text</strong></span> + </p> + <p> + A <emphasis>paragraph</emphasis>. + </p> + <p> + Some *text* A <span class="emphasis"><em>paragraph</em></span>. + </p> + <p> + <h3> + Things + </h3> + </p> + </div> + </div> + <div id="template_1_5.escaped_templates"> + <h3> + Escaped templates + </h3> + <div id="template_1_5.escaped_templates"> + <p> + Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/templates-1_5.quickbook b/src/boost/tools/quickbook/test/templates-1_5.quickbook new file mode 100644 index 000000000..55ec031fd --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_5.quickbook @@ -0,0 +1,297 @@ +[article Template 1.5 + [quickbook 1.5] +] + +[section Templates] + +[/-------------------------------- nullary arg ] + +[template foo0 nullary_arg] + +[foo0] + +[/-------------------------------- unary arg, phrase syle ] + +[template foo1[bar] foo [bar]] + +[foo1 baz] + +[/-------------------------------- unary arg, block syle ] + +[template foo2[bar] +foo [bar] +] + +[foo2 baz] + +[template foo3[bar] +This is a complete paragraph. [bar] [bar] [bar] [bar] [bar] +[bar] [bar] [bar] [bar].... blah blah blah...... +] + +[foo3 kalamazoo] + +[/-------------------------------- unary arg, using punctuation ] + +[template ![bar] '''<hey>'''[bar]'''</hey>'''] + +[!baz] + +[/-------------------------------- recursive templates ] + +[template foo4[bar] +[foo3 [bar]] +] + +[foo3 madagascar] + +[template foo5[x] zoom [x]] +[template foo6[x] [x] zoom] + +[foo6[foo5 peanut]] + +[template kinda_weird[x y] [x] [y]] + +[kinda_weird exactly..xanadu] + + +[/-------------------------------- space delimitted args ] + +[template simple1[a b] [a][b]] + +[simple1 w x] + +[template simple2[a b c d] [a][b][c][d]] + +[simple2 w x y z][simple2 w x y z trail] + +[/-------------------------------- John's templates ] + +[template code[x] + int main() + { + std::cout << ``[x]`` << std::endl; + } +] + +[code "Hello\, World"] + +[template alpha '''α'''] +[template pow[a b] [a]'''<superscript>'''[b]'''</superscript>''' ] +[template super[text]'''<superscript>'''[text]'''</superscript>''' ] + +[pow x 2] + +[pow [alpha] 2] + +x[super 2] + +[/-------------------------------- Some more ] + +[template banana got a banana?] +[template plantation[bananarama] [bananarama]] + +[plantation [banana]] + +[/-------------------------------- Not a bug (there was a syntax error here) ] + +[template join1[a b] [b][a]] +[template join2[a b] [a][b]] +[template test[x] [join1 [join2 0 [x]]...0]] +[test 0] + +[/-------------------------------- Mismatched template ] + +[template foo 1] +[fool] + +[template blah 10] + +[endsect] + +[section Empty Templates] + +[template empty1] +[template empty2 ] +[template empty3 [/comment]] +[template empty4 [/comment] + +] +[template empty5 +] +[template empty6 + +] +[template empty7 +[/comment] +] +[template empty8 + +[/comment] +] +[template empty_arg1[x]] +[template empty_arg2[x y]] + +[empty1] +[empty2] +[empty3] +[empty4] +[empty5] +[empty6] +[empty7] +[empty8] +[empty_arg1 1] +[empty_arg2 1 2] + +[endsect] + +[/----------------------------------- Nested templates ] + +[section Nested Templates] + +[template block[content] + +Start block template. + +[content] + +End block template. +] + +[template phrase[content] Start phrase template. [content] End phrase template.] + +Pre [block [block Hello!]] Post + +Pre [block [phrase Hello!]] Post + +Pre [phrase [block Hello!]] Post + +Pre [phrase [phrase Hello!]] Post + +[endsect] + +[/----------------------------------- Block Markup ] + +[section Block Markup] + +[template list +* a +* b] + +[template horizontal +----] + +[template codeblock + int main() {}] + +[template paragraphs +Paragraphs 1 + +Paragraphs 2 +] + +[list][horizontal][codeblock][paragraphs] + +* [list] +* [horizontal] +* [codeblock] +* [paragraphs] + +[endsect] + +[/----------------------------------- 1.5+ use static scoping ] + +[section Static Scoping] + +[template x static scoping] +[template static_test1[] [x]] +[template static_test2[x] [static_test1]] +[static_test2 dynamic scoping] + +[/ This should be '[a]' because [a] isn't matched. ] +[template test1[] [a]] +[template test2[a] [test1]] +[test2 1] + +[/ In 1.5 template arguments are scoped at the point they are defined] + +[template y new] +[template static_test3[a y] [a]] +[static_test3 [y] old] + +[/ From https://svn.boost.org/trac/boost/ticket/2034 ] + +[template same[x] [x]] +[template echo[a b] [a] [b]] +[template echo_twice[x] [echo [same [x]]..[same [x]]]] +[echo_twice foo] + +[endsect] + +[/----------------------------------- 1.5+ template arguments ] + +[section Template Arguments] + +[template binary[x y] {[x]-[y]}] +[binary 1..2] [/ {1-2} ] +[binary 1 2] [/ {1-2} ] +[binary 1..2 3 4] [/ {1-2 3 4} ] +[binary 1 2..3 4] [/ {1 2-3 4} ] +[binary 1 2 3..4] [/ {1 2 3-4} ] +[binary 1.\.2..3] [/ {1..2-3} ] +[binary 1.\.2 3] [/ {1..2-3} ] + +[binary [binary 1 2..3]..4] [/ { {1 2-3}-4} ] +[binary [binary 1 2..3] 4] [/ { {1 2-3}-4} ] +[binary [binary 1 2 3]..4] [/ { {1-2 3}-4} ] + +[binary \[1 2\] 3] [/ {[1-2] 3} ] +[binary \[1..2\] 3] [/ {[1-2] 3} ] +[binary \[1 2] [/ {(1-2} ] + +[template ternary[x y z] {[x]-[y]-[z]}] +[ternary 1..2..3] [/ {1-2-3} ] +[ternary 1 2 3] [/ {1-2-3} ] + +[endsect] + +[/----------------------------------- Block and phrases ] + +[section Block and phrase templates] + +[template phrase_template[] Some *text*] +[template block_template[] + +A <emphasis>paragraph</emphasis>. +] + +[phrase_template] +[block_template] +[`phrase_template] +[`block_template] + +[/ Trailing newline shouldn't be included] + +[template named_index[type title] +'''<index type="'''[type]'''"><title>'''[title]'''</title></index>''' +] + +[named_index things Things] + +[endsect] + +[/----------------------------------- Escaped templates ] + +[section Escaped templates] + +[template raw_markup <thingbob>Not real boostbook</thingbob>] +[template | <thingbob>Also not real boostbook</thingbob>] +[template escaped1 [|] [`|]] +[template escaped2 [x] [`x]] + +[`raw_markup] +[`|] +[escaped1 <thingbob>More fake boostbook</thingbob>] +[escaped2 <thingbob>Final fake boostbook</thingbob>] + +[endsect] diff --git a/src/boost/tools/quickbook/test/templates-1_6-fail1.quickbook b/src/boost/tools/quickbook/test/templates-1_6-fail1.quickbook new file mode 100644 index 000000000..0fd039b1e --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_6-fail1.quickbook @@ -0,0 +1,8 @@ +[article Template 1.6 fail 1 + [quickbook 1.6] +] + +[/ I've removed support for escaping punctuation templates in 1.6. ] + +[template ~ body] +[`~] diff --git a/src/boost/tools/quickbook/test/templates-1_6.gold b/src/boost/tools/quickbook/test/templates-1_6.gold new file mode 100644 index 000000000..b37604e75 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_6.gold @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="template_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Template 1.6</title> + <section id="template_1_6.templates"> + <title><link linkend="template_1_6.templates">Templates</link></title> + <para> + nullary_arg + </para> + <para> + foo baz + </para> + <para> + foo baz + </para> + <para> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </para> + <para> + <hey>baz</hey> + </para> + <para> + This is a complete paragraph. madagascar madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar.... blah blah blah...... + </para> + <para> + zoom peanut zoom + </para> + <para> + exactly xanadu + </para> + <para> + wx + </para> + <para> + wxyz wxyz trail + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> "Hello, World" <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + x<superscript>2</superscript> + </para> + <para> + α<superscript>2</superscript> + </para> + <para> + x<superscript>2</superscript> + </para> + <para> + got a banana? + </para> + <para> + .0 00 + </para> + <para> + [fool] + </para> + </section> + <section id="template_1_6.empty_templates"> + <title><link linkend="template_1_6.empty_templates">Empty Templates</link></title> + </section> + <section id="template_1_6.nested_templates"> + <title><link linkend="template_1_6.nested_templates">Nested Templates</link></title> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start phrase template. Hello! End phrase template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start phrase template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End phrase template. + </para> + <para> + Post + </para> + <para> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </para> + </section> + <section id="template_1_6.block_markup"> + <title><link linkend="template_1_6.block_markup">Block Markup</link></title> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + <para/> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + <para> + Paragraphs 1 + </para> + <para> + Paragraphs 2 + </para> + <itemizedlist> + <listitem> + <simpara> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <para/> + </listitem> + <listitem> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </listitem> + <listitem> + <simpara> + Paragraphs 1 + </simpara> + <simpara> + Paragraphs 2 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="template_1_6.static_scoping"> + <title><link linkend="template_1_6.static_scoping">Static Scoping</link></title> + <para> + static scoping + </para> + <para> + [a] + </para> + <para> + new + </para> + <para> + foo foo + </para> + </section> + <section id="template_1_6.template_arguments"> + <title><link linkend="template_1_6.template_arguments">Template Arguments</link></title> + <para> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </para> + <para> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </para> + <para> + {[1-2] 3} {[1-2] 3} {[1-2} + </para> + <para> + {1-2-3} {1-2-3} + </para> + </section> + <section id="template_1_6.block_and_phrase_templates"> + <title><link linkend="template_1_6.block_and_phrase_templates">Block and phrase + templates</link></title> + <para> + Some <emphasis role="bold">text</emphasis> + </para> + <para> + A <emphasis>paragraph</emphasis>. + </para> + <para> + Some *text* A <emphasis>paragraph</emphasis>. + </para> + <para> + <index type="things"><title>Things</title></index> + </para> + </section> + <section id="template_1_6.template_body"> + <title><link linkend="template_1_6.template_body">Skipping the template body + correctly</link></title> + <para> + <emphasis>Argument</emphasis> + </para> + <orderedlist> + <listitem> +<programlisting><phrase role="identifier">code</phrase></programlisting> + </listitem> + </orderedlist> + <orderedlist> + <listitem> + <simpara> + <code><phrase role="identifier">code</phrase></code> + </simpara> + </listitem> + </orderedlist> + </section> + <section id="template_1_6.escaped_templates"> + <title><link linkend="template_1_6.escaped_templates">Escaped templates</link></title> + <para> + <thingbob>Not real boostbook</thingbob> <thingbob>More fake boostbook</thingbob> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/templates-1_6.gold-html b/src/boost/tools/quickbook/test/templates-1_6.gold-html new file mode 100644 index 000000000..77d55d0a0 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_6.gold-html @@ -0,0 +1,332 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Template 1.6 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#template_1_6.templates">Templates</a> + </li> + <li> + <a href="#template_1_6.empty_templates">Empty Templates</a> + </li> + <li> + <a href="#template_1_6.nested_templates">Nested Templates</a> + </li> + <li> + <a href="#template_1_6.block_markup">Block Markup</a> + </li> + <li> + <a href="#template_1_6.static_scoping">Static Scoping</a> + </li> + <li> + <a href="#template_1_6.template_arguments">Template Arguments</a> + </li> + <li> + <a href="#template_1_6.block_and_phrase_templates">Block and phrase templates</a> + </li> + <li> + <a href="#template_1_6.template_body">Skipping the template body correctly</a> + </li> + <li> + <a href="#template_1_6.escaped_templates">Escaped templates</a> + </li> + </ul> + </div> + <div id="template_1_6.templates"> + <h3> + Templates + </h3> + <div id="template_1_6.templates"> + <p> + nullary_arg + </p> + <p> + foo baz + </p> + <p> + foo baz + </p> + <p> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </p> + <p> + baz + </p> + <p> + This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... + </p> + <p> + zoom peanut zoom + </p> + <p> + exactly xanadu + </p> + <p> + wx + </p> + <p> + wxyz wxyz trail + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> "Hello, World" <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="special">}</span> +</pre> + <p> + x<sup>2</sup> + </p> + <p> + α<sup>2</sup> + </p> + <p> + x<sup>2</sup> + </p> + <p> + got a banana? + </p> + <p> + .0 00 + </p> + <p> + [fool] + </p> + </div> + </div> + <div id="template_1_6.empty_templates"> + <h3> + Empty Templates + </h3> + <div id="template_1_6.empty_templates"> + </div> + </div> + <div id="template_1_6.nested_templates"> + <h3> + Nested Templates + </h3> + <div id="template_1_6.nested_templates"> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start phrase template. Hello! End phrase template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start phrase template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End phrase template. + </p> + <p> + Post + </p> + <p> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </p> + </div> + </div> + <div id="template_1_6.block_markup"> + <h3> + Block Markup + </h3> + <div id="template_1_6.block_markup"> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + <p> + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + <p> + Paragraphs 1 + </p> + <p> + Paragraphs 2 + </p> + <ul> + <li> + <div> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + </div> + </li> + <li> + <p> + </p> + </li> + <li> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </li> + <li> + <div> + Paragraphs 1 + </div> + <div> + Paragraphs 2 + </div> + </li> + </ul> + </div> + </div> + <div id="template_1_6.static_scoping"> + <h3> + Static Scoping + </h3> + <div id="template_1_6.static_scoping"> + <p> + static scoping + </p> + <p> + [a] + </p> + <p> + new + </p> + <p> + foo foo + </p> + </div> + </div> + <div id="template_1_6.template_arguments"> + <h3> + Template Arguments + </h3> + <div id="template_1_6.template_arguments"> + <p> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </p> + <p> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </p> + <p> + {[1-2] 3} {[1-2] 3} {[1-2} + </p> + <p> + {1-2-3} {1-2-3} + </p> + </div> + </div> + <div id="template_1_6.block_and_phrase_templates"> + <h3> + Block and phrase templates + </h3> + <div id="template_1_6.block_and_phrase_templates"> + <p> + Some <span class="bold"><strong>text</strong></span> + </p> + <p> + A <emphasis>paragraph</emphasis>. + </p> + <p> + Some *text* A <span class="emphasis"><em>paragraph</em></span>. + </p> + <p> + <h3> + Things + </h3> + </p> + </div> + </div> + <div id="template_1_6.template_body"> + <h3> + Skipping the template body correctly + </h3> + <div id="template_1_6.template_body"> + <p> + <span class="emphasis"><em>Argument</em></span> + </p> + <ol> + <li> +<pre class="programlisting"><span class="identifier">code</span></pre> + </li> + </ol> + <ol> + <li> + <div> + <code><span class="identifier">code</span></code> + </div> + </li> + </ol> + </div> + </div> + <div id="template_1_6.escaped_templates"> + <h3> + Escaped templates + </h3> + <div id="template_1_6.escaped_templates"> + <p> + Not real boostbook More fake boostbook + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/templates-1_6.quickbook b/src/boost/tools/quickbook/test/templates-1_6.quickbook new file mode 100644 index 000000000..627bd7fd8 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_6.quickbook @@ -0,0 +1,313 @@ +[article Template 1.6 + [quickbook 1.6] +] + +[section Templates] + +[/-------------------------------- nullary arg ] + +[template foo0 nullary_arg] + +[foo0] + +[/-------------------------------- unary arg, phrase syle ] + +[template foo1[bar] foo [bar]] + +[foo1 baz] + +[/-------------------------------- unary arg, block syle ] + +[template foo2[bar] +foo [bar] +] + +[foo2 baz] + +[template foo3[bar] +This is a complete paragraph. [bar] [bar] [bar] [bar] [bar] +[bar] [bar] [bar] [bar].... blah blah blah...... +] + +[foo3 kalamazoo] + +[/-------------------------------- unary arg, using punctuation ] + +[template ![bar] '''<hey>'''[bar]'''</hey>'''] + +[!baz] + +[/-------------------------------- recursive templates ] + +[template foo4[bar] +[foo3 [bar]] +] + +[foo3 madagascar] + +[template foo5[x] zoom [x]] +[template foo6[x] [x] zoom] + +[foo6[foo5 peanut]] + +[template kinda_weird[x y] [x] [y]] + +[kinda_weird exactly..xanadu] + + +[/-------------------------------- space delimitted args ] + +[template simple1[a b] [a][b]] + +[simple1 w x] + +[template simple2[a b c d] [a][b][c][d]] + +[simple2 w x y z][simple2 w x y z trail] + +[/-------------------------------- John's templates ] + +[template code[x] + int main() + { + std::cout << ``[x]`` << std::endl; + } +] + +[code "Hello\, World"] + +[template alpha '''α'''] +[template pow[a b] [a]'''<superscript>'''[b]'''</superscript>''' ] +[template super[text]'''<superscript>'''[text]'''</superscript>''' ] + +[pow x 2] + +[pow [alpha] 2] + +x[super 2] + +[/-------------------------------- Some more ] + +[template banana got a banana?] +[template plantation[bananarama] [bananarama]] + +[plantation [banana]] + +[/-------------------------------- Not a bug (there was a syntax error here) ] + +[template join1[a b] [b][a]] +[template join2[a b] [a][b]] +[template test[x] [join1 [join2 0 [x]]...0]] +[test 0] + +[/-------------------------------- Mismatched template ] + +[template foo 1] +[fool] + +[template blah 10] + +[endsect] + +[section Empty Templates] + +[template empty1] +[template empty2 ] +[template empty3 [/comment]] +[template empty4 [/comment] + +] +[template empty5 +] +[template empty6 + +] +[template empty7 +[/comment] +] +[template empty8 + +[/comment] +] +[template empty_arg1[x]] +[template empty_arg2[x y]] + +[empty1] +[empty2] +[empty3] +[empty4] +[empty5] +[empty6] +[empty7] +[empty8] +[empty_arg1 1] +[empty_arg2 1 2] + +[endsect] + +[/----------------------------------- Nested templates ] + +[section Nested Templates] + +[template block_foo[content] + +Start block template. + +[content] + +End block template. +] + +[template phrase_foo[content] Start phrase template. [content] End phrase template.] + +Pre [block_foo [block_foo Hello!]] Post + +Pre [block_foo [phrase_foo Hello!]] Post + +Pre [phrase_foo [block_foo Hello!]] Post + +Pre [phrase_foo [phrase_foo Hello!]] Post + +[endsect] + +[/----------------------------------- Block Markup ] + +[section Block Markup] + +[template list +* a +* b] + +[template horizontal +----] + +[template codeblock + int main() {}] + +[template paragraphs +Paragraphs 1 + +Paragraphs 2 +] + +[list][horizontal][codeblock][paragraphs] + +* [list] +* [horizontal] +* [codeblock] +* [paragraphs] + +[endsect] + +[/----------------------------------- 1.5+ use static scoping ] + +[section Static Scoping] + +[template x static scoping] +[template static_test1[] [x]] +[template static_test2[x] [static_test1]] +[static_test2 dynamic scoping] + +[/ This should be '[a]' because [a] isn't matched. ] +[template test1[] [a]] +[template test2[a] [test1]] +[test2 1] + +[/ In 1.5 template arguments are scoped at the point they are defined] + +[template y new] +[template static_test3[a y] [a]] +[static_test3 [y] old] + +[/ From https://svn.boost.org/trac/boost/ticket/2034 ] + +[template same[x] [x]] +[template echo[a b] [a] [b]] +[template echo_twice[x] [echo [same [x]]..[same [x]]]] +[echo_twice foo] + +[endsect] + +[/----------------------------------- 1.5+ template arguments ] + +[section Template Arguments] + +[template binary[x y] {[x]-[y]}] +[binary 1..2] [/ {1-2} ] +[binary 1 2] [/ {1-2} ] +[binary 1..2 3 4] [/ {1-2 3 4} ] +[binary 1 2..3 4] [/ {1 2-3 4} ] +[binary 1 2 3..4] [/ {1 2 3-4} ] +[binary 1.\.2..3] [/ {1..2-3} ] +[binary 1.\.2 3] [/ {1..2-3} ] + +[binary [binary 1 2..3]..4] [/ { {1 2-3}-4} ] +[binary [binary 1 2..3] 4] [/ { {1 2-3}-4} ] +[binary [binary 1 2 3]..4] [/ { {1-2 3}-4} ] + +[binary \[1 2\] 3] [/ {[1-2] 3} ] +[binary \[1..2\] 3] [/ {[1-2] 3} ] +[binary \[1 2] [/ {(1-2} ] + +[template ternary[x y z] {[x]-[y]-[z]}] +[ternary 1..2..3] [/ {1-2-3} ] +[ternary 1 2 3] [/ {1-2-3} ] + +[endsect] + +[/----------------------------------- Block and phrases ] + +[section Block and phrase templates] + +[template phrase_template[] Some *text*] +[template block_template[] + +A <emphasis>paragraph</emphasis>. +] + +[phrase_template] +[block_template] +[`phrase_template] +[`block_template] + +[/ Trailing newline shouldn't be included] + +[template named_index[type title] +'''<index type="'''[type]'''"><title>'''[title]'''</title></index>''' +] + +[named_index things Things] + +[endsect] + +[/-------------------------------- Skipping template body ] + +[section:template_body Skipping the template body correctly] + +[template args1[x] [`x]] +[template args2[] +[ordered_list [``code``]] +] +[/ Due to a bug in the template parser need to stop the parser + thinking that the code is an escaped template. ] +[template args3[] +[ordered_list [\ `code`]] +] + +[args1 <emphasis>Argument</emphasis>] +[args2] +[args3] + +[endsect] + +[/----------------------------------- Escaped templates ] + +[section Escaped templates] + +[template raw_markup <thingbob>Not real boostbook</thingbob>] +[template escaped1 [x] [`x]] + +[`raw_markup] +[escaped1 <thingbob>More fake boostbook</thingbob>] + +[endsect] diff --git a/src/boost/tools/quickbook/test/templates-1_7-fail1.quickbook b/src/boost/tools/quickbook/test/templates-1_7-fail1.quickbook new file mode 100644 index 000000000..0618bebb9 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_7-fail1.quickbook @@ -0,0 +1,12 @@ +[article Template 1.7 fail +[quickbook 1.7] +] + +[/ This should fail because it's a phrase template containing a paragraph + separator. ] + +[template fail[] Phrase content. + +Paragraph content.] + +[fail] diff --git a/src/boost/tools/quickbook/test/templates-1_7-fail2.quickbook b/src/boost/tools/quickbook/test/templates-1_7-fail2.quickbook new file mode 100644 index 000000000..548884b16 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_7-fail2.quickbook @@ -0,0 +1,11 @@ +[article Template 1.7 fail +[quickbook 1.7] +] + +[/ This should fail because it's a block template called from an attribute ] + +[template fail[] + +Block template.] + +[link this-should-[fail]] diff --git a/src/boost/tools/quickbook/test/templates-1_7.gold b/src/boost/tools/quickbook/test/templates-1_7.gold new file mode 100644 index 000000000..c7d4c64e0 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_7.gold @@ -0,0 +1,302 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="template_1_7" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Template 1.7</title> + <section id="template_1_7.templates"> + <title><link linkend="template_1_7.templates">Templates</link></title> + <para> + nullary_arg + </para> + <para> + foo baz + </para> + <para> + foo baz + </para> + <para> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </para> + <para> + <hey>baz</hey> + </para> + <para> + This is a complete paragraph. madagascar madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar.... blah blah blah...... + </para> + <para> + zoom peanut zoom + </para> + <para> + exactly xanadu + </para> + <para> + wx + </para> + <para> + wxyz wxyz trail + </para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> "Hello, World" <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + <para> + x<superscript>2</superscript> + </para> + <para> + α<superscript>2</superscript> + </para> + <para> + x<superscript>2</superscript> + </para> + <para> + got a banana? + </para> + <para> + .0 00 + </para> + <para> + [fool] + </para> + </section> + <section id="template_1_7.empty_templates"> + <title><link linkend="template_1_7.empty_templates">Empty Templates</link></title> + </section> + <section id="template_1_7.nested_templates"> + <title><link linkend="template_1_7.nested_templates">Nested Templates</link></title> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre + </para> + <para> + Start block template. + </para> + <para> + Start phrase template. Hello! End phrase template. + </para> + <para> + End block template. + </para> + <para> + Post + </para> + <para> + Pre Start phrase template. + </para> + <para> + Start block template. + </para> + <para> + Hello! + </para> + <para> + End block template. + </para> + <para> + End phrase template. Post + </para> + <para> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </para> + </section> + <section id="template_1_7.block_markup"> + <title><link linkend="template_1_7.block_markup">Block Markup</link></title> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + <para/> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + <para> + Paragraphs 1 + </para> + <para> + Paragraphs 2 + </para> + <itemizedlist> + <listitem> + <simpara> + <itemizedlist> + <listitem> + <simpara> + a + </simpara> + </listitem> + <listitem> + <simpara> + b + </simpara> + </listitem> + </itemizedlist> + </simpara> + </listitem> + <listitem> + <para/> + </listitem> + <listitem> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting> + </listitem> + <listitem> + <simpara> + Paragraphs 1 + </simpara> + <simpara> + Paragraphs 2 + </simpara> + </listitem> + </itemizedlist> + </section> + <section id="template_1_7.static_scoping"> + <title><link linkend="template_1_7.static_scoping">Static Scoping</link></title> + <para> + static scoping + </para> + <para> + [a] + </para> + <para> + new + </para> + <para> + foo foo + </para> + </section> + <section id="template_1_7.template_arguments"> + <title><link linkend="template_1_7.template_arguments">Template Arguments</link></title> + <para> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </para> + <para> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </para> + <para> + {[1-2] 3} {[1-2] 3} {[1-2} + </para> + <para> + {1-2-3} {1-2-3} + </para> + </section> + <section id="template_1_7.block_and_phrase_templates"> + <title><link linkend="template_1_7.block_and_phrase_templates">Block and phrase + templates</link></title> + <para> + Some <emphasis role="bold">text</emphasis> + </para> + <para> + A <emphasis>paragraph</emphasis>. + </para> + <para> + Some *text* A <emphasis>paragraph</emphasis>. + </para> + <para> + <index type="things"><title>Things</title></index> + </para> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <para> + Text2 afterwards. Text3 before. + </para> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <para> + Text4 before. + </para> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <para> + Text4 afterwards. + </para> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <para> + * Not a list. + </para> + <informaltable frame="all"> + <tgroup cols="0"> + <tbody> + </tbody> + </tgroup> + </informaltable> + <para> + * Not a list. + </para> + </section> + <section id="template_1_7.template_body"> + <title><link linkend="template_1_7.template_body">Skipping the template body + correctly</link></title> + <para> + <emphasis>Argument</emphasis> + </para> + <orderedlist> + <listitem> +<programlisting><phrase role="identifier">code</phrase></programlisting> + </listitem> + </orderedlist> + <orderedlist> + <listitem> + <simpara> + <code><phrase role="identifier">code</phrase></code> + </simpara> + </listitem> + </orderedlist> + </section> + <section id="template_1_7.escaped_templates"> + <title><link linkend="template_1_7.escaped_templates">Escaped templates</link></title> + <para> + <thingbob>Not real boostbook</thingbob> <thingbob>More fake boostbook</thingbob> + </para> + </section> +</article> diff --git a/src/boost/tools/quickbook/test/templates-1_7.gold-html b/src/boost/tools/quickbook/test/templates-1_7.gold-html new file mode 100644 index 000000000..b79546dd9 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_7.gold-html @@ -0,0 +1,377 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Template 1.7 + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#template_1_7.templates">Templates</a> + </li> + <li> + <a href="#template_1_7.empty_templates">Empty Templates</a> + </li> + <li> + <a href="#template_1_7.nested_templates">Nested Templates</a> + </li> + <li> + <a href="#template_1_7.block_markup">Block Markup</a> + </li> + <li> + <a href="#template_1_7.static_scoping">Static Scoping</a> + </li> + <li> + <a href="#template_1_7.template_arguments">Template Arguments</a> + </li> + <li> + <a href="#template_1_7.block_and_phrase_templates">Block and phrase templates</a> + </li> + <li> + <a href="#template_1_7.template_body">Skipping the template body correctly</a> + </li> + <li> + <a href="#template_1_7.escaped_templates">Escaped templates</a> + </li> + </ul> + </div> + <div id="template_1_7.templates"> + <h3> + Templates + </h3> + <div id="template_1_7.templates"> + <p> + nullary_arg + </p> + <p> + foo baz + </p> + <p> + foo baz + </p> + <p> + This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... + </p> + <p> + baz + </p> + <p> + This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... + </p> + <p> + zoom peanut zoom + </p> + <p> + exactly xanadu + </p> + <p> + wx + </p> + <p> + wxyz wxyz trail + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> "Hello, World" <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="special">}</span> +</pre> + <p> + x<sup>2</sup> + </p> + <p> + α<sup>2</sup> + </p> + <p> + x<sup>2</sup> + </p> + <p> + got a banana? + </p> + <p> + .0 00 + </p> + <p> + [fool] + </p> + </div> + </div> + <div id="template_1_7.empty_templates"> + <h3> + Empty Templates + </h3> + <div id="template_1_7.empty_templates"> + </div> + </div> + <div id="template_1_7.nested_templates"> + <h3> + Nested Templates + </h3> + <div id="template_1_7.nested_templates"> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre + </p> + <p> + Start block template. + </p> + <p> + Start phrase template. Hello! End phrase template. + </p> + <p> + End block template. + </p> + <p> + Post + </p> + <p> + Pre Start phrase template. + </p> + <p> + Start block template. + </p> + <p> + Hello! + </p> + <p> + End block template. + </p> + <p> + End phrase template. Post + </p> + <p> + Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post + </p> + </div> + </div> + <div id="template_1_7.block_markup"> + <h3> + Block Markup + </h3> + <div id="template_1_7.block_markup"> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + <p> + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + <p> + Paragraphs 1 + </p> + <p> + Paragraphs 2 + </p> + <ul> + <li> + <div> + <ul> + <li> + <div> + a + </div> + </li> + <li> + <div> + b + </div> + </li> + </ul> + </div> + </li> + <li> + <p> + </p> + </li> + <li> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span></pre> + </li> + <li> + <div> + Paragraphs 1 + </div> + <div> + Paragraphs 2 + </div> + </li> + </ul> + </div> + </div> + <div id="template_1_7.static_scoping"> + <h3> + Static Scoping + </h3> + <div id="template_1_7.static_scoping"> + <p> + static scoping + </p> + <p> + [a] + </p> + <p> + new + </p> + <p> + foo foo + </p> + </div> + </div> + <div id="template_1_7.template_arguments"> + <h3> + Template Arguments + </h3> + <div id="template_1_7.template_arguments"> + <p> + {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} + </p> + <p> + { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} + </p> + <p> + {[1-2] 3} {[1-2] 3} {[1-2} + </p> + <p> + {1-2-3} {1-2-3} + </p> + </div> + </div> + <div id="template_1_7.block_and_phrase_templates"> + <h3> + Block and phrase templates + </h3> + <div id="template_1_7.block_and_phrase_templates"> + <p> + Some <span class="bold"><strong>text</strong></span> + </p> + <p> + A <emphasis>paragraph</emphasis>. + </p> + <p> + Some *text* A <span class="emphasis"><em>paragraph</em></span>. + </p> + <p> + <h3> + Things + </h3> + </p> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <p> + Text2 afterwards. Text3 before. + </p> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <p> + Text4 before. + </p> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <p> + Text4 afterwards. + </p> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <p> + * Not a list. + </p> + <div class="informaltable"> + <table> + <tbody> + </tbody> + </table> + </div> + <p> + * Not a list. + </p> + </div> + </div> + <div id="template_1_7.template_body"> + <h3> + Skipping the template body correctly + </h3> + <div id="template_1_7.template_body"> + <p> + <span class="emphasis"><em>Argument</em></span> + </p> + <ol> + <li> +<pre class="programlisting"><span class="identifier">code</span></pre> + </li> + </ol> + <ol> + <li> + <div> + <code><span class="identifier">code</span></code> + </div> + </li> + </ol> + </div> + </div> + <div id="template_1_7.escaped_templates"> + <h3> + Escaped templates + </h3> + <div id="template_1_7.escaped_templates"> + <p> + Not real boostbook More fake boostbook + </p> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/templates-1_7.quickbook b/src/boost/tools/quickbook/test/templates-1_7.quickbook new file mode 100644 index 000000000..bf1feaca2 --- /dev/null +++ b/src/boost/tools/quickbook/test/templates-1_7.quickbook @@ -0,0 +1,322 @@ +[article Template 1.7 + [quickbook 1.7] +] + +[section Templates] + +[/-------------------------------- nullary arg ] + +[template foo0 nullary_arg] + +[foo0] + +[/-------------------------------- unary arg, phrase syle ] + +[template foo1[bar] foo [bar]] + +[foo1 baz] + +[/-------------------------------- unary arg, block syle ] + +[template foo2[bar] +foo [bar] +] + +[foo2 baz] + +[template foo3[bar] +This is a complete paragraph. [bar] [bar] [bar] [bar] [bar] +[bar] [bar] [bar] [bar].... blah blah blah...... +] + +[foo3 kalamazoo] + +[/-------------------------------- unary arg, using punctuation ] + +[template |[bar] '''<hey>'''[bar]'''</hey>'''] + +[|baz] + +[/-------------------------------- recursive templates ] + +[template foo4[bar] +[foo3 [bar]] +] + +[foo3 madagascar] + +[template foo5[x] zoom [x]] +[template foo6[x] [x] zoom] + +[foo6[foo5 peanut]] + +[template kinda_weird[x y] [x] [y]] + +[kinda_weird exactly..xanadu] + + +[/-------------------------------- space delimitted args ] + +[template simple1[a b] [a][b]] + +[simple1 w x] + +[template simple2[a b c d] [a][b][c][d]] + +[simple2 w x y z][simple2 w x y z trail] + +[/-------------------------------- John's templates ] + +[template code[x] + int main() + { + std::cout << ``[x]`` << std::endl; + } +] + +[code "Hello\, World"] + +[template alpha '''α'''] +[template pow[a b] [a]'''<superscript>'''[b]'''</superscript>''' ] +[template super[text]'''<superscript>'''[text]'''</superscript>''' ] + +[pow x 2] + +[pow [alpha] 2] + +x[super 2] + +[/-------------------------------- Some more ] + +[template banana got a banana?] +[template plantation[bananarama] [bananarama]] + +[plantation [banana]] + +[/-------------------------------- Not a bug (there was a syntax error here) ] + +[template join1[a b] [b][a]] +[template join2[a b] [a][b]] +[template test[x] [join1 [join2 0 [x]]...0]] +[test 0] + +[/-------------------------------- Mismatched template ] + +[template foo 1] +[fool] + +[template blah 10] + +[endsect] + +[section Empty Templates] + +[template empty1] +[template empty2 ] +[template empty3 [/comment]] +[template empty4 [/comment] + +] +[template empty5 +] +[template empty6 + +] +[template empty7 +[/comment] +] +[template empty8 + +[/comment] +] +[template empty_arg1[x]] +[template empty_arg2[x y]] + +[empty1] +[empty2] +[empty3] +[empty4] +[empty5] +[empty6] +[empty7] +[empty8] +[empty_arg1 1] +[empty_arg2 1 2] + +[endsect] + +[/----------------------------------- Nested templates ] + +[section Nested Templates] + +[template block_foo[content] + +Start block template. + +[content] + +End block template. +] + +[template phrase_foo[content] Start phrase template. [content] End phrase template.] + +Pre [block_foo [block_foo Hello!]] Post + +Pre [block_foo [phrase_foo Hello!]] Post + +Pre [phrase_foo [block_foo Hello!]] Post + +Pre [phrase_foo [phrase_foo Hello!]] Post + +[endsect] + +[/----------------------------------- Block Markup ] + +[section Block Markup] + +[template list +* a +* b] + +[template horizontal +----] + +[template codeblock + int main() {}] + +[template paragraphs +Paragraphs 1 + +Paragraphs 2 +] + +[list][horizontal][codeblock][paragraphs] + +* [list] +* [horizontal] +* [codeblock] +* [paragraphs] + +[endsect] + +[/----------------------------------- 1.5+ use static scoping ] + +[section Static Scoping] + +[template x static scoping] +[template static_test1[] [x]] +[template static_test2[x] [static_test1]] +[static_test2 dynamic scoping] + +[/ This should be '[a]' because [a] isn't matched. ] +[template test1[] [a]] +[template test2[a] [test1]] +[test2 1] + +[/ In 1.5 template arguments are scoped at the point they are defined] + +[template y new] +[template static_test3[a y] [a]] +[static_test3 [y] old] + +[/ From https://svn.boost.org/trac/boost/ticket/2034 ] + +[template same[x] [x]] +[template echo[a b] [a] [b]] +[template echo_twice[x] [echo [same [x]]..[same [x]]]] +[echo_twice foo] + +[endsect] + +[/----------------------------------- 1.5+ template arguments ] + +[section Template Arguments] + +[template binary[x y] {[x]-[y]}] +[binary 1..2] [/ {1-2} ] +[binary 1 2] [/ {1-2} ] +[binary 1..2 3 4] [/ {1-2 3 4} ] +[binary 1 2..3 4] [/ {1 2-3 4} ] +[binary 1 2 3..4] [/ {1 2 3-4} ] +[binary 1.\.2..3] [/ {1..2-3} ] +[binary 1.\.2 3] [/ {1..2-3} ] + +[binary [binary 1 2..3]..4] [/ { {1 2-3}-4} ] +[binary [binary 1 2..3] 4] [/ { {1 2-3}-4} ] +[binary [binary 1 2 3]..4] [/ { {1-2 3}-4} ] + +[binary \[1 2\] 3] [/ {[1-2] 3} ] +[binary \[1..2\] 3] [/ {[1-2] 3} ] +[binary \[1 2] [/ {(1-2} ] + +[template ternary[x y z] {[x]-[y]-[z]}] +[ternary 1..2..3] [/ {1-2-3} ] +[ternary 1 2 3] [/ {1-2-3} ] + +[endsect] + +[/----------------------------------- Block and phrases ] + +[section Block and phrase templates] + +[template phrase_template[] Some *text*] +[template block_template[] + +A <emphasis>paragraph</emphasis>. +] + +[phrase_template] +[block_template] +[`phrase_template] +[`block_template] + +[/ Trailing newline shouldn't be included] + +[template named_index[type title] +'''<index type="'''[type]'''"><title>'''[title]'''</title></index>''' +] + +[named_index things Things] + +[/ Blocks in phrase templates ] + +[template phrase_block1[] [table]] +[template phrase_block2[] [table] Text2 afterwards.] +[template phrase_block3[] Text3 before. [table]] +[template phrase_block4[] Text4 before. [table] Text4 afterwards.] +[template phrase_block5[] [table] * Not a list.] +[template phrase_block6[] [table] +* Not a list.] + +[phrase_block1][phrase_block2][phrase_block3][phrase_block4] +[phrase_block5][phrase_block6] + +[endsect] + +[/-------------------------------- Skipping template body ] + +[section:template_body Skipping the template body correctly] + +[template args1[x] [`x]] +[template args2[] [ordered_list [``code``]]] +[/ Due to a bug in the template parser need to stop the parser + thinking that the code is an escaped template. ] +[template args3[] [ordered_list [\ `code`]]] + +[args1 <emphasis>Argument</emphasis>] +[args2] +[args3] + +[endsect] + +[/----------------------------------- Escaped templates ] + +[section Escaped templates] + +[template raw_markup <thingbob>Not real boostbook</thingbob>] +[template escaped1 [x] [`x]] + +[`raw_markup] +[escaped1 <thingbob>More fake boostbook</thingbob>] + +[endsect] diff --git a/src/boost/tools/quickbook/test/unicode_escape-1_5.gold b/src/boost/tools/quickbook/test/unicode_escape-1_5.gold new file mode 100644 index 000000000..c2a8859eb --- /dev/null +++ b/src/boost/tools/quickbook/test/unicode_escape-1_5.gold @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="utf_8_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>UTF-8 test</title> + <bridgehead renderas="sect2" id="utf_8_test.h0"> + <phrase id="utf_8_test.i__xf1_t__xeb_rn__xe2_ti__xf4_n__xe0_liz__xe6_ti__xf8_n"/><link + linkend="utf_8_test.i__xf1_t__xeb_rn__xe2_ti__xf4_n__xe0_liz__xe6_ti__xf8_n">Iñtërnâtiônàlizætiøn</link> + </bridgehead> + <itemizedlist> + <listitem> + <simpara> + Αα Alpha + </simpara> + </listitem> + <listitem> + <simpara> + Ββ Beta + </simpara> + </listitem> + <listitem> + <simpara> + Γγ Gamma + </simpara> + </listitem> + <listitem> + <simpara> + Δδ Delta + </simpara> + </listitem> + <listitem> + <simpara> + Εε Epsilon + </simpara> + </listitem> + <listitem> + <simpara> + Ζζ Zeta + </simpara> + </listitem> + <listitem> + <simpara> + Ηη Eta + </simpara> + </listitem> + <listitem> + <simpara> + Θθ Theta + </simpara> + </listitem> + <listitem> + <simpara> + Ιι Iota + </simpara> + </listitem> + <listitem> + <simpara> + Κκ Kappa + </simpara> + </listitem> + <listitem> + <simpara> + Λλ Lambda + </simpara> + </listitem> + <listitem> + <simpara> + Μμ Mu + </simpara> + </listitem> + <listitem> + <simpara> + Νν Nu + </simpara> + </listitem> + <listitem> + <simpara> + Ξξ Xi + </simpara> + </listitem> + <listitem> + <simpara> + Οο Omicron + </simpara> + </listitem> + <listitem> + <simpara> + Ππ Pi + </simpara> + </listitem> + <listitem> + <simpara> + Ρρ Rho + </simpara> + </listitem> + <listitem> + <simpara> + Σσς Sigma + </simpara> + </listitem> + <listitem> + <simpara> + Ττ Tau + </simpara> + </listitem> + <listitem> + <simpara> + Υυ Upsilon + </simpara> + </listitem> + <listitem> + <simpara> + Φφ Phi + </simpara> + </listitem> + <listitem> + <simpara> + Χχ Chi + </simpara> + </listitem> + <listitem> + <simpara> + Ψψ Psi + </simpara> + </listitem> + <listitem> + <simpara> + Ωω Omega + </simpara> + </listitem> + </itemizedlist> + <para> + In the unlikely event that you've got a Mahjong font: + </para> + <itemizedlist> + <listitem> + <simpara> + 🀀 East Wind + </simpara> + </listitem> + <listitem> + <simpara> + 🀁 South Wind + </simpara> + </listitem> + <listitem> + <simpara> + 🀂 West Wind + </simpara> + </listitem> + <listitem> + <simpara> + 🀃 North Wind + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/unicode_escape-1_5.gold-html b/src/boost/tools/quickbook/test/unicode_escape-1_5.gold-html new file mode 100644 index 000000000..ab8409f10 --- /dev/null +++ b/src/boost/tools/quickbook/test/unicode_escape-1_5.gold-html @@ -0,0 +1,159 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + UTF-8 test + </h3> + <h2 id="utf_8_test.i__xf1_t__xeb_rn__xe2_ti__xf4_n__xe0_liz__xe6_ti__xf8_n"> + Iñtërnâtiônàlizætiøn + </h2> + <ul> + <li> + <div> + Αα Alpha + </div> + </li> + <li> + <div> + Ββ Beta + </div> + </li> + <li> + <div> + Γγ Gamma + </div> + </li> + <li> + <div> + Δδ Delta + </div> + </li> + <li> + <div> + Εε Epsilon + </div> + </li> + <li> + <div> + Ζζ Zeta + </div> + </li> + <li> + <div> + Ηη Eta + </div> + </li> + <li> + <div> + Θθ Theta + </div> + </li> + <li> + <div> + Ιι Iota + </div> + </li> + <li> + <div> + Κκ Kappa + </div> + </li> + <li> + <div> + Λλ Lambda + </div> + </li> + <li> + <div> + Μμ Mu + </div> + </li> + <li> + <div> + Νν Nu + </div> + </li> + <li> + <div> + Ξξ Xi + </div> + </li> + <li> + <div> + Οο Omicron + </div> + </li> + <li> + <div> + Ππ Pi + </div> + </li> + <li> + <div> + Ρρ Rho + </div> + </li> + <li> + <div> + Σσς Sigma + </div> + </li> + <li> + <div> + Ττ Tau + </div> + </li> + <li> + <div> + Υυ Upsilon + </div> + </li> + <li> + <div> + Φφ Phi + </div> + </li> + <li> + <div> + Χχ Chi + </div> + </li> + <li> + <div> + Ψψ Psi + </div> + </li> + <li> + <div> + Ωω Omega + </div> + </li> + </ul> + <p> + In the unlikely event that you've got a Mahjong font: + </p> + <ul> + <li> + <div> + 🀀 East Wind + </div> + </li> + <li> + <div> + 🀁 South Wind + </div> + </li> + <li> + <div> + 🀂 West Wind + </div> + </li> + <li> + <div> + 🀃 North Wind + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/unicode_escape-1_5.quickbook b/src/boost/tools/quickbook/test/unicode_escape-1_5.quickbook new file mode 100644 index 000000000..becdef6b8 --- /dev/null +++ b/src/boost/tools/quickbook/test/unicode_escape-1_5.quickbook @@ -0,0 +1,37 @@ +[article UTF-8 test + [quickbook 1.5] +] + +[heading I\u00F1t\u00EBrn\u00E2ti\u00F4n\u00E0liz\u00E6ti\u00F8n] + +* \u0391\u03B1 Alpha +* \u0392\u03B2 Beta +* \u0393\u03B3 Gamma +* \u0394\u03B4 Delta +* \u0395\u03B5 Epsilon +* \u0396\u03B6 Zeta +* \u0397\u03B7 Eta +* \u0398\u03B8 Theta +* \u0399\u03B9 Iota +* \u039A\u03BA Kappa +* \u039B\u03BB Lambda +* \u039C\u03BC Mu +* \u039D\u03BD Nu +* \u039E\u03BE Xi +* \u039F\u03BF Omicron +* \u03A0\u03C0 Pi +* \u03A1\u03C1 Rho +* \u03A3\u03C3\u03C2 Sigma +* \u03A4\u03C4 Tau +* \u03A5\u03C5 Upsilon +* \u03A6\u03C6 Phi +* \u03A7\u03C7 Chi +* \u03A8\u03C8 Psi +* \u03A9\u03C9 Omega + +In the unlikely event that you've got a Mahjong font: + +* \U0001F000 East Wind +* \U0001F001 South Wind +* \U0001F002 West Wind +* \U0001F003 North Wind
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/unit/Jamfile.v2 b/src/boost/tools/quickbook/test/unit/Jamfile.v2 new file mode 100644 index 000000000..43271b48c --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/Jamfile.v2 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import testing ; + +project quickbook/test/unit-tests + : requirements + <include>../../src + <warnings>all + <library>/boost//filesystem + <toolset>gcc:<cflags>-g0 + <toolset>darwin:<cflags>-g0 + <toolset>msvc:<cflags>/wd4709 + ; + +run values_test.cpp ../../src/values.cpp ../../src/files.cpp ; +run post_process_test.cpp ../../src/post_process.cpp ; +run source_map_test.cpp ../../src/files.cpp ; +run glob_test.cpp ../../src/glob.cpp ; +run utils_test.cpp ../../src/id_xml.cpp ../../src/utils.cpp ; +run cleanup_test.cpp ; +run path_test.cpp ../../src/path.cpp ../../src/native_text.cpp ../../src/utils.cpp ; + +# Copied from spirit +run symbols_tests.cpp ; +run symbols_find_null.cpp ; diff --git a/src/boost/tools/quickbook/test/unit/cleanup_test.cpp b/src/boost/tools/quickbook/test/unit/cleanup_test.cpp new file mode 100644 index 000000000..4952c991a --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/cleanup_test.cpp @@ -0,0 +1,80 @@ + +/*============================================================================= + Copyright (c) 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <vector> +#include <boost/core/lightweight_test.hpp> +#include "cleanup.hpp" + +struct counted +{ + static int count; + static std::vector<int> destroyed; + static void reset() + { + count = 0; + destroyed.clear(); + } + + int value; + + counted(int v) : value(v) + { + BOOST_TEST(value != -1); + ++count; + } + + counted(counted const& x) : value(x.value) + { + BOOST_TEST(value != -1); + ++count; + } + + ~counted() + { + BOOST_TEST(value != -1); + destroyed.push_back(value); + value = -1; + BOOST_TEST(count > 0); + --count; + } +}; + +int counted::count = 0; +std::vector<int> counted::destroyed; + +int main() +{ + counted::reset(); + { + quickbook::cleanup c; + } + BOOST_TEST(counted::count == 0); + + counted::reset(); + { + quickbook::cleanup c; + counted& v1 = c.add(new counted(1)); + counted& v2 = c.add(new counted(2)); + BOOST_TEST(v1.value == 1); + BOOST_TEST(v2.value == 2); + } + BOOST_TEST(counted::count == 0); + BOOST_TEST(counted::destroyed.size() == 2); + BOOST_TEST(counted::destroyed[0] == 2); + BOOST_TEST(counted::destroyed[1] == 1); + + counted::reset(); + { + quickbook::cleanup c; + int& x = c.add(new int(10)); + BOOST_TEST(x == 10); + } + + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/glob_test.cpp b/src/boost/tools/quickbook/test/unit/glob_test.cpp new file mode 100644 index 000000000..27d2611b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/glob_test.cpp @@ -0,0 +1,163 @@ +/*============================================================================= + Copyright (c) 2013 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/detail/lightweight_test.hpp> +#include "glob.hpp" + +void glob_tests() +{ + BOOST_TEST(quickbook::glob("", "")); + + BOOST_TEST(!quickbook::glob("*", "")); + BOOST_TEST(quickbook::glob("*", "a")); + BOOST_TEST(quickbook::glob("*b", "b")); + BOOST_TEST(quickbook::glob("*b", "ab")); + BOOST_TEST(quickbook::glob("*b", "bab")); + BOOST_TEST(quickbook::glob("*b*", "b")); + BOOST_TEST(quickbook::glob("*b*", "ab")); + BOOST_TEST(quickbook::glob("*b*", "bc")); + BOOST_TEST(quickbook::glob("*b*", "abc")); + BOOST_TEST(!quickbook::glob("*b*", "")); + BOOST_TEST(!quickbook::glob("*b*", "a")); + BOOST_TEST(!quickbook::glob("*b*", "ac")); + + BOOST_TEST(quickbook::glob("hello.txt", "hello.txt")); + BOOST_TEST(!quickbook::glob("world.txt", "helloworld.txt")); + BOOST_TEST(quickbook::glob("*world.txt", "helloworld.txt")); + BOOST_TEST(!quickbook::glob("world.txt*", "helloworld.txt")); + BOOST_TEST(!quickbook::glob("hello", "helloworld.txt")); + BOOST_TEST(!quickbook::glob("*hello", "helloworld.txt")); + BOOST_TEST(quickbook::glob("hello*", "helloworld.txt")); + BOOST_TEST(quickbook::glob("*world*", "helloworld.txt")); + + BOOST_TEST(quickbook::glob("?", "a")); + BOOST_TEST(!quickbook::glob("?", "")); + BOOST_TEST(!quickbook::glob("?", "ab")); + BOOST_TEST(quickbook::glob("a?", "ab")); + BOOST_TEST(quickbook::glob("?b", "ab")); + BOOST_TEST(quickbook::glob("?bc", "abc")); + BOOST_TEST(quickbook::glob("a?c", "abc")); + BOOST_TEST(quickbook::glob("ab?", "abc")); + BOOST_TEST(!quickbook::glob("?bc", "aac")); + BOOST_TEST(!quickbook::glob("a?c", "bbc")); + BOOST_TEST(!quickbook::glob("ab?", "abcd")); + + BOOST_TEST(quickbook::glob("[a]", "a")); + BOOST_TEST(!quickbook::glob("[^a]", "a")); + BOOST_TEST(!quickbook::glob("[b]", "a")); + BOOST_TEST(quickbook::glob("[^b]", "a")); + BOOST_TEST(quickbook::glob("[a-z]", "a")); + BOOST_TEST(!quickbook::glob("[^a-z]", "a")); + BOOST_TEST(!quickbook::glob("[b-z]", "a")); + BOOST_TEST(quickbook::glob("[^b-z]", "a")); + BOOST_TEST(quickbook::glob("[-a]", "a")); + BOOST_TEST(quickbook::glob("[-a]", "-")); + BOOST_TEST(!quickbook::glob("[-a]", "b")); + BOOST_TEST(!quickbook::glob("[^-a]", "a")); + BOOST_TEST(!quickbook::glob("[^-a]", "-")); + BOOST_TEST(quickbook::glob("[^-a]", "b")); + BOOST_TEST(quickbook::glob("[a-]", "a")); + BOOST_TEST(quickbook::glob("[a-]", "-")); + BOOST_TEST(!quickbook::glob("[a-]", "b")); + BOOST_TEST(!quickbook::glob("[^a-]", "a")); + BOOST_TEST(!quickbook::glob("[^a-]", "-")); + BOOST_TEST(quickbook::glob("[^a-]", "b")); + BOOST_TEST(quickbook::glob("[a-ce-f]", "a")); + BOOST_TEST(!quickbook::glob("[a-ce-f]", "d")); + BOOST_TEST(quickbook::glob("[a-ce-f]", "f")); + BOOST_TEST(!quickbook::glob("[a-ce-f]", "g")); + BOOST_TEST(!quickbook::glob("[^a-ce-f]", "a")); + BOOST_TEST(quickbook::glob("[^a-ce-f]", "d")); + BOOST_TEST(!quickbook::glob("[^a-ce-f]", "f")); + BOOST_TEST(quickbook::glob("[^a-ce-f]", "g")); + BOOST_TEST(!quickbook::glob("[b]", "a")); + BOOST_TEST(quickbook::glob("[a]bc", "abc")); + BOOST_TEST(quickbook::glob("a[b]c", "abc")); + BOOST_TEST(quickbook::glob("ab[c]", "abc")); + BOOST_TEST(quickbook::glob("a[a-c]c", "abc")); + BOOST_TEST(quickbook::glob("*[b]*", "abc")); + BOOST_TEST(quickbook::glob("[\\]]", "]")); + BOOST_TEST(!quickbook::glob("[^\\]]", "]")); + + BOOST_TEST(quickbook::glob("b*ana", "banana")); + BOOST_TEST(quickbook::glob("1234*1234*1234", "123412341234")); + BOOST_TEST(!quickbook::glob("1234*1234*1234", "1234123341234")); + BOOST_TEST(quickbook::glob("1234*1234*1234", "123412312312341231231234")); + BOOST_TEST(!quickbook::glob("1234*1234*1234", "12341231231234123123123")); +} + +void invalid_glob_tests() +{ + // Note that glob only throws an exception when the pattern matches up to + // the point where the error occurs. + BOOST_TEST_THROWS(quickbook::glob("[", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[^", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[xyz", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[xyz\\", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[x\\y", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[a-", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[a-z", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[a-\\", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[a-\\a", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("xyx[", "xyxa"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("abc]", "abcd"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("]def", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[[]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[]]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("**", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[/]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[\\/]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[ -/]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("[ -\\/]", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("\\", "a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::glob("\\\\", "a"), quickbook::glob_error); +} + +void check_glob_tests() +{ + BOOST_TEST(!quickbook::check_glob("")); + BOOST_TEST(!quickbook::check_glob("file")); + BOOST_TEST(!quickbook::check_glob("file\\[\\]")); + BOOST_TEST(quickbook::check_glob("[x]")); + BOOST_TEST(quickbook::check_glob("abc[x]")); + BOOST_TEST(quickbook::check_glob("[x]abd")); + BOOST_TEST_THROWS(quickbook::check_glob("["), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[^"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[xyz"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[xyz\\"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[x\\y"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[a-"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[a-z"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[a-\\"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[a-\\a"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("xyx["), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("abc]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("]def"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[[]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[]]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("**"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[/]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[\\/]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[ -/]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("[ -\\/]"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("\\"), quickbook::glob_error); + BOOST_TEST_THROWS(quickbook::check_glob("\\\\"), quickbook::glob_error); +} + +int main() +{ + glob_tests(); + invalid_glob_tests(); + check_glob_tests(); + + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/path_test.cpp b/src/boost/tools/quickbook/test/unit/path_test.cpp new file mode 100644 index 000000000..734769ef6 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/path_test.cpp @@ -0,0 +1,189 @@ +/*============================================================================= + Copyright (c) 2015 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/detail/lightweight_test.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/predef.h> +#include "path.hpp" + +void file_path_to_url_tests() +{ + using boost::filesystem::path; + using quickbook::file_path_to_url; + + BOOST_TEST_EQ(std::string(), file_path_to_url(path())); + BOOST_TEST_EQ(std::string("."), file_path_to_url(path("."))); + BOOST_TEST_EQ(std::string("./"), file_path_to_url(path("./"))); + BOOST_TEST_EQ(std::string("a/b"), file_path_to_url(path("a/b"))); + BOOST_TEST_EQ(std::string("a/b/"), file_path_to_url(path("a/b/"))); + BOOST_TEST_EQ(std::string("./a/b"), file_path_to_url(path("./a/./././b"))); + BOOST_TEST_EQ(std::string("../a/b"), file_path_to_url(path("../a/b"))); + BOOST_TEST_EQ( + std::string("A%20B%2bC%2520"), file_path_to_url(path("A B+C%20"))); + BOOST_TEST_EQ(std::string("file:///"), file_path_to_url(path("/"))); + BOOST_TEST_EQ(std::string("file:///a/b"), file_path_to_url(path("/a/b"))); + BOOST_TEST_EQ(std::string("file:///a/b/"), file_path_to_url(path("/a/b/"))); + BOOST_TEST_EQ( + std::string("file://hello/a/b"), file_path_to_url(path("//hello/a/b"))); + +#if BOOST_OS_WINDOWS || BOOST_OS_CYGWIN + // Should this be file:///c:/x ? + BOOST_TEST_EQ( + std::string("file://?/a:/x"), file_path_to_url(path("\\\\?\\a:\\x"))); + BOOST_TEST_EQ(std::string("file:///a"), file_path_to_url(path("\\a"))); + BOOST_TEST_EQ(std::string("file:///c:/"), file_path_to_url(path("c:\\"))); + BOOST_TEST_EQ( + std::string("file:///c:/foo/bar"), + file_path_to_url(path("c:\\foo\\bar"))); + BOOST_TEST_EQ( + std::string("file://localhost/c:/foo/bar"), + file_path_to_url(path("\\\\localhost\\c:\\foo\\bar"))); + + // Really not sure what to do with these examples. + // Maybe an error? + BOOST_TEST_EQ(std::string("file:///c:"), file_path_to_url(path("c:"))); + BOOST_TEST_EQ( + std::string("file:///c:foo/bar"), file_path_to_url(path("c:foo\\bar"))); +#endif +} + +void dir_path_to_url_tests() +{ + using boost::filesystem::path; + using quickbook::dir_path_to_url; + + BOOST_TEST_EQ(std::string("./"), dir_path_to_url(path())); + BOOST_TEST_EQ(std::string("./"), dir_path_to_url(path("."))); + BOOST_TEST_EQ(std::string("./"), dir_path_to_url(path("./"))); + BOOST_TEST_EQ(std::string("a/b/"), dir_path_to_url(path("a/b"))); + BOOST_TEST_EQ(std::string("a/b/"), dir_path_to_url(path("a/b/"))); + BOOST_TEST_EQ(std::string("./a/b/"), dir_path_to_url(path("./a/./././b"))); + BOOST_TEST_EQ(std::string("../a/b/"), dir_path_to_url(path("../a/b"))); + BOOST_TEST_EQ( + std::string("A%20B%2bC%2520/"), dir_path_to_url(path("A B+C%20"))); + BOOST_TEST_EQ(std::string("file:///"), dir_path_to_url(path("/"))); + BOOST_TEST_EQ(std::string("file:///a/b/"), dir_path_to_url(path("/a/b"))); + BOOST_TEST_EQ(std::string("file:///a/b/"), dir_path_to_url(path("/a/b/"))); + BOOST_TEST_EQ( + std::string("file://hello/a/b/"), dir_path_to_url(path("//hello/a/b"))); + +#if BOOST_OS_WINDOWS || BOOST_OS_CYGWIN + // Should this be file:///c:/x/ ? + BOOST_TEST_EQ( + std::string("file://?/a:/x/"), dir_path_to_url(path("\\\\?\\a:\\x"))); + BOOST_TEST_EQ(std::string("file:///a/"), dir_path_to_url(path("\\a"))); + BOOST_TEST_EQ(std::string("file:///c:/"), dir_path_to_url(path("c:\\"))); + BOOST_TEST_EQ( + std::string("file:///c:/foo/bar/"), + dir_path_to_url(path("c:\\foo\\bar"))); + BOOST_TEST_EQ( + std::string("file://localhost/c:/foo/bar/"), + dir_path_to_url(path("\\\\localhost\\c:\\foo\\bar"))); + + // Really not sure what to do with these examples. + // Maybe an error? + BOOST_TEST_EQ(std::string("file:///c:"), dir_path_to_url(path("c:"))); + BOOST_TEST_EQ( + std::string("file:///c:foo/bar/"), dir_path_to_url(path("c:foo\\bar"))); +#endif +} + +void path_difference_tests() +{ + using boost::filesystem::current_path; + using boost::filesystem::path; + using quickbook::path_difference; + + BOOST_TEST(path(".") == path_difference(path(""), path(""))); + BOOST_TEST(path(".") == path_difference(path("a"), path("a"))); + BOOST_TEST(path(".") == path_difference(path("a/../b"), path("b"))); + BOOST_TEST(path(".") == path_difference(current_path(), current_path())); + BOOST_TEST(path("..") == path_difference(path("a"), path(""))); + BOOST_TEST( + path("..") == path_difference(current_path() / "a", current_path())); + BOOST_TEST(path("a") == path_difference(path(""), path("a"))); + BOOST_TEST( + path("a") == path_difference(current_path(), current_path() / "a")); + BOOST_TEST(path("b") == path_difference(path("a"), path("a/b"))); + BOOST_TEST( + path("b") == + path_difference(current_path() / "a", current_path() / "a" / "b")); + BOOST_TEST(path("../a/b") == path_difference(path("c"), path("a/b"))); + BOOST_TEST( + path("../a/b") == + path_difference(current_path() / "c", current_path() / "a" / "b")); + BOOST_TEST(path("..") == path_difference(path(""), path(".."))); + BOOST_TEST( + path("..") == + path_difference(current_path(), current_path().parent_path())); + BOOST_TEST(path("b") == path_difference(path("a/c/.."), path("a/b"))); + BOOST_TEST(path("b") == path_difference(path("b/c/../../a"), path("a/b"))); + BOOST_TEST( + path("b") == + path_difference(path("b/c/../../a"), path("d/f/../../a/b"))); + BOOST_TEST( + path("../../x/a/b") == + path_difference(path("b/c/../../a"), path("d/f/../../../x/a/b"))); + + // path_difference to a file, try to include the filename in the result, + // although not always possible. Maybe nonsense calls should be an error? + // + // Commented out cases are wrong because path_difference resolves the paths + // to the current working directory. In use this doesn't matter as it's + // always called with the full path, but it'd be nice to get this right. + // Or maybe just add the pre-condition to path_difference? + std::cout << path_difference(path(""), path(""), true) << std::endl; + // BOOST_TEST(path(".") == path_difference(path(""), path(""), true)); + BOOST_TEST(path("../a") == path_difference(path("a"), path("a"), true)); + BOOST_TEST( + path("../../a") == path_difference(path("a/b"), path("a"), true)); + BOOST_TEST( + path("../b") == path_difference(path("a/../b"), path("b"), true)); + BOOST_TEST( + ".." / current_path().filename() == + path_difference(current_path(), current_path(), true)); + // BOOST_TEST(path("..") == path_difference(path("a"), path(""), true)); + BOOST_TEST( + "../.." / current_path().filename() == + path_difference(current_path() / "a", current_path(), true)); + BOOST_TEST(path("a") == path_difference(path(""), path("a"), true)); + BOOST_TEST( + path("a") == + path_difference(current_path(), current_path() / "a", true)); + BOOST_TEST(path("b") == path_difference(path("a"), path("a/b"), true)); + BOOST_TEST( + path("b") == + path_difference( + current_path() / "a", current_path() / "a" / "b", true)); + BOOST_TEST(path("../a/b") == path_difference(path("c"), path("a/b"), true)); + BOOST_TEST( + path("../a/b") == + path_difference( + current_path() / "c", current_path() / "a" / "b", true)); + // BOOST_TEST(path("..") == path_difference(path(""), path(".."), true)); + BOOST_TEST( + "../.." / current_path().parent_path().filename() == + path_difference(current_path(), current_path().parent_path(), true)); + BOOST_TEST(path("b") == path_difference(path("a/c/.."), path("a/b"), true)); + BOOST_TEST( + path("b") == path_difference(path("b/c/../../a"), path("a/b"), true)); + BOOST_TEST( + path("b") == + path_difference(path("b/c/../../a"), path("d/f/../../a/b"), true)); + BOOST_TEST( + path("../../x/a/b") == + path_difference(path("b/c/../../a"), path("d/f/../../../x/a/b"), true)); +} + +int main() +{ + file_path_to_url_tests(); + dir_path_to_url_tests(); + path_difference_tests(); + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/post_process_test.cpp b/src/boost/tools/quickbook/test/unit/post_process_test.cpp new file mode 100644 index 000000000..e7681c72d --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/post_process_test.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/detail/lightweight_test.hpp> +#include "post_process.hpp" + +#define EXPECT_EXCEPTION(test, msg) \ + try { \ + test; \ + BOOST_ERROR(msg); \ + } catch (quickbook::post_process_failure&) { \ + } + +int main() +{ + EXPECT_EXCEPTION( + quickbook::post_process("</thing>"), "Succeeded with unbalanced tag"); + EXPECT_EXCEPTION( + quickbook::post_process("<"), "Succeeded with badly formed tag"); + + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/source_map_test.cpp b/src/boost/tools/quickbook/test/unit/source_map_test.cpp new file mode 100644 index 000000000..6248ac1f6 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/source_map_test.cpp @@ -0,0 +1,444 @@ +/*============================================================================= + Copyright (c) 2012 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/detail/lightweight_test.hpp> +#include <boost/range/algorithm/find.hpp> +#include "files.hpp" +#include "fwd.hpp" +#include "string_view.hpp" + +void simple_map_tests() +{ + quickbook::string_view source("First Line\nSecond Line"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + + quickbook::string_iterator line1 = fake_file->source().begin(); + quickbook::string_iterator line1_end = + boost::find(fake_file->source(), '\n'); + quickbook::string_iterator line2 = line1_end + 1; + quickbook::string_iterator line2_end = fake_file->source().end(); + + quickbook::mapped_file_builder builder; + + { // Empty test + builder.start(fake_file); + BOOST_TEST(builder.empty()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST(f1->source().empty()); + } + + { // Add full text + builder.start(fake_file); + builder.add(quickbook::string_view(line1, line2_end - line1)); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), source); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(1, 3)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line1_end - line1)), + quickbook::file_position(1, line1_end - line1 + 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2 - line1)), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + fake_file->position_of(fake_file->source().end())); + } + + { // Add first line + builder.start(fake_file); + builder.add(quickbook::string_view(line1, line1_end - line1)); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), + quickbook::string_view(source.begin(), line1_end - line1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(1, 3)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(1, line1_end - line1 + 1)); + } + + { // Add second line + builder.start(fake_file); + builder.add(quickbook::string_view(line2, line2_end - line2)); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), quickbook::string_view("Second Line")); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(2, 3)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(2, line2_end - line2 + 1)); + } + + { // Out of order + builder.start(fake_file); + builder.add(quickbook::string_view(line2, line2_end - line2)); + builder.add(quickbook::string_view(line1_end, 1)); + builder.add(quickbook::string_view(line1, line1_end - line1)); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Second Line\nFirst Line")); + + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(2, 3)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2 - 1)), + quickbook::file_position(2, line2_end - line2)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2)), + quickbook::file_position(1, (line1_end - line1 + 1))); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2 + 1)), + quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(1, line1_end - line1 + 1)); + } + + { // Repeated text + builder.start(fake_file); + builder.add(quickbook::string_view(line2, line2_end - line2)); + builder.add(quickbook::string_view(line1_end, 1)); + builder.add(quickbook::string_view(line2, line2_end - line2)); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Second Line\nSecond Line")); + + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(2, 3)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2 - 1)), + quickbook::file_position(2, line2_end - line2)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2)), + quickbook::file_position(1, (line1_end - line1 + 1))); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + (line2_end - line2 + 1)), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(2, line2_end - line2 + 1)); + } + + { // Generated text + builder.start(fake_file); + builder.add_at_pos("------\n", line1); + builder.add(quickbook::string_view(line1, line1_end - line1)); + builder.add_at_pos("\n------\n", line1_end); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), + quickbook::string_view("------\nFirst Line\n------\n")); + + quickbook::string_iterator newline = boost::find(f1->source(), '\n'); + + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 2), + quickbook::file_position(1, 1)); + BOOST_TEST_EQ(f1->position_of(newline), quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(newline + 1), quickbook::file_position(1, 1)); + BOOST_TEST_EQ( + f1->position_of(newline + 2), quickbook::file_position(1, 2)); + BOOST_TEST_EQ( + f1->position_of(newline + (line1_end - line1)), + quickbook::file_position(1, line1_end - line1)); + BOOST_TEST_EQ( + f1->position_of(newline + (line1_end - line1 + 1)), + quickbook::file_position(1, line1_end - line1 + 1)); + BOOST_TEST_EQ( + f1->position_of(newline + (line1_end - line1 + 2)), + quickbook::file_position(1, line1_end - line1 + 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(1, line1_end - line1 + 1)); + } +} + +void indented_map_tests() +{ + quickbook::string_view source(" Code line1\n" + " Code line2\n"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + + quickbook::mapped_file_builder builder; + + { + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line1\nCode line2\n")); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 1), + quickbook::file_position(1, 5)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 5), + quickbook::file_position(1, 9)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 10), + quickbook::file_position(1, 14)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 11), + quickbook::file_position(2, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(3, 1)); + } + + { + builder.start(fake_file); + { + quickbook::mapped_file_builder builder2; + builder2.start(fake_file); + builder2.unindent_and_add(fake_file->source()); + builder.add(builder2); + } + quickbook::file_ptr f1 = builder.release(); + + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line1\nCode line2\n")); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 1), + quickbook::file_position(1, 5)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 5), + quickbook::file_position(1, 9)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 10), + quickbook::file_position(1, 14)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 11), + quickbook::file_position(2, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(3, 1)); + } + + { + builder.start(fake_file); + builder.unindent_and_add(quickbook::string_view( + fake_file->source().begin() + 3, + fake_file->source().end() - (fake_file->source().begin() + 3))); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), + quickbook::string_view("Code line1\n Code line2\n")); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 1), + quickbook::file_position(1, 5)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 5), + quickbook::file_position(1, 9)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 10), + quickbook::file_position(1, 14)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 11), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().end()), + quickbook::file_position(3, 1)); + } +} + +void indented_map_tests2() +{ + quickbook::string_view source(" Code line1\n" + "\n" + " Code line2\n"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + + quickbook::mapped_file_builder builder; + + { + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line1\n\nCode line2\n")); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin()), + quickbook::file_position(1, 4)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 1), + quickbook::file_position(1, 5)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 5), + quickbook::file_position(1, 9)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 10), + quickbook::file_position(1, 14)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 11), + quickbook::file_position(2, 1)); + BOOST_TEST_EQ( + f1->position_of(f1->source().begin() + 12), + quickbook::file_position(3, 4)); + } +} + +void indented_map_leading_blanks_test() +{ + quickbook::mapped_file_builder builder; + + { + quickbook::string_view source("\n\n Code line1\n"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), quickbook::string_view("Code line1\n")); + } + + { + quickbook::string_view source(" \n \n Code line1\n"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), quickbook::string_view("Code line1\n")); + } + + { + quickbook::string_view source(" Code line1\n \n Code line2"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line1\n\nCode line2")); + } +} + +void indented_map_trailing_blanks_test() +{ + quickbook::mapped_file_builder builder; + + { + quickbook::string_view source("\n\n Code line1\n "); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), quickbook::string_view("Code line1\n")); + } + + { + quickbook::string_view source(" \n \n Code line1\n "); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ(f1->source(), quickbook::string_view("Code line1\n ")); + } + + { + quickbook::string_view source(" Code line1\n \n Code line2\n "); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line1\n\nCode line2\n")); + } +} + +void indented_map_mixed_test() +{ + quickbook::mapped_file_builder builder; + + { + quickbook::string_view source("\tCode line 1\n Code line 2\n\t " + "Code line 3\n \tCode line 4"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), + quickbook::string_view( + "Code line 1\nCode line 2\n Code line 3\n Code line 4")); + } + + { + quickbook::string_view source(" Code line 1\n\tCode line 2"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line 1\n Code line 2")); + } + + { + quickbook::string_view source(" Code line 1\n \tCode line 2"); + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + builder.start(fake_file); + builder.unindent_and_add(fake_file->source()); + quickbook::file_ptr f1 = builder.release(); + BOOST_TEST_EQ( + f1->source(), quickbook::string_view("Code line 1\n\tCode line 2")); + } +} + +int main() +{ + simple_map_tests(); + indented_map_tests(); + indented_map_tests2(); + indented_map_leading_blanks_test(); + indented_map_trailing_blanks_test(); + indented_map_mixed_test(); + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/symbols_find_null.cpp b/src/boost/tools/quickbook/test/unit/symbols_find_null.cpp new file mode 100644 index 000000000..0be8ab1e5 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/symbols_find_null.cpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2004 Joao Abecasis + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/spirit/include/classic_scanner.hpp> +#include <boost/utility/addressof.hpp> +#include "symbols.hpp" + +typedef char char_type; +typedef char const* iterator; + +char_type data_[] = "whatever"; + +iterator begin = data_; +iterator end = + data_ + + sizeof(data_) / sizeof(char_type); // Yes, this is an intentional bug ;) + +int main() +{ + typedef BOOST_SPIRIT_CLASSIC_NS::scanner<> scanner; + typedef quickbook::tst<void*, char_type> symbols; + + symbols symbols_; + + symbols_.add(begin, end - 1, (void*)boost::addressof(symbols_)); + + // The symbol table parser should not choke on input containing the null + // character. + symbols_.find(scanner(begin, end)); +} diff --git a/src/boost/tools/quickbook/test/unit/symbols_tests.cpp b/src/boost/tools/quickbook/test/unit/symbols_tests.cpp new file mode 100644 index 000000000..41f37b5e7 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/symbols_tests.cpp @@ -0,0 +1,374 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2003 Martin Wille + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include <iostream> +#include <string> +#include <boost/detail/lightweight_test.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_symbols.hpp> +#include <boost/swap.hpp> +#include "symbols.hpp" + +/////////////////////////////////////////////////////////////////////////////// +using namespace std; +using namespace BOOST_SPIRIT_CLASSIC_NS; + +/////////////////////////////////////////////////////////////////////////////// + +template <typename IteratorT> bool equal(IteratorT p, IteratorT q) +{ + while (*p && *p == *q) { + ++p; + ++q; + } + return *p == *q; +} + +template <class SymbolsT, typename CharT> +void docheck( + SymbolsT const& sym, + CharT const* candidate, + bool hit, + CharT const* result, + int length) +{ + parse_info<CharT const*> info = parse(candidate, sym); + +#define correctly_matched hit == info.hit +#define correct_match_length unsigned(length) == info.length +#define correct_tail equal(candidate + (hit ? 1 : 0) * length, result) + + BOOST_TEST(correctly_matched); + + if (hit) { + BOOST_TEST(correct_match_length); + BOOST_TEST(correct_tail); + } + else { + BOOST_TEST(correct_tail); + } +} + +template <typename T> struct store_action +{ + store_action(T const& v) : value(v) {} + void operator()(T& v) const { v = value; } + + private: + T const value; +}; + +template <typename T> store_action<T> store(T const& v) { return v; } + +template <typename T> struct check_action +{ + check_action(T const& v) : value(v) {} + +#define correct_value_stored (v == value) + void operator()(T const& v) const { BOOST_TEST(correct_value_stored); } + + private: + T const value; +}; + +template <typename T> check_action<T> docheck(T const& v) { return v; } + +static void default_constructible() +{ // this actually a compile time test + symbols<int, char, quickbook::tst<int, char> > ns1; + symbols<int, wchar_t, quickbook::tst<int, wchar_t> > ws1; + symbols<std::string, char, quickbook::tst<std::string, char> > ns2; + symbols<std::string, wchar_t, quickbook::tst<std::string, wchar_t> > ws2; + + (void)ns1; + (void)ws1; + (void)ns2; + (void)ws2; +} + +typedef symbols<int, char, quickbook::tst<int, char> > nsymbols; +typedef symbols<int, wchar_t, quickbook::tst<int, wchar_t> > wsymbols; + +static void narrow_match_tests() +{ + nsymbols sym; + sym = "pineapple", "orange", "banana", "applepie", "apple"; + + docheck(sym, "pineapple", true, "", 9); + docheck(sym, "orange", true, "", 6); + docheck(sym, "banana", true, "", 6); + docheck(sym, "apple", true, "", 5); + docheck(sym, "pizza", false, "pizza", -1); + docheck(sym, "steak", false, "steak", -1); + docheck(sym, "applepie", true, "", 8); + docheck(sym, "bananarama", true, "rama", 6); + docheck(sym, "applet", true, "t", 5); + docheck(sym, "applepi", true, "pi", 5); + docheck(sym, "appl", false, "appl", -1); + + docheck(sym, "pineapplez", true, "z", 9); + docheck(sym, "orangez", true, "z", 6); + docheck(sym, "bananaz", true, "z", 6); + docheck(sym, "applez", true, "z", 5); + docheck(sym, "pizzaz", false, "pizzaz", -1); + docheck(sym, "steakz", false, "steakz", -1); + docheck(sym, "applepiez", true, "z", 8); + docheck(sym, "bananaramaz", true, "ramaz", 6); + docheck(sym, "appletz", true, "tz", 5); + docheck(sym, "applepix", true, "pix", 5); +} + +static void narrow_copy_ctor_tests() +{ + nsymbols sym; + sym = "pineapple", "orange", "banana", "applepie", "apple"; + + nsymbols sym2(sym); + docheck(sym2, "pineapple", true, "", 9); + docheck(sym2, "pizza", false, "pizza", -1); + docheck(sym2, "bananarama", true, "rama", 6); +} + +static void narrow_assigment_operator_tests() +{ + nsymbols sym; + sym = "pineapple", "orange", "banana", "applepie", "apple"; + + nsymbols sym2; + sym2 = sym; + + docheck(sym2, "pineapple", true, "", 9); + docheck(sym2, "pizza", false, "pizza", -1); + docheck(sym2, "bananarama", true, "rama", 6); +} + +static void narrow_swap_tests() +{ + nsymbols sym, sym2; + sym = "pineapple", "orange", "banana", "applepie", "apple"; + sym2 = "potato", "cucumber", "cauliflower", "carrot"; + + boost::swap(sym, sym2); + + docheck(sym2, "pineapple", true, "", 9); + docheck(sym2, "pizza", false, "pizza", -1); + docheck(sym2, "bananarama", true, "rama", 6); + docheck(sym, "potatoe", true, "e", 6); + docheck(sym, "cauliflour", false, "cauliflour", -1); +} + +static void narrow_value_tests() +{ // also tests the add member functions + nsymbols sym; + + sym = "orange", "banana"; + sym.add("pineapple", 1234); + sym.add("lemon"); + + parse("orange", sym[store(12345)]); + parse("orange", sym[docheck(12345)]); + parse("pineapple", sym[docheck(1234)]); + parse("banana", sym[docheck(int())]); + parse("lemon", sym[docheck(int())]); +} + +static void narrow_free_functions_tests() +{ + nsymbols sym; + +#define add_returned_non_null_value (res != 0) +#define add_returned_null (res == 0) +#define find_returned_non_null_value (res != 0) +#define find_returned_null (res == 0) + + int* res = add(sym, "pineapple"); + BOOST_TEST(add_returned_non_null_value); + res = add(sym, "pineapple"); + BOOST_TEST(add_returned_null); + + res = find(sym, "pineapple"); + BOOST_TEST(find_returned_non_null_value); + res = find(sym, "banana"); + BOOST_TEST(find_returned_null); +} + +static void wide_match_tests() +{ + wsymbols sym; + sym = L"pineapple", L"orange", L"banana", L"applepie", L"apple"; + + docheck(sym, L"pineapple", true, L"", 9); + docheck(sym, L"orange", true, L"", 6); + docheck(sym, L"banana", true, L"", 6); + docheck(sym, L"apple", true, L"", 5); + docheck(sym, L"pizza", false, L"pizza", -1); + docheck(sym, L"steak", false, L"steak", -1); + docheck(sym, L"applepie", true, L"", 8); + docheck(sym, L"bananarama", true, L"rama", 6); + docheck(sym, L"applet", true, L"t", 5); + docheck(sym, L"applepi", true, L"pi", 5); + docheck(sym, L"appl", false, L"appl", -1); + + docheck(sym, L"pineapplez", true, L"z", 9); + docheck(sym, L"orangez", true, L"z", 6); + docheck(sym, L"bananaz", true, L"z", 6); + docheck(sym, L"applez", true, L"z", 5); + docheck(sym, L"pizzaz", false, L"pizzaz", -1); + docheck(sym, L"steakz", false, L"steakz", -1); + docheck(sym, L"applepiez", true, L"z", 8); + docheck(sym, L"bananaramaz", true, L"ramaz", 6); + docheck(sym, L"appletz", true, L"tz", 5); + docheck(sym, L"applepix", true, L"pix", 5); +} + +static void wide_copy_ctor_tests() +{ + wsymbols sym; + sym = L"pineapple", L"orange", L"banana", L"applepie", L"apple"; + + wsymbols sym2(sym); + docheck(sym2, L"pineapple", true, L"", 9); + docheck(sym2, L"pizza", false, L"pizza", -1); + docheck(sym2, L"bananarama", true, L"rama", 6); +} + +static void wide_assigment_operator_tests() +{ + wsymbols sym; + sym = L"pineapple", L"orange", L"banana", L"applepie", L"apple"; + + wsymbols sym2; + sym2 = sym; + + docheck(sym2, L"pineapple", true, L"", 9); + docheck(sym2, L"pizza", false, L"pizza", -1); + docheck(sym2, L"bananarama", true, L"rama", 6); +} + +static void wide_swap_tests() +{ + wsymbols sym, sym2; + sym = L"pineapple", L"orange", L"banana", L"applepie", L"apple"; + sym2 = L"potato", L"cucumber", L"cauliflower", L"carrot"; + + boost::swap(sym, sym2); + + docheck(sym2, L"pineapple", true, L"", 9); + docheck(sym2, L"pizza", false, L"pizza", -1); + docheck(sym2, L"bananarama", true, L"rama", 6); + docheck(sym, L"potatoe", true, L"e", 6); + docheck(sym, L"cauliflour", false, L"cauliflour", -1); +} + +static void wide_value_tests() +{ // also tests the add member functions + wsymbols sym; + + sym = L"orange", L"banana"; + sym.add(L"pineapple", 1234); + sym.add(L"lemon"); + + parse(L"orange", sym[store(12345)]); + parse(L"orange", sym[docheck(12345)]); + parse(L"pineapple", sym[docheck(1234)]); + parse(L"banana", sym[docheck(int())]); + parse(L"lemon", sym[docheck(int())]); +} + +static void wide_free_functions_tests() +{ + wsymbols sym; + + int* res = add(sym, L"pineapple"); + BOOST_TEST(add_returned_non_null_value); + res = add(sym, L"pineapple"); + BOOST_TEST(add_returned_null); + + res = find(sym, L"pineapple"); + BOOST_TEST(find_returned_non_null_value); + res = find(sym, L"banana"); + BOOST_TEST(find_returned_null); +} + +static void free_add_find_functions_tests() +{ + nsymbols sym; + BOOST_TEST(*add(sym, "a", 0) == 0); + BOOST_TEST(*add(sym, "a2", 1) == 1); + BOOST_TEST(add(sym, "a2", 2) == 0); + BOOST_TEST(find(sym, "a2")); + BOOST_TEST(find(sym, "a")); +} + +// The original teneray search tree implementation contained a bug when +// inserting duplicate values. I want this implementation to be as +// close as possible to the original (so they can be easily switched) +// so check that the bug remains the same. + +struct check_parse_value +{ + explicit check_parse_value(int value) : value_(value) {} + + void operator()(int value) const { BOOST_TEST(value == value_); } + + int value_; +}; + +// My version is different to the original, if there's an existing value +// it replaces it with the new one. + +static void duplicate_add_tests() +{ + char const* foo1 = "foo"; + char const* foo2 = foo1 + 3; + + nsymbols sym; + sym.add(foo1, foo2, 1); + nsymbols sym2 = sym; + sym.add(foo1, foo2, 2); + sym2.add(foo1, foo2, 3); + + BOOST_TEST(find(sym, "foo") && *find(sym, "foo") == 2); + BOOST_TEST(find(sym2, "foo") && *find(sym2, "foo") == 3); + + parse_info<char const*> info; + + info = parse("foo ", sym[check_parse_value(2)]); + BOOST_TEST(info.hit && info.length == 3); + + info = parse("foo", sym[check_parse_value(2)]); + BOOST_TEST(info.hit && info.length == 3); + + info = parse("foo ", sym2[check_parse_value(3)]); + BOOST_TEST(info.hit && info.length == 3); + + info = parse("foo", sym2[check_parse_value(3)]); + BOOST_TEST(info.hit && info.length == 3); +} + +int main() +{ + default_constructible(); + narrow_match_tests(); + narrow_copy_ctor_tests(); + narrow_assigment_operator_tests(); + narrow_swap_tests(); + narrow_value_tests(); + narrow_free_functions_tests(); + wide_match_tests(); + wide_copy_ctor_tests(); + wide_assigment_operator_tests(); + wide_swap_tests(); + wide_value_tests(); + wide_free_functions_tests(); + free_add_find_functions_tests(); + duplicate_add_tests(); + + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/utils_test.cpp b/src/boost/tools/quickbook/test/unit/utils_test.cpp new file mode 100644 index 000000000..6a54dccfe --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/utils_test.cpp @@ -0,0 +1,67 @@ + +/*============================================================================= + Copyright (c) 2017 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/detail/lightweight_test.hpp> +#include "utils.hpp" + +#include <iostream> + +void linkify_test() +{ + using quickbook::detail::linkify; + + BOOST_TEST(linkify("abc", "link") == "<link linkend=\"link\">abc</link>"); + BOOST_TEST( + linkify("<link linkend=\"something\">abc</link>", "link") == + "<link linkend=\"something\">abc</link>"); + BOOST_TEST( + linkify("abc <link linkend=\"something\">def</link>", "link") == + "abc <link linkend=\"something\">def</link>"); + BOOST_TEST( + linkify("<link linkend=\"something\">abc</link> def", "link") == + "<link linkend=\"something\">abc</link> def"); +} + +void decode_string_test() +{ + using quickbook::detail::decode_string; + BOOST_TEST_EQ(std::string("<A&B>"), decode_string("<A&B>")); + BOOST_TEST_EQ(std::string("<A&B>"), decode_string("<A&B>")); + BOOST_TEST_EQ(std::string("a"), decode_string("a")); + BOOST_TEST_EQ(std::string("OO"), decode_string("OO")); + // Unicode examples taken from wikipedia. + // https://en.wikipedia.org/wiki/UTF-8#Examples + BOOST_TEST_EQ( + std::string("\x24\xc2\xa2\xe2\x82\xAC\xF0\x90\x8D\x88"), + decode_string("$¢€𐍈")); +} + +void encode_string_test() +{ + using quickbook::detail::encode_string; + BOOST_TEST_EQ(std::string("<A&B>"), encode_string("<A&B>")); +} + +void escape_uri_test() +{ + using quickbook::detail::escape_uri; + using quickbook::detail::partially_escape_uri; + + BOOST_TEST_EQ(std::string("%2520%2525%25"), escape_uri("%20%25%")); + BOOST_TEST_EQ(std::string("%20%25%25"), partially_escape_uri("%20%25%")); +} + +int main() +{ + linkify_test(); + decode_string_test(); + encode_string_test(); + escape_uri_test(); + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unit/values_test.cpp b/src/boost/tools/quickbook/test/unit/values_test.cpp new file mode 100644 index 000000000..d0036d428 --- /dev/null +++ b/src/boost/tools/quickbook/test/unit/values_test.cpp @@ -0,0 +1,128 @@ +/*============================================================================= + Copyright (c) 2010-2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Some very light testing for quickbook::value and friends. +// Just for a few issues that came up during development. + +#include <vector> +#include <boost/detail/lightweight_test.hpp> +#include <boost/range/algorithm/equal.hpp> +#include "files.hpp" +#include "values.hpp" + +void empty_tests() +{ + quickbook::value q; + BOOST_TEST(q.empty()); + BOOST_TEST(!q.is_list()); + BOOST_TEST(!q.is_encoded()); +} + +void qbk_tests() +{ + std::string source = "Source"; + quickbook::value q; + { + quickbook::file_ptr fake_file = + new quickbook::file("(fake file)", source, 105u); + q = quickbook::qbk_value( + fake_file, fake_file->source().begin(), fake_file->source().end()); + } + BOOST_TEST_EQ(q.get_quickbook(), quickbook::string_view(source)); +} + +void sort_test() +{ + quickbook::value_builder b; + b.insert(quickbook::encoded_value("a", 10)); + b.insert(quickbook::encoded_value("b", 2)); + b.insert(quickbook::encoded_value("c", 5)); + b.insert(quickbook::encoded_value("d", 8)); + b.sort_list(); + + quickbook::value_consumer c = b.release(); + BOOST_TEST(c.check(2)); + BOOST_TEST_EQ(c.consume(2).get_encoded(), "b"); + BOOST_TEST(c.check(5)); + c.consume(5); + BOOST_TEST(c.check(8)); + c.consume(8); + BOOST_TEST(c.check(10)); + c.consume(10); + BOOST_TEST(!c.check()); +} + +void multiple_list_test() +{ + quickbook::value_builder list1; + quickbook::value_builder list2; + + list1.insert(quickbook::encoded_value("b", 10)); + + { + quickbook::value p1 = quickbook::encoded_value("a", 5); + list1.insert(p1); + list2.insert(p1); + } + + list2.insert(quickbook::encoded_value("c", 3)); + + quickbook::value_consumer l1 = list1.release(); + quickbook::value_consumer l2 = list2.release(); + + BOOST_TEST(l1.check(10)); + BOOST_TEST_EQ(l1.consume(10).get_encoded(), "b"); + BOOST_TEST(l1.check(5)); + BOOST_TEST_EQ(l1.consume(5).get_encoded(), "a"); + BOOST_TEST(!l1.check()); + + BOOST_TEST(l2.check(5)); + BOOST_TEST_EQ(l2.consume(5).get_encoded(), "a"); + BOOST_TEST(l2.check(3)); + BOOST_TEST_EQ(l2.consume(3).get_encoded(), "c"); + BOOST_TEST(!l2.check()); +} + +void equality_tests() +{ + std::vector<quickbook::value> distinct_values; + + quickbook::value_builder builder; + quickbook::value nil; + + // 0: nil + distinct_values.push_back(nil); + + // 1: [] + distinct_values.push_back(builder.release()); + + // 2: [nil] + builder.insert(nil); + distinct_values.push_back(builder.release()); + + for (std::size_t i = 0; i < distinct_values.size(); ++i) { + for (std::size_t j = 0; j < distinct_values.size(); ++j) { + if ((i == j) != (distinct_values[i] == distinct_values[j])) { + BOOST_ERROR("Value mismatch."); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\tat " << i << ", " << j + << std::endl; + } + } + } +} + +int main() +{ + empty_tests(); + qbk_tests(); + sort_test(); + multiple_list_test(); + equality_tests(); + + return boost::report_errors(); +} diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_5.gold b/src/boost/tools/quickbook/test/unmatched_element-1_5.gold new file mode 100644 index 000000000..735503ac5 --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_5.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unmatched_elements" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Unmatched elements</title> + <para> + <emphasis role="bold">[non-element</emphasis>] + </para> + <para> + [non-element] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_5.gold-html b/src/boost/tools/quickbook/test/unmatched_element-1_5.gold-html new file mode 100644 index 000000000..a705860f6 --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_5.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Unmatched elements + </h3> + <p> + <span class="bold"><strong>[non-element</strong></span>] + </p> + <p> + [non-element] + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_5.quickbook b/src/boost/tools/quickbook/test/unmatched_element-1_5.quickbook new file mode 100644 index 000000000..84ea298d0 --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_5.quickbook @@ -0,0 +1,12 @@ +[article Unmatched elements +[quickbook 1.5] +] + +[template identity[x] + +[x] +] + +[* [non-element]] + +[identity [non-element]]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_6.gold b/src/boost/tools/quickbook/test/unmatched_element-1_6.gold new file mode 100644 index 000000000..ad52f651a --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_6.gold @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unmatched_elements" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Unmatched elements</title> + <para> + <emphasis role="bold">[non-element]</emphasis> + </para> + <para> + [non-element] + </para> +</article> diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_6.gold-html b/src/boost/tools/quickbook/test/unmatched_element-1_6.gold-html new file mode 100644 index 000000000..20a7f3223 --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_6.gold-html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Unmatched elements + </h3> + <p> + <span class="bold"><strong>[non-element]</strong></span> + </p> + <p> + [non-element] + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/unmatched_element-1_6.quickbook b/src/boost/tools/quickbook/test/unmatched_element-1_6.quickbook new file mode 100644 index 000000000..689e9828a --- /dev/null +++ b/src/boost/tools/quickbook/test/unmatched_element-1_6.quickbook @@ -0,0 +1,12 @@ +[article Unmatched elements +[quickbook 1.6] +] + +[template identity[x] + +[x] +] + +[* [non-element]] + +[identity [non-element]]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/utf16be_bom-1_5-fail.quickbook b/src/boost/tools/quickbook/test/utf16be_bom-1_5-fail.quickbook Binary files differnew file mode 100644 index 000000000..be2bcbc44 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf16be_bom-1_5-fail.quickbook diff --git a/src/boost/tools/quickbook/test/utf16le_bom-1_5-fail.quickbook b/src/boost/tools/quickbook/test/utf16le_bom-1_5-fail.quickbook Binary files differnew file mode 100644 index 000000000..d9782a465 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf16le_bom-1_5-fail.quickbook diff --git a/src/boost/tools/quickbook/test/utf8-1_5.gold b/src/boost/tools/quickbook/test/utf8-1_5.gold new file mode 100644 index 000000000..088b314b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8-1_5.gold @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="utf_8_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>UTF-8 test</title> + <bridgehead renderas="sect2" id="utf_8_test.h0"> + <phrase id="utf_8_test.i__t__rn__ti__n__liz__ti__n"/><link linkend="utf_8_test.i__t__rn__ti__n__liz__ti__n">Iñtërnâtiônàlizætiøn</link> + </bridgehead> + <itemizedlist> + <listitem> + <simpara> + Αα Alpha + </simpara> + </listitem> + <listitem> + <simpara> + Ββ Beta + </simpara> + </listitem> + <listitem> + <simpara> + Γγ Gamma + </simpara> + </listitem> + <listitem> + <simpara> + Δδ Delta + </simpara> + </listitem> + <listitem> + <simpara> + Εε Epsilon + </simpara> + </listitem> + <listitem> + <simpara> + Ζζ Zeta + </simpara> + </listitem> + <listitem> + <simpara> + Ηη Eta + </simpara> + </listitem> + <listitem> + <simpara> + Θθ Theta + </simpara> + </listitem> + <listitem> + <simpara> + Ιι Iota + </simpara> + </listitem> + <listitem> + <simpara> + Κκ Kappa + </simpara> + </listitem> + <listitem> + <simpara> + Λλ Lambda + </simpara> + </listitem> + <listitem> + <simpara> + Μμ Mu + </simpara> + </listitem> + <listitem> + <simpara> + Νν Nu + </simpara> + </listitem> + <listitem> + <simpara> + Ξξ Xi + </simpara> + </listitem> + <listitem> + <simpara> + Οο Omicron + </simpara> + </listitem> + <listitem> + <simpara> + Ππ Pi + </simpara> + </listitem> + <listitem> + <simpara> + Ρρ Rho + </simpara> + </listitem> + <listitem> + <simpara> + Σσς Sigma + </simpara> + </listitem> + <listitem> + <simpara> + Ττ Tau + </simpara> + </listitem> + <listitem> + <simpara> + Υυ Upsilon + </simpara> + </listitem> + <listitem> + <simpara> + Φφ Phi + </simpara> + </listitem> + <listitem> + <simpara> + Χχ Chi + </simpara> + </listitem> + <listitem> + <simpara> + Ψψ Psi + </simpara> + </listitem> + <listitem> + <simpara> + Ωω Omega + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/utf8-1_5.gold-html b/src/boost/tools/quickbook/test/utf8-1_5.gold-html new file mode 100644 index 000000000..adf6b9569 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8-1_5.gold-html @@ -0,0 +1,134 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + UTF-8 test + </h3> + <h2 id="utf_8_test.i__t__rn__ti__n__liz__ti__n"> + Iñtërnâtiônàlizætiøn + </h2> + <ul> + <li> + <div> + Αα Alpha + </div> + </li> + <li> + <div> + Ββ Beta + </div> + </li> + <li> + <div> + Γγ Gamma + </div> + </li> + <li> + <div> + Δδ Delta + </div> + </li> + <li> + <div> + Εε Epsilon + </div> + </li> + <li> + <div> + Ζζ Zeta + </div> + </li> + <li> + <div> + Ηη Eta + </div> + </li> + <li> + <div> + Θθ Theta + </div> + </li> + <li> + <div> + Ιι Iota + </div> + </li> + <li> + <div> + Κκ Kappa + </div> + </li> + <li> + <div> + Λλ Lambda + </div> + </li> + <li> + <div> + Μμ Mu + </div> + </li> + <li> + <div> + Νν Nu + </div> + </li> + <li> + <div> + Ξξ Xi + </div> + </li> + <li> + <div> + Οο Omicron + </div> + </li> + <li> + <div> + Ππ Pi + </div> + </li> + <li> + <div> + Ρρ Rho + </div> + </li> + <li> + <div> + Σσς Sigma + </div> + </li> + <li> + <div> + Ττ Tau + </div> + </li> + <li> + <div> + Υυ Upsilon + </div> + </li> + <li> + <div> + Φφ Phi + </div> + </li> + <li> + <div> + Χχ Chi + </div> + </li> + <li> + <div> + Ψψ Psi + </div> + </li> + <li> + <div> + Ωω Omega + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/utf8-1_5.quickbook b/src/boost/tools/quickbook/test/utf8-1_5.quickbook new file mode 100644 index 000000000..96f02f4f4 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8-1_5.quickbook @@ -0,0 +1,30 @@ +[article UTF-8 test + [quickbook 1.5] +] + +[heading Iñtërnâtiônàlizætiøn] + +* Αα Alpha +* Ββ Beta +* Γγ Gamma +* Δδ Delta +* Εε Epsilon +* Ζζ Zeta +* Ηη Eta +* Θθ Theta +* Ιι Iota +* Κκ Kappa +* Λλ Lambda +* Μμ Mu +* Νν Nu +* Ξξ Xi +* Οο Omicron +* Ππ Pi +* Ρρ Rho +* Σσς Sigma +* Ττ Tau +* Υυ Upsilon +* Φφ Phi +* Χχ Chi +* Ψψ Psi +* Ωω Omega
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/utf8_bom-1_5.gold b/src/boost/tools/quickbook/test/utf8_bom-1_5.gold new file mode 100644 index 000000000..088b314b3 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8_bom-1_5.gold @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="utf_8_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>UTF-8 test</title> + <bridgehead renderas="sect2" id="utf_8_test.h0"> + <phrase id="utf_8_test.i__t__rn__ti__n__liz__ti__n"/><link linkend="utf_8_test.i__t__rn__ti__n__liz__ti__n">Iñtërnâtiônàlizætiøn</link> + </bridgehead> + <itemizedlist> + <listitem> + <simpara> + Αα Alpha + </simpara> + </listitem> + <listitem> + <simpara> + Ββ Beta + </simpara> + </listitem> + <listitem> + <simpara> + Γγ Gamma + </simpara> + </listitem> + <listitem> + <simpara> + Δδ Delta + </simpara> + </listitem> + <listitem> + <simpara> + Εε Epsilon + </simpara> + </listitem> + <listitem> + <simpara> + Ζζ Zeta + </simpara> + </listitem> + <listitem> + <simpara> + Ηη Eta + </simpara> + </listitem> + <listitem> + <simpara> + Θθ Theta + </simpara> + </listitem> + <listitem> + <simpara> + Ιι Iota + </simpara> + </listitem> + <listitem> + <simpara> + Κκ Kappa + </simpara> + </listitem> + <listitem> + <simpara> + Λλ Lambda + </simpara> + </listitem> + <listitem> + <simpara> + Μμ Mu + </simpara> + </listitem> + <listitem> + <simpara> + Νν Nu + </simpara> + </listitem> + <listitem> + <simpara> + Ξξ Xi + </simpara> + </listitem> + <listitem> + <simpara> + Οο Omicron + </simpara> + </listitem> + <listitem> + <simpara> + Ππ Pi + </simpara> + </listitem> + <listitem> + <simpara> + Ρρ Rho + </simpara> + </listitem> + <listitem> + <simpara> + Σσς Sigma + </simpara> + </listitem> + <listitem> + <simpara> + Ττ Tau + </simpara> + </listitem> + <listitem> + <simpara> + Υυ Upsilon + </simpara> + </listitem> + <listitem> + <simpara> + Φφ Phi + </simpara> + </listitem> + <listitem> + <simpara> + Χχ Chi + </simpara> + </listitem> + <listitem> + <simpara> + Ψψ Psi + </simpara> + </listitem> + <listitem> + <simpara> + Ωω Omega + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/utf8_bom-1_5.gold-html b/src/boost/tools/quickbook/test/utf8_bom-1_5.gold-html new file mode 100644 index 000000000..adf6b9569 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8_bom-1_5.gold-html @@ -0,0 +1,134 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + UTF-8 test + </h3> + <h2 id="utf_8_test.i__t__rn__ti__n__liz__ti__n"> + Iñtërnâtiônàlizætiøn + </h2> + <ul> + <li> + <div> + Αα Alpha + </div> + </li> + <li> + <div> + Ββ Beta + </div> + </li> + <li> + <div> + Γγ Gamma + </div> + </li> + <li> + <div> + Δδ Delta + </div> + </li> + <li> + <div> + Εε Epsilon + </div> + </li> + <li> + <div> + Ζζ Zeta + </div> + </li> + <li> + <div> + Ηη Eta + </div> + </li> + <li> + <div> + Θθ Theta + </div> + </li> + <li> + <div> + Ιι Iota + </div> + </li> + <li> + <div> + Κκ Kappa + </div> + </li> + <li> + <div> + Λλ Lambda + </div> + </li> + <li> + <div> + Μμ Mu + </div> + </li> + <li> + <div> + Νν Nu + </div> + </li> + <li> + <div> + Ξξ Xi + </div> + </li> + <li> + <div> + Οο Omicron + </div> + </li> + <li> + <div> + Ππ Pi + </div> + </li> + <li> + <div> + Ρρ Rho + </div> + </li> + <li> + <div> + Σσς Sigma + </div> + </li> + <li> + <div> + Ττ Tau + </div> + </li> + <li> + <div> + Υυ Upsilon + </div> + </li> + <li> + <div> + Φφ Phi + </div> + </li> + <li> + <div> + Χχ Chi + </div> + </li> + <li> + <div> + Ψψ Psi + </div> + </li> + <li> + <div> + Ωω Omega + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/utf8_bom-1_5.quickbook b/src/boost/tools/quickbook/test/utf8_bom-1_5.quickbook new file mode 100644 index 000000000..443f6c6c0 --- /dev/null +++ b/src/boost/tools/quickbook/test/utf8_bom-1_5.quickbook @@ -0,0 +1,30 @@ +[article UTF-8 test + [quickbook 1.5] +] + +[heading Iñtërnâtiônàlizætiøn] + +* Αα Alpha +* Ββ Beta +* Γγ Gamma +* Δδ Delta +* Εε Epsilon +* Ζζ Zeta +* Ηη Eta +* Θθ Theta +* Ιι Iota +* Κκ Kappa +* Λλ Lambda +* Μμ Mu +* Νν Nu +* Ξξ Xi +* Οο Omicron +* Ππ Pi +* Ρρ Rho +* Σσς Sigma +* Ττ Tau +* Υυ Upsilon +* Φφ Phi +* Χχ Chi +* Ψψ Psi +* Ωω Omega
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/variablelist-1_5-fail.quickbook b/src/boost/tools/quickbook/test/variablelist-1_5-fail.quickbook new file mode 100644 index 000000000..a7e589680 --- /dev/null +++ b/src/boost/tools/quickbook/test/variablelist-1_5-fail.quickbook @@ -0,0 +1,5 @@ +[article Parse error [quickbook 1.4]] + +[variablelist Variable List +[[1234]] +] diff --git a/src/boost/tools/quickbook/test/variablelist-1_5.gold b/src/boost/tools/quickbook/test/variablelist-1_5.gold new file mode 100644 index 000000000..08d66133e --- /dev/null +++ b/src/boost/tools/quickbook/test/variablelist-1_5.gold @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="variable_list_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Variable List Tests</title> + <variablelist> + <title>Empty</title> + </variablelist> + <variablelist> + <title>One entry</title> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + </listitem> + </varlistentry> + </variablelist> + <variablelist> + <title>One entry, multiple items</title> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + <para> + c + </para> + </listitem> + </varlistentry> + </variablelist> + <variablelist> + <title>Several entries</title> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + <para> + c + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + <para> + c + </para> + <para> + d + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + <para> + c + </para> + <para> + d + </para> + <para> + e + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>a</term> + <listitem> + <para> + b + </para> + </listitem> + </varlistentry> + </variablelist> + <anchor id="id1"/> + <variablelist> + <title>Variable List with anchors</title> + <varlistentry> + <term><anchor id="id2"/>a<anchor id="id3"/></term> + <listitem> + <para> + <anchor id="id4"/>b<anchor id="id5"/> + </para> + </listitem> + </varlistentry> + </variablelist> +</article> diff --git a/src/boost/tools/quickbook/test/variablelist-1_5.gold-html b/src/boost/tools/quickbook/test/variablelist-1_5.gold-html new file mode 100644 index 000000000..b430fdafd --- /dev/null +++ b/src/boost/tools/quickbook/test/variablelist-1_5.gold-html @@ -0,0 +1,103 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Variable List Tests + </h3> + <dl> + <dt> + a + </dt> + <dd> + <p> + b + </p> + </dd> + </dl> + <dl> + <dt> + a + </dt> + <dd> + <p> + b + </p> + <p> + c + </p> + </dd> + </dl> + <dl> + <dt> + a + </dt> + <dd> + <p> + b + </p> + </dd> + <dt> + a + </dt> + <dd> + <p> + b + </p> + <p> + c + </p> + </dd> + <dt> + a + </dt> + <dd> + <p> + b + </p> + <p> + c + </p> + <p> + d + </p> + </dd> + <dt> + a + </dt> + <dd> + <p> + b + </p> + <p> + c + </p> + <p> + d + </p> + <p> + e + </p> + </dd> + <dt> + a + </dt> + <dd> + <p> + b + </p> + </dd> + </dl> + <span id="id1"></span> + <dl> + <dt> + <span id="id2"></span>a<span id="id3"></span> + </dt> + <dd> + <p> + <span id="id4"></span>b<span id="id5"></span> + </p> + </dd> + </dl> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/variablelist-1_5.quickbook b/src/boost/tools/quickbook/test/variablelist-1_5.quickbook new file mode 100644 index 000000000..cb68a6df7 --- /dev/null +++ b/src/boost/tools/quickbook/test/variablelist-1_5.quickbook @@ -0,0 +1,30 @@ +[article Variable List Tests +[quickbook 1.5] +] + +[variablelist Empty +] + +[variablelist One entry + [[a][b]] +] + +[variablelist One entry, multiple items + [[a][b][c]] +] + +[variablelist Several entries + [[a][b]] + [[a][b][c]] + [[a][b][c][d]] + [[a][b][c][d][e]] + [[a][b]] +] + +[#id1] +[variablelist Variable List with anchors + [ + [[#id2]a[#id3]] + [[#id4]b[#id5]] + ] +] diff --git a/src/boost/tools/quickbook/test/version-0_1-fail.quickbook b/src/boost/tools/quickbook/test/version-0_1-fail.quickbook new file mode 100644 index 000000000..ac3c51250 --- /dev/null +++ b/src/boost/tools/quickbook/test/version-0_1-fail.quickbook @@ -0,0 +1,5 @@ +[article Non-existent version of quickbook + [quickbook 0.1] +] + +This should fail...
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/version-1_8-fail.quickbook b/src/boost/tools/quickbook/test/version-1_8-fail.quickbook new file mode 100644 index 000000000..4311034ba --- /dev/null +++ b/src/boost/tools/quickbook/test/version-1_8-fail.quickbook @@ -0,0 +1,5 @@ +[article Future version of quickbook + [quickbook 1.8] +] + +This should fail...
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/version-2_0-fail.quickbook b/src/boost/tools/quickbook/test/version-2_0-fail.quickbook new file mode 100644 index 000000000..973b174f6 --- /dev/null +++ b/src/boost/tools/quickbook/test/version-2_0-fail.quickbook @@ -0,0 +1,5 @@ +[article Far future version of quickbook + [quickbook 2.0] +] + +This should fail...
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/versions/Jamfile.v2 b/src/boost/tools/quickbook/test/versions/Jamfile.v2 new file mode 100644 index 000000000..dd185d587 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/Jamfile.v2 @@ -0,0 +1,19 @@ +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test/versions + : requirements + <toolset>msvc:<debug-symbols>off + ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test versions-1_6 ] + [ quickbook-test invalid_macro-1_6 ] + ; diff --git a/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold new file mode 100644 index 000000000..cb6241247 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="invalid_macro_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Invalid macro test</title> + <para> + Import: + </para> + <itemizedlist> + <listitem> + <simpara> + okay + </simpara> + </listitem> + <listitem> + <simpara> + __invalid\macro__ + </simpara> + </listitem> + </itemizedlist> + <para> + Include: + </para> + <itemizedlist> + <listitem> + <simpara> + okay + </simpara> + </listitem> + <listitem> + <simpara> + bad + </simpara> + </listitem> + </itemizedlist> +</article> diff --git a/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold-html b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold-html new file mode 100644 index 000000000..52455ec95 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.gold-html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Invalid macro test + </h3> + <p> + Import: + </p> + <ul> + <li> + <div> + okay + </div> + </li> + <li> + <div> + __invalid\macro__ + </div> + </li> + </ul> + <p> + Include: + </p> + <ul> + <li> + <div> + okay + </div> + </li> + <li> + <div> + bad + </div> + </li> + </ul> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.quickbook b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.quickbook new file mode 100644 index 000000000..860d58b71 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/invalid_macro-1_6.quickbook @@ -0,0 +1,14 @@ +[article Invalid macro test +[quickbook 1.6] +] + +Import: + +[import invalid_macro-inc-1_1.quickbook] + +* __valid__ +* __invalid\macro__ + +Include: + +[include invalid_macro-inc-1_1.quickbook] diff --git a/src/boost/tools/quickbook/test/versions/invalid_macro-inc-1_1.quickbook b/src/boost/tools/quickbook/test/versions/invalid_macro-inc-1_1.quickbook new file mode 100644 index 000000000..c44bd6741 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/invalid_macro-inc-1_1.quickbook @@ -0,0 +1,7 @@ +[quickbook 1.1] + +[def __valid__ okay] +[def __invalid\macro__ bad] + +* __valid__ +* __invalid\macro__ diff --git a/src/boost/tools/quickbook/test/versions/templates-inc-1_1.quickbook b/src/boost/tools/quickbook/test/versions/templates-inc-1_1.quickbook new file mode 100644 index 000000000..be5365055 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/templates-inc-1_1.quickbook @@ -0,0 +1,15 @@ +[article 1.1 Templates +[quickbook 1.1] +] + +[template section_1_1[] +[section In a 1.1 template] +Some text +[endsect] +] + +[section 1.1 Document] +[section_1_1] +[section_1_4] +[section_1_5] +[endsect] diff --git a/src/boost/tools/quickbook/test/versions/templates-inc-1_4.quickbook b/src/boost/tools/quickbook/test/versions/templates-inc-1_4.quickbook new file mode 100644 index 000000000..8b565512d --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/templates-inc-1_4.quickbook @@ -0,0 +1,20 @@ +[article 1.4 Templates +[quickbook 1.4] +] + +[template section_1_4[] +[section In a 1.4 template] +Some text +[endsect] +] + +[section 1.4 Document] +[section_1_1] +[section_1_4] +[section_1_5] +[endsect] + +[/ Odd test for calling 1.4 -> 1.5 -> 1.4 template] + +[template skip_1_5[a] [skip_1_5_2 wrong]] +[template skip_1_5_3[] [a]] diff --git a/src/boost/tools/quickbook/test/versions/templates-inc-1_5.quickbook b/src/boost/tools/quickbook/test/versions/templates-inc-1_5.quickbook new file mode 100644 index 000000000..9dd07f693 --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/templates-inc-1_5.quickbook @@ -0,0 +1,19 @@ +[article 1.5 Templates +[quickbook 1.5] +] + +[template section_1_5[] +[section In a 1.5 template] +Some text +[endsect] +] + +[section 1.5 Document] +[section_1_1] +[section_1_4] +[section_1_5] +[endsect] + +[/ Odd test for calling 1.4 -> 1.5 -> 1.4 template] + +[template skip_1_5_2[a] [skip_1_5_3]] diff --git a/src/boost/tools/quickbook/test/versions/versions-1_6.gold b/src/boost/tools/quickbook/test/versions/versions-1_6.gold new file mode 100644 index 000000000..7b89fdc3d --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/versions-1_6.gold @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="mixed_version_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Mixed version tests</title> + <para> + correct + </para> + <section id="mixed_version_tests.section_ids"> + <title><link linkend="mixed_version_tests.section_ids">Section ids in templates</link></title> + <section id="mixed_version_tests.section_ids.in_a_1_1_template"> + <title><link linkend="mixed_version_tests.section_ids.in_a_1_1_template">In + a 1.1 template</link></title> + <para> + Some text + </para> + </section> + <section id="mixed_version_tests.section_ids.in_a_1_4_template"> + <title><link linkend="mixed_version_tests.section_ids.in_a_1_4_template">In + a 1.4 template</link></title> + <para> + Some text + </para> + </section> + <section id="mixed_version_tests.section_ids.in_a_1_5_template"> + <title><link linkend="mixed_version_tests.section_ids.in_a_1_5_template">In + a 1.5 template</link></title> + <para> + Some text + </para> + </section> + </section> + <article id="1_1_templates" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>1.1 Templates</title> + <section id="1_1_templates.1_1_document"> + <title>1.1 Document</title> + <section id="1_1_templates.in_a_1_1_template"> + <title>In a 1.1 template</title> + <para> + Some text + </para> + </section> + <section id="1_1_templates.in_a_1_4_template"> + <title>In a 1.4 template</title> + <para> + Some text + </para> + </section> + <section id="1_1_templates.in_a_1_5_template"> + <title>In a 1.5 template</title> + <para> + Some text + </para> + </section> + </section> + </article> + <article id="1_4_templates" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>1.4 Templates</title> + <section id="1_4_templates.1_4_document"> + <title><link linkend="1_4_templates.1_4_document">1.4 Document</link></title> + <section id="1_4_templates.1_4_document.in_a_1_1_template"> + <title><link linkend="1_4_templates.1_4_document.in_a_1_1_template">In a + 1.1 template</link></title> + <para> + Some text + </para> + </section> + <section id="1_4_templates.1_4_document.in_a_1_4_template"> + <title><link linkend="1_4_templates.1_4_document.in_a_1_4_template">In a + 1.4 template</link></title> + <para> + Some text + </para> + </section> + <section id="1_4_templates.1_4_document.in_a_1_5_template"> + <title><link linkend="1_4_templates.1_4_document.in_a_1_5_template">In a + 1.5 template</link></title> + <para> + Some text + </para> + </section> + </section> + </article> + <article id="1_5_templates" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>1.5 Templates</title> + <section id="1_5_templates.1_5_document"> + <title><link linkend="1_5_templates.1_5_document">1.5 Document</link></title> + <section id="1_5_templates.1_5_document.in_a_1_1_template"> + <title><link linkend="1_5_templates.1_5_document.in_a_1_1_template">In a + 1.1 template</link></title> + <para> + Some text + </para> + </section> + <section id="1_5_templates.1_5_document.in_a_1_4_template"> + <title><link linkend="1_5_templates.1_5_document.in_a_1_4_template">In a + 1.4 template</link></title> + <para> + Some text + </para> + </section> + <section id="1_5_templates.1_5_document.in_a_1_5_template"> + <title><link linkend="1_5_templates.1_5_document.in_a_1_5_template">In a + 1.5 template</link></title> + <para> + Some text + </para> + </section> + </section> + </article> +</article> diff --git a/src/boost/tools/quickbook/test/versions/versions-1_6.gold-html b/src/boost/tools/quickbook/test/versions/versions-1_6.gold-html new file mode 100644 index 000000000..f895a387f --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/versions-1_6.gold-html @@ -0,0 +1,239 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Mixed version tests + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#mixed_version_tests.section_ids">Section ids in templates</a> + </li> + <li> + <a href="#1_1_templates">1.1 Templates</a> + <ul> + <li> + <a href="#1_1_templates.1_1_document">1.1 Document</a> + </li> + </ul> + </li> + <li> + <a href="#1_4_templates">1.4 Templates</a> + <ul> + <li> + <a href="#1_4_templates.1_4_document">1.4 Document</a> + </li> + </ul> + </li> + <li> + <a href="#1_5_templates">1.5 Templates</a> + <ul> + <li> + <a href="#1_5_templates.1_5_document">1.5 Document</a> + </li> + </ul> + </li> + </ul> + </div> + <p> + correct + </p> + <div id="mixed_version_tests.section_ids"> + <h3> + Section ids in templates + </h3> + <div id="mixed_version_tests.section_ids"> + </div> + <div id="mixed_version_tests.section_ids.in_a_1_1_template"> + <h3> + In a 1.1 template + </h3> + <div id="mixed_version_tests.section_ids.in_a_1_1_template"> + <p> + Some text + </p> + </div> + </div> + <div id="mixed_version_tests.section_ids.in_a_1_4_template"> + <h3> + In a 1.4 template + </h3> + <div id="mixed_version_tests.section_ids.in_a_1_4_template"> + <p> + Some text + </p> + </div> + </div> + <div id="mixed_version_tests.section_ids.in_a_1_5_template"> + <h3> + In a 1.5 template + </h3> + <div id="mixed_version_tests.section_ids.in_a_1_5_template"> + <p> + Some text + </p> + </div> + </div> + </div> + <div id="1_1_templates"> + <h3> + 1.1 Templates + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#1_1_templates.1_1_document">1.1 Document</a> + </li> + </ul> + </div> + <div id="1_1_templates.1_1_document"> + <h3> + 1.1 Document + </h3> + <div id="1_1_templates.1_1_document"> + </div> + <div id="1_1_templates.in_a_1_1_template"> + <h3> + In a 1.1 template + </h3> + <div id="1_1_templates.in_a_1_1_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_1_templates.in_a_1_4_template"> + <h3> + In a 1.4 template + </h3> + <div id="1_1_templates.in_a_1_4_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_1_templates.in_a_1_5_template"> + <h3> + In a 1.5 template + </h3> + <div id="1_1_templates.in_a_1_5_template"> + <p> + Some text + </p> + </div> + </div> + </div> + </div> + <div id="1_4_templates"> + <h3> + 1.4 Templates + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#1_4_templates.1_4_document">1.4 Document</a> + </li> + </ul> + </div> + <div id="1_4_templates.1_4_document"> + <h3> + 1.4 Document + </h3> + <div id="1_4_templates.1_4_document"> + </div> + <div id="1_4_templates.1_4_document.in_a_1_1_template"> + <h3> + In a 1.1 template + </h3> + <div id="1_4_templates.1_4_document.in_a_1_1_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_4_templates.1_4_document.in_a_1_4_template"> + <h3> + In a 1.4 template + </h3> + <div id="1_4_templates.1_4_document.in_a_1_4_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_4_templates.1_4_document.in_a_1_5_template"> + <h3> + In a 1.5 template + </h3> + <div id="1_4_templates.1_4_document.in_a_1_5_template"> + <p> + Some text + </p> + </div> + </div> + </div> + </div> + <div id="1_5_templates"> + <h3> + 1.5 Templates + </h3> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#1_5_templates.1_5_document">1.5 Document</a> + </li> + </ul> + </div> + <div id="1_5_templates.1_5_document"> + <h3> + 1.5 Document + </h3> + <div id="1_5_templates.1_5_document"> + </div> + <div id="1_5_templates.1_5_document.in_a_1_1_template"> + <h3> + In a 1.1 template + </h3> + <div id="1_5_templates.1_5_document.in_a_1_1_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_5_templates.1_5_document.in_a_1_4_template"> + <h3> + In a 1.4 template + </h3> + <div id="1_5_templates.1_5_document.in_a_1_4_template"> + <p> + Some text + </p> + </div> + </div> + <div id="1_5_templates.1_5_document.in_a_1_5_template"> + <h3> + In a 1.5 template + </h3> + <div id="1_5_templates.1_5_document.in_a_1_5_template"> + <p> + Some text + </p> + </div> + </div> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/versions/versions-1_6.quickbook b/src/boost/tools/quickbook/test/versions/versions-1_6.quickbook new file mode 100644 index 000000000..fed5a93ea --- /dev/null +++ b/src/boost/tools/quickbook/test/versions/versions-1_6.quickbook @@ -0,0 +1,26 @@ +[quickbook 1.6] +[article Mixed version tests] + +[import templates-inc-1_1.quickbook] +[import templates-inc-1_4.quickbook] +[import templates-inc-1_5.quickbook] + +[/ This test calls a 1.4 template -> 1.5 template -> 1.4 template. + The name lookup in the 1.4 template should skip the 1.5 template + when doing dynamic name lookup. ] +[skip_1_5 correct] + +[/ When calling templates from old versions, the ids should + be consistent with their context ] + +[section:section_ids Section ids in templates] +[section_1_1] +[section_1_4] +[section_1_5] +[endsect] + +[/ For comparison] + +[include templates-inc-1_1.quickbook] +[include templates-inc-1_4.quickbook] +[include templates-inc-1_5.quickbook] diff --git a/src/boost/tools/quickbook/test/xinclude/Jamfile.v2 b/src/boost/tools/quickbook/test/xinclude/Jamfile.v2 new file mode 100644 index 000000000..4e18d4f17 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/Jamfile.v2 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2005 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test/xinclude + : requirements + <toolset>msvc:<debug-symbols>off + ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +path-constant xinclude_base1 : ../.. ; +path-constant xinclude_base2 : sub ; +path-constant xinclude_base3 : . ; + +test-suite quickbook.test : + [ quickbook-test xinclude-1_1 : : : <quickbook-xinclude-base>$(xinclude_base1) ] + [ quickbook-test xmlbase1-1_6 : : : <quickbook-xinclude-base>$(xinclude_base1) ] + [ quickbook-test xmlbase2-1_6 : : : <quickbook-xinclude-base>$(xinclude_base1) ] + [ quickbook-test xinclude-1_1-alt : xinclude-1_1.quickbook : xinclude-1_1-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ] + [ quickbook-test xmlbase1-1_6-alt : xmlbase1-1_6.quickbook : xmlbase1-1_6-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ] + [ quickbook-test xmlbase2-1_6-alt : xmlbase2-1_6.quickbook : xmlbase2-1_6-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ] + [ quickbook-test xinclude-1_1-alt2 : xinclude-1_1.quickbook : xinclude-1_1-alt2.gold : <quickbook-xinclude-base>$(xinclude_base3) ] + [ quickbook-test xmlbase1-1_6-alt2 : xmlbase1-1_6.quickbook : xmlbase1-1_6-alt2.gold : <quickbook-xinclude-base>$(xinclude_base3) ] + [ quickbook-test xmlbase2-1_6-alt2 : xmlbase2-1_6.quickbook : xmlbase2-1_6-alt2.gold : <quickbook-xinclude-base>$(xinclude_base3) ] + [ quickbook-error-test xmlbase-1_6-fail ] + ; diff --git a/src/boost/tools/quickbook/test/xinclude/sub/boost-no-inspect b/src/boost/tools/quickbook/test/xinclude/sub/boost-no-inspect new file mode 100644 index 000000000..099a233ec --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/sub/boost-no-inspect @@ -0,0 +1,2 @@ +This directory just contains simple test files, which might be disrupted by +adding copyright etc. diff --git a/src/boost/tools/quickbook/test/xinclude/sub/stub.xml b/src/boost/tools/quickbook/test/xinclude/sub/stub.xml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/sub/stub.xml diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold new file mode 100644 index 000000000..cffe5296c --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include</title> + <xi:include href="../../stub.xml" /> + <xi:include href="../stub.xml" /> + <xi:include href="stub.xml" /> + <xi:include href="../../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold-html b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold-html new file mode 100644 index 000000000..8046a7261 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt2.gold b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt2.gold new file mode 100644 index 000000000..7c2e40063 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1-alt2.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include</title> + <xi:include href="../stub.xml" /> + <xi:include href="stub.xml" /> + <xi:include href="sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold new file mode 100644 index 000000000..0a5707f78 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Include</title> + <xi:include href="test/stub.xml" /> + <xi:include href="test/xinclude/stub.xml" /> + <xi:include href="test/xinclude/sub/stub.xml" /> + <xi:include href="test/xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold-html b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold-html new file mode 100644 index 000000000..8046a7261 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Include + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.quickbook b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.quickbook new file mode 100644 index 000000000..9405e4e78 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xinclude-1_1.quickbook @@ -0,0 +1,6 @@ +[article Include] + +[xinclude ../stub.xml] +[xinclude stub.xml] +[xinclude sub/stub.xml] +[xinclude ../xinclude] diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase-1_6-fail.quickbook b/src/boost/tools/quickbook/test/xinclude/xmlbase-1_6-fail.quickbook new file mode 100644 index 000000000..899b4a2b4 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase-1_6-fail.quickbook @@ -0,0 +1,4 @@ +[article Xmlbase fail +[quickbook 1.5] +[xmlbase non-existent] +] diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold new file mode 100644 index 000000000..29a84ca26 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="../" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="stub.xml" /> + <xi:include href="sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold-html b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold-html new file mode 100644 index 000000000..76a1871b7 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + XInclude with xmlbase + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt2.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt2.gold new file mode 100644 index 000000000..1c2ccc2fc --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6-alt2.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="./" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="stub.xml" /> + <xi:include href="sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold new file mode 100644 index 000000000..4c97e0de9 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="test/xinclude/" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="stub.xml" /> + <xi:include href="sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold-html b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold-html new file mode 100644 index 000000000..76a1871b7 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + XInclude with xmlbase + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook new file mode 100644 index 000000000..2656c7abf --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook @@ -0,0 +1,9 @@ +[article XInclude with xmlbase +[quickbook 1.6] +[xmlbase .] +] + +[xinclude ../stub.xml] +[xinclude stub.xml] +[xinclude sub/stub.xml] +[xinclude ../xinclude] diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold new file mode 100644 index 000000000..6cfa197b5 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="../../include/" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="../xinclude/stub.xml" /> + <xi:include href="../xinclude/sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold-html b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold-html new file mode 100644 index 000000000..76a1871b7 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + XInclude with xmlbase + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt2.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt2.gold new file mode 100644 index 000000000..e3b2f6274 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6-alt2.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="../include/" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="../xinclude/stub.xml" /> + <xi:include href="../xinclude/sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold new file mode 100644 index 000000000..f3507d337 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xml:base="test/include/" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>XInclude with xmlbase</title> + <xi:include href="../stub.xml" /> + <xi:include href="../xinclude/stub.xml" /> + <xi:include href="../xinclude/sub/stub.xml" /> + <xi:include href="../xinclude" /> +</article> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold-html b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold-html new file mode 100644 index 000000000..76a1871b7 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.gold-html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + XInclude with xmlbase + </h3> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook new file mode 100644 index 000000000..252bacca1 --- /dev/null +++ b/src/boost/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook @@ -0,0 +1,9 @@ +[article XInclude with xmlbase +[quickbook 1.6] +[xmlbase ../include] +] + +[xinclude ../stub.xml] +[xinclude stub.xml] +[xinclude sub/stub.xml] +[xinclude ../xinclude] diff --git a/src/boost/tools/quickbook/test/xml_escape-1_2.gold b/src/boost/tools/quickbook/test/xml_escape-1_2.gold new file mode 100644 index 000000000..bd28ae439 --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_2.gold @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="test_that__amp____lt__are_being_escaped_" name="Test that &, < are being escaped." +dirname="test_that__amp____lt__are_being_escaped_" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <legalnotice id="test_that__amp____lt__are_being_escaped_.legal"> + <para> + & should be &amp;, < should &lt; + </para> + </legalnotice> + <librarypurpose> + & should be &amp;, < should &lt; + </librarypurpose> + </libraryinfo> + <title>Test that &, < are being escaped.</title> + <section id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <title>Escapes & explicitly written markup</title> + <itemizedlist> + <listitem> + <simpara> + & -> &amp; + </simpara> + </listitem> + <listitem> + <simpara> + < -> &lt; + </simpara> + </listitem> + <listitem> + <simpara> + > -> &gt; + </simpara> + </listitem> + <listitem> + <simpara> + " -> &quot; + </simpara> + </listitem> + </itemizedlist> + </section> +</library> diff --git a/src/boost/tools/quickbook/test/xml_escape-1_2.gold-html b/src/boost/tools/quickbook/test/xml_escape-1_2.gold-html new file mode 100644 index 000000000..4b4bd7529 --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_2.gold-html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test that &, < are being escaped. + </h3> + <div class="legalnotice"> + <p> + & should be &amp;, < should &lt; + </p> + </div> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup">Escapes + & explicitly written markup</a> + </li> + </ul> + </div> + <div id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <h3> + Escapes & explicitly written markup + </h3> + <div id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <ul> + <li> + <div> + & -> &amp; + </div> + </li> + <li> + <div> + < -> &lt; + </div> + </li> + <li> + <div> + > -> &gt; + </div> + </li> + <li> + <div> + " -> &quot; + </div> + </li> + </ul> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xml_escape-1_2.quickbook b/src/boost/tools/quickbook/test/xml_escape-1_2.quickbook new file mode 100644 index 000000000..66a6086cc --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_2.quickbook @@ -0,0 +1,14 @@ +[library Test that &, < are being escaped. + [quickbook 1.2] + [purpose & should be &amp;, < should &lt;] + [license & should be &amp;, < should &lt;] +] + +[section Escapes & explicitly written markup] + +* & -> & +* < -> < +* > -> > +* " -> " + +[endsect]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/xml_escape-1_5.gold b/src/boost/tools/quickbook/test/xml_escape-1_5.gold new file mode 100644 index 000000000..f8f33edd2 --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_5.gold @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<library id="test_that__amp____lt__are_being_escaped_" name="Test that &, < are being escaped." +dirname="test_that__amp____lt__are_being_escaped_" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <libraryinfo> + <legalnotice id="test_that__amp____lt__are_being_escaped_.legal"> + <para> + & should be &amp;, < should &lt; + </para> + </legalnotice> + <librarypurpose> + & should be &amp;, < should &lt; + </librarypurpose> + </libraryinfo> + <title>Test that &, < are being escaped.</title> + <section id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <title><link linkend="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup">Escapes + & explicitly written markup</link></title> + <itemizedlist> + <listitem> + <simpara> + & -> &amp; + </simpara> + </listitem> + <listitem> + <simpara> + < -> &lt; + </simpara> + </listitem> + <listitem> + <simpara> + > -> &gt; + </simpara> + </listitem> + <listitem> + <simpara> + " -> &quot; + </simpara> + </listitem> + </itemizedlist> + </section> +</library> diff --git a/src/boost/tools/quickbook/test/xml_escape-1_5.gold-html b/src/boost/tools/quickbook/test/xml_escape-1_5.gold-html new file mode 100644 index 000000000..4b4bd7529 --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_5.gold-html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Test that &, < are being escaped. + </h3> + <div class="legalnotice"> + <p> + & should be &amp;, < should &lt; + </p> + </div> + <div class="toc"> + <p> + <b>Table of contents</b> + </p> + <ul> + <li> + <a href="#test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup">Escapes + & explicitly written markup</a> + </li> + </ul> + </div> + <div id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <h3> + Escapes & explicitly written markup + </h3> + <div id="test_that__amp____lt__are_being_escaped_.escapes___explicitly_written_markup"> + <ul> + <li> + <div> + & -> &amp; + </div> + </li> + <li> + <div> + < -> &lt; + </div> + </li> + <li> + <div> + > -> &gt; + </div> + </li> + <li> + <div> + " -> &quot; + </div> + </li> + </ul> + </div> + </div> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/xml_escape-1_5.quickbook b/src/boost/tools/quickbook/test/xml_escape-1_5.quickbook new file mode 100644 index 000000000..642e1b537 --- /dev/null +++ b/src/boost/tools/quickbook/test/xml_escape-1_5.quickbook @@ -0,0 +1,14 @@ +[library Test that &, < are being escaped. + [quickbook 1.5] + [purpose & should be &, < should <] + [license & should be &, < should <] +] + +[section Escapes & explicitly written markup] + +* & -> & +* < -> < +* > -> > +* " -> " + +[endsect]
\ No newline at end of file |