From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001
From: Daniel Baumann
+ Table of contents
+
+ A paragraph containing several anchors. We
+ want to make sure they appear in the correct place.
+
+ Some text.
+
+ Text content
+
+ Heading
+
+ Cell 1
+
+ Cell 2
+
+ Cell 3
+
+ Table of contents
+
+ A paragraph containing several anchors. We
+ want to make sure they appear in the correct place.
+
+ Some text.
+
+ Text content
+
+ Heading
+
+ Cell 1
+
+ Cell 2
+
+ Cell 3
+
+ Table of contents
+
+ A paragraph containing several anchors. We
+ want to make sure they appear in the correct place.
+
+ Some text.
+
+ Text content
+
+ Heading
+
+ Cell 1
+
+ Cell 2
+
+ Cell 3
+
+ Here's a blockquote:
+
+ Blockquote.
+
+ And another:
+
+ Blockquote first paragraph.
+
+ Blockquote second paragraph.
+
+ Warning
+
+ Caution
+
+ Important
+
+ Note
+
+ Tip
+
+ Warning first paragraph.
+
+ Warning second paragraph.
+
+ Blurb
+
+ Blockquote containing a footnote[1].
+
+ [tipping point]
+
+ Multiple paragraphs because of the inline blocks.
+
+ Warning
+
+ This line should appear as a separate paragraph.
+
+ Warning
+
+ Table of contents
+
+ Example 1:
+
+ Now we can define a function that simulates an ordinary six-sided die.
+
+
+
+
+ Anchor Test
+
+
+
+
+ Anchors
+
+
+ This heading shouldn't pick up the previous anchor
+
+
+
+ This heading should pick up the previous anchor
+
+
+
+ And this one
+
+
+
+ Also this one
+
+
+
+ Finally this
+
+
+
+ Section Anchor
+
+
+ Nested Section
+
+
+ Conditional Section Anchor
+
+
+ Lists
+
+
+
+
+
+
+ Anchors in templates
+
+
+ Anchors in syntax highlighted code
+
+ int main() {}
+
+
+ Nested anchors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Anchor Test
+
+
+
+
+ Anchors
+
+
+ This heading shouldn't pick up the previous anchor
+
+
+
+ This heading should pick up the previous anchor
+
+
+
+ And this one
+
+
+
+ Also this one
+
+
+
+ Finally this
+
+
+
+ Section Anchor
+
+
+ Nested Section
+
+
+ Conditional Section Anchor
+
+
+ Lists
+
+
+
+
+
+
+ Anchors in templates
+
+
+ Anchors in syntax highlighted code
+
+ int main() {}
+
+
+ Nested anchors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Anchors with escapes
+
+
+
+
+ Anchor Test
+
+
+
+
+ Anchors
+
+
+ This heading shouldn't pick up the previous anchor
+
+
+
+ This heading should pick up the previous anchor
+
+
+
+ And this one
+
+
+
+ Also this one
+
+
+
+ Finally this
+
+
+
+ Section Anchor
+
+
+ Nested Section
+
+
+ Conditional Section Anchor
+
+
+ Lists
+
+
+
+
+
+
+ Anchors in templates
+
+
+ Anchors in syntax highlighted code
+
+ int main() {}
+
+
+ Nested anchors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Anchors with templates
+
+
+
+
+
+
+
+
+ Various blocks
+
+
+ Blockquotes
+
+
+
+
+
+
+ Admonitions
+
+
+ Blurb
+
+
+ Inline blocks
+
+
+
+
+
+
+
+
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 @@
+
+
+
+ Callout Tests
+
+
+
+ int roll_die() {
+ boost::uniform_int<> dist(1, 6); (1)
+}
+
+
+ create a uniform_int distribution +
++ Example 2: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 3: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 3 (again!): +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 4: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); + (2)boost::uniform_int<> dist(1, 6); (3) +} ++ +
+ callout 1 +
++ callout 2 +
++ create a uniform_int distribution +
++
(1)boost::uniform_int<> dist(1, 6); (2) ++ + +
+ Example 1: +
++ Now we can define a function that simulates an ordinary six-sided die. +
++
int roll_die() { + boost::uniform_int<> dist(1, 6); (1) +} ++ +
+ create a uniform_int distribution +
++ Example 2: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 3: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 3 (again!): +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++ +
+ test +
++ Example 4: +
++
int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); + (2)boost::uniform_int<> dist(1, 6); (3) +} ++ +
+ callout 1 +
++ callout 2 +
++ create a uniform_int distribution +
++
(1)boost::uniform_int<> dist(1, 6); (2) ++ + +
/*< This shouldn't be a callout >*/
+ + Table of contents +
++ Example 1: +
++ Now we can define a function that simulates an ordinary six-sided die. +
+int roll_die() { + boost::uniform_int<> dist(1, 6); (1) +} ++
+ create a uniform_int distribution +
++ Example 2: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 3: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 3 (again!): +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 4: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); + (2)boost::uniform_int<> dist(1, 6); (3) +} ++
+ callout 1 +
++ callout 2 +
++ create a uniform_int distribution +
+(1)boost::uniform_int<> dist(1, 6); (2) ++ +
+ Example 1: +
++ Now we can define a function that simulates an ordinary six-sided die. +
+int roll_die() { + boost::uniform_int<> dist(1, 6); (1) +} ++
+ create a uniform_int distribution +
++ Example 2: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 3: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 3 (again!): +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
++ Example 4: +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); + (2)boost::uniform_int<> dist(1, 6); (3) +} ++
+ callout 1 +
++ callout 2 +
++ create a uniform_int distribution +
+(1)boost::uniform_int<> dist(1, 6); (2) ++ +
int roll_die() { + boost::uniform_int<> dist(1, 6); (1) +} ++
+ create a uniform_int distribution +
+int roll_die() { + (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); +} ++
+ test +
+
+ /*< This shouldn't be a callout >*/
+
+ Silly test(1) +
++ silly +
++ A code block with proper indentation ;-) +
+#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} ++
+ A code block with proper indentation ;-) +
++
#include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} ++ +
+
print "\xfabln\xeck" ++ +
+ This isn't valid C++ but I think we should accept it; +
++
std::cout<<"\xfabln\xeck"<<"\n"; ++ +
+ 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. +
+First code block. ++
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-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 @@ + + +
#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/optional/optional.hpp> +/* In Header: <boost/optional/optional.hpp> */ +/* Multiple escapes: italic + * underlinebold + */ +/* 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-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
# No escape +# Escape: bold +# Escape: underlineitalic ++ + 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 @@ + + +
namespace
+ quickbook {
+ static const
+ int value
+ = 0 ;
+ }
, should be properly formatted and
+ not glued to the surrounding text.
+ this
),
+ and spaces around this
code.
+ + Table of contents +
+
+ 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.
+
+ Table of contents +
+Just some plain text.
+With some quickbook thrown in?
+
+ + bold +
++ empty is defined +
+ + 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 @@ + + ++ This should show +
++ The should be no space inserted. +
++ Bold text +
+ + 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 @@ + + ++ This should show +
++ But this should show +
++ Weird macro is defined +
++ The should be no space inserted. +
++ Bold text +
+ + 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 @@ + + ++ 1963, 1964, 1965 Jane Doe +
++ 2018 Joe Blow, John Coe +
++ 1977, 1985 Someone else +
+ + 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 @@ + + ++ 2018 Joe Blow +
++ 1963 Jane Doe +
++ Public Domain +
++ Content +
+ + 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 @@ + + ++ 2018 Joe Blow +
++ 1963 Jane Doe +
++ Public Domain +
++ 2011 +
++ biblioid and source-mode can't be empty. +
+ + 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 @@ + + ++ Table of contents +
++ Hello +
++ Table of contents +
++ Hello +
+1 + 2
+ + 2010 Meðal-Jón and Jóna Jónsdóttir +
+ + 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 @@ + + +1 + 2
+ + 2010 Meðal-Jón and Jóna Jónsdóttir +
+ + 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 @@ + + ++ 1325 John Doe +
+ + 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] +'''+ Table of contents +
++ Table of contents +
+def foo ( x ):
+ print "Hello"
+ int main () {}
+
+ def foo(x):
+ print "Hello"
+
+
int main() {}+ +
+
def foo():+ +
+
def foo(x):+ +
+
int main() {}+ +
+
int main() {}+ + + 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 @@ + + +
def foo ( x ):
+ print "Hello"
+ This shouldn't be highlighted
+
+ def foo(x):
+ print "Hello"
+
+
This shouldn't be highlighted.+ +
+
int main() {}+ +
+
int main() {}+ +
+
def foo():+ +
+
def foo(x):+ +
+
This shouldn't be highlighted+ +
+
This shouldn't be highlighted.+ + + 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 @@ + + +
def foo ( x ):
+ print "Hello"
+ This shouldn't be highlighted
+
+ def foo(x):
+ print "Hello"
+
+ Table of contents +
+This shouldn't be highlighted.+
This shouldn't be highlighted.+
This shouldn't be highlighted.+
This shouldn't be highlighted.+
+
int main() {}+ +
+
def foo():+ +
+
This shouldn't be highlighted+ +
+ Table of contents +
++ Table of contents +
++ Table of contents +
++ Da do do do. Da da da da. That's all I have + to say to you. +
++ This letter α should have a space either side of it. +
++ These should be properly encoded: > < " +
++ This link shouldn't be changed. +
++ Some other problematic links: one, two, three. +
++ This will be escaped +
++ \[ generates [. \] generates ]. +
++ Table of contents +
++ Da do do do. Da da da da. That's all I have + to say to you. +
++ This letter α should have a space either side of it. +
++ These should be properly encoded: > < " +
++ This link shouldn't be changed. +
++ Some other problematic links: one, two, three. +
++ This will be escaped +
++ \[ generates [. \] generates ]. +
++ Table of contents +
++ [1] First footnote +
++ [2] Second footnote +
++ [3] Third footnote +
++ [4] Boostbook footnote +
++ [5] Footnote without id +
++ [6] Another footnote without an id +
++ Table of contents +
++ Testing headers without sections. +
++ Paragraph. +
++ Paragraph. +
+ + 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 @@ + + ++ Table of contents +
++
++ This should be displayed. +
++
++
++ * This shouldn't be a list +
++
++
++
++
++
+ + 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 @@ + + ++
++ This should be displayed. +
++
++
++ * This shouldn't be a list +
++
++
++
++ This should be displayed. Maybe that's wrong? +
++
++ Odd way to get text displayed. +
+ + 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 @@ + + + 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 @@ + + +code
+ heading
in heading
in heading
in heading
in heading
in heading
in + Table of contents +
+code
+ + | +
heading
in order
+ to test normalization
+ heading
in order
+ to test normalization
+ heading
in order
+ to test normalization
+ heading
in order to test normalization
+ heading
in order to test normalization
+ heading
in order to test normalization
+ + | +
+ | +
code
+ heading
in heading
in heading
in heading
in heading
in heading
in + Table of contents +
+code
+ + | +
heading
in order
+ to test normalization
+ heading
in order
+ to test normalization
+ heading
in order
+ to test normalization
+ heading
in order to test normalization
+ heading
in order to test normalization
+ heading
in order to test normalization
+ + | +
+ | +
+ + +
++ +
++ +
+ + 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 @@ + + ++ + +
++ +
++ +
++ +
+ + 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 @@ + + ++ Just trying including in a conditional macro. +
++ With some text around it. +
++ Just testing. +
++ Just testing. +
++ Just testing. +
++ Just trying including in a conditional macro. +
++ With some text around it. +
++ Just testing. +
++ Just testing. +
++ Just testing. +
++ Just trying including in a conditional macro. +
++ With some text around it. +
++ Just testing. +
++ Just testing. +
++ Just testing. +
++ Just testing. +
+n
member variable
+ n
member variable
+ + This is the foo + function. +
++ This description can have paragraphs... +
++ And any quickbook block markup. +
++
std::string foo() +{ + // return 'em, foo man! + return "foo"; +} ++ +
+ This is the Python foo + function. +
++ This description can have paragraphs... +
++ And any quickbook block markup. +
++
def foo(): + # return 'em, foo man! + return "foo" ++ +
+ This is the C foo + function. +
++ This description can have paragraphs... +
++ And any quickbook block markup. +
++
char* foo() +{ + // return 'em, foo man! + return "foo"; +} ++ +
+
class x +{ +public: + + (1)x() : n(0) + { + } + + (2)~x() + { + } + + (3)int get() const + { + return n; + } + + (4)void set(int n_) + { + n = n_; + } +}; ++ +
+ Constructor +
++ Destructor +
+
+ Get the n
member variable
+
+ Set the n
member variable
+
+ This should appear when stub.c is included. +
++ This is the C foo + function. +
++ This description can have paragraphs... +
++ And any quickbook block markup. +
+char* foo() +{ + // return 'em, foo man! + return "foo"; +} ++
+ This should appear when stub.py is included. +
++ This should appear when stub.cpp is included. +
++ [foo] +
++ [foo_py] +
++ [foo_c] +
+ + 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 @@ + + ++ Table of contents +
++ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ Table of contents +
++ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ Table of contents +
++ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ | +
---|
+ | +
+ filename-1_7.quickbook +
++ sub/filename_include1.quickbook +
++ sub/../filename_include2.quickbook +
++ filename_include2.quickbook +
++ sub/filename_include1.quickbook +
++ sub/../filename_include2.quickbook +
++ sub/filename_include1.quickbook +
++ sub/../filename_include2.quickbook +
+ + 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 @@ + + ++ filename-path.quickbook +
++ filename_include1.quickbook +
++ ../filename_include2.quickbook +
++ filename_include2.quickbook +
+ + 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 @@ + + ++ filename.quickbook +
++ sub/filename_include1.quickbook +
++ sub/../filename_include2.quickbook +
++ filename_include2.quickbook +
+ + 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 @@ + + ++ filename_path-1_7.quickbook +
++ filename_include1.quickbook +
++ ../filename_include2.quickbook +
++ filename_include2.quickbook +
+ + 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 @@ + + ++ Table of contents +
+ ++ A +
++ B +
++ B +
++ A +
++ B +
++ B +
++ Macro 1: import-basic-inc1.quickbook Template 1: import-basic-1.6.quickbook +
++ Macro 2: import-basic-inc2.quickbook Template 2: import-basic-1.6.quickbook +
+ + 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 @@ + + ++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Foo:macros-inc1.quickbook +
++ Defined conditional phrase. +
++ Foo:macros-inc1.quickbook +
++ Defined conditional phrase. +
++ Table of contents +
++ Table of contents +
++ Table of contents +
++ Table of contents +
+void main() {}+
void main() {} ++ + 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 @@ + + +
+ Table of contents +
+ +void main() {} ++
void main() {}+
void main() {} ++ + 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 @@ + + +
+ Inline:templates-inc1.quickbook +
++ Foo:templates-1.5.quickbook +
+ + 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 @@ + + ++ Inline:templates-inc1.quickbook +
++ [foo] +
++ Foo:templates-1.6.quickbook +
+ + 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 @@ + + ++ Table of contents +
++ Just testing. +
++ Just testing. +
++ Table of contents +
+
+ http://www.boost.org/ Boost
+ link-id Link Text foo
+ link text foo
link text
foo link text foo link
+ text foo link text foo link text foo link text foo link text
+
+ description +
++ Table of contents +
+
+ http://www.boost.org/ Boost
+ link-id Link Text foo
+ link text foo
link text
foo link text foo link
+ text foo link text foo link text foo link text foo link text
+
+ description +
++ description +
++ Table of contents +
+
+ http://www.boost.org/ Boost
+ link-id Link Text foo
+ link text foo
link text
foo link text foo link
+ text foo link text foo link text foo link text foo link text
+
+ description +
++ Templated link? +
+ +Quoted+
+ Table of contents +
+ ++ Simple list: +
++ Simple list: +
++ Two level list: +
++ Two level list: +
++ Three level list: +
++ Three level list: +
++ Inconsistent Indentation: +
++ Markup in list: +
+Quoted+
+ Don't end list with comment 1: +
++ Don't end list with comment 2: +
+Quoted+
+ Table of contents +
+ ++ Simple list: +
++ Simple list: +
++ Two level list: +
++ Two level list: +
++ Three level list: +
++ Three level list: +
++ Inconsistent Indentation: +
++ Markup in list: +
+Quoted+
+ + Heading + + |
+
---|
+ + Cell + + |
+
+ Don't end list with comment 1: +
++ Don't end list with comment 2: +
+Quoted+
+ Table of contents +
++ Simple list: +
++ Simple list: +
++ Two level list: +
++ Two level list: +
++ Three level list: +
++ Three level list: +
++ Inconsistent Indentation: +
++ Markup in list: +
+Quoted+
+ + Heading + + |
+
---|
+ + Cell + + |
+
+ Don't end list with comment 1: +
++ Don't end list with comment 2: +
+B
+
+ E
+
+ + 1 +
++ 2 +
++ two +
++ 1 +
++ 1 +
++ 1 +
++ 1 2 +
+ + 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 @@ + + ++ 1 +
++ 2 +
++ two +
++ 2 +
++ 3 +
++ 2 +
++ [1] \m2 +
+ + 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 @@ + + ++ [foo +
++ Eek +
+ + 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 @@ + + ++ [foo Eek +
+ + 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 @@ + + ++ Table of contents +
++ ] +
++++ +It is better to be approximately right than exactly wrong.+ -- Old adage +
+++ +It is better to be approximately right than exactly wrong.+ -- Old adage +
+ Line 1
Line 2
+
+++
+It is better to be approximately right than exactly wrong.
-- Old adage +
+ Line 1
Line 2
+
++ + 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 @@ + + ++
+It is better to be approximately right than exactly wrong.
-- Old adage +
+ Table of contents +
++ Shouldn't be a code block. +
++ Should be bold. +
++ Should be a single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Lots of newlines round this paragraph. +
++ Last paragraph. +
++ Shouldn't be a code block. +
++ Should be bold. +
++ Should be a single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Single paragraph. +
++ Lots of newlines round this paragraph. +
++ Last paragraph. +
+main
,
+ on line 3.
+ + Table of contents +
++ Here's the ubiquitous Hello World + program in C++. +
+#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: +
+void something();+
+ . +
++ And some indented code: +
+void go() + { + } ++
main
,
+ on line 3.
+ + Table of contents +
++ Here's the ubiquitous Hello World + program in C++. +
+#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: +
+void something();+
+ . +
++ And some indented code: +
+void go() + { + } ++
+++ ++ Why program by hand in five days what + you can spend five years of your life automating?+ -- Terrence Parr, author ANTLR/PCCTS + +
+++ +quickbook.qbk +
doc_name . sect_name . sub_sect_name . sub_sub_sect_name
+ \
.
+ \ n
+ and [ br ]
are now deprecated.
+ A question that sometimes drives me hazy: am I or are the others + crazy?--Einstein +
Here's the rule for bargains:+Do other men, for they would + do you.That's the true business precept.
int main () { return 0 ; }
+ in it. The code will be syntax highlighted.
+ "'"
.
+ Note too that import
is rather
+ like C++'s #include
.
+ A C++ comment // looks like this
+ whereas a Python comment #looks like this
.
+ [ br ]
is now deprecated. Blurbs,
+ Admonitions
+ and table cells (see Tables)
+ may now contain paragraphs.
+ [
and ]
.
+ For example, how do you escape the triple quote? Simple: \ n
+ has a special meaning. It is used to generate line breaks.
+ \ n
+ and [ br ]
are now deprecated. Blurbs,
+ Admonitions
+ and table cells (see Tables)
+ may now contain paragraphs.
+ \
also
+ has a special meaning. The escaped space is removed from the output.
+ [ footnote ]
block, and the text will be put at the
+ bottom of the current page. For example, this:
+ +++ Indents the paragraph. This applies to one paragraph only. + +
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:
+ struct
x_tag;
+ 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:
+ //[id
and //]
+ will be inserted as a template in quickbook with name //]
ends a code-snippet
+ This too will not be visible in quickbook.
+ bin
+ and bin . v2
directories generated by the build before
+ trying again. Otherwise your configuration fixes will not take any effect.
+ +++ +Section contributed by Julio M. Merino Vidal +
xsltproc
+ for Windows. There are many ways to get this tool, but to keep things
+ simple, use the iconv
,
+ zlib
, libxml2
+ and libxslt
.
+ bin
, include
+ and lib
directories within
+ the hierarchy. These instructions use C :\ Users \ example \ Documents \ boost \ xml
+ as the root for all files.
+ bin
+ directory and launch xsltproc . exe
+ to ensure it works. You should get usage information on screen.
+ C :\ Users \ example \ Documents \ boost \ xml \ docbook - xml
.
+ docbook - xsl
(bypassing the version name):
+ C :\ Users \ example \ Documents \ boost \ xml \ docbook - xsl
.
+ 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).
+ BOOST_ROOT \ tools \ quickbook
).
+ bjam
+ -- v2
.
+ 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
.
+ user - config . jam
+ file:
+ bjam
,
+ xsltproc
, docbook - xsl
and
+ docbook - xml
packages. For example, using apt - get
:
+ doxygen
package
+ as well.
+ 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 BOOST_ROOT / tools / quickbook
).
+ bjam
+ -- v2
.
+ quickbook
+ binary (located under the BOOST_ROOT / bin . v2
+ hierarchy) to a safe place. The traditional location is / usr / local / bin
.
+ user - config . jam
+ file, using the full path of the quickbook executable:
+ +++ +Section contributed by Dean Michael Berris +
+++ +Faq contributed by Michael Marcin +
+ 2002, 2004, 2006 Joel de Guzman, Eric Niebler +
++ 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) +
++ Table of contents +
++++
+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 +
+
+ 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: +
+[section x] +blah... +[endsect]+
doc_name.sect_name.sub_sect_name.sub_sub_sect_name
+ \
.
+ \n
+ and [br]
are now deprecated.
+ + 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. +
++ Can be placed anywhere. +
+[/ comment (no output generated) ] ++
[/ comments can be nested [/ some more here] ] ++
[/ Quickbook blocks can nest inside comments. [*Comment this out too!] ] ++
['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: +
+[*['bold-italic]] ++
+ will generate: +
++ bold-italic +
++ When you want content that may or must be replaced by the user, use + the syntax: +
+[~replacement] ++
+ This will generate: +
++ replacement +
+["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: +
+["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.
+ Simple markup for formatting text, common in many applications, is + now supported: +
+/italic/, *bold*, _underline_, =teletype= ++
+ will generate: +
++ italic, bold, + underline, teletype +
++ Unlike QuickBook's standard formatting scheme, the rules for simpler + alternatives are much stricter[1]. +
+
+ + 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: +
+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: +
+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. +
++ Inlining code in paragraphs is quite common when writing C++ documentation. + We provide a very simple markup for this. For example, this: +
+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.
+
+ We simply enclose the code with the tick: "`", not the single
+ quote: "'"
. Note
+ too that `some code` is preferred over [^some code].
+
+ 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: +
+`` + #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; +} ++ +
+ 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: +
+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 import
is rather
+ like C++'s #include
.
+ A C++ comment // looks like this
+ whereas a Python comment #looks like this
.
+
+ + Mode + + |
+
+ + Source Mode Markup + + |
+
---|---|
+ + C++ + + |
+
+ + [c++] + + |
+
+ + Python + + |
+
+ + [python] + + |
+
+ The source mode strings are lowercase. +
+[br] ++
+ [br]
is now deprecated. Blurbs,
+ Admonitions and
+ table cells (see Tables)
+ may now contain paragraphs.
+
[#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. +
+[@http://www.boost.org this is [*boost's] website....] ++
+ will generate: +
++ this is boost's + website.... +
++ URL links where the link text is the link itself is common. Example: +
+see http://spirit.sourceforge.net/ ++
+ so, when the text is absent in a link markup, the URL is assumed. Example: +
+see [@http://spirit.sourceforge.net/] ++
+ will generate: +
++ see http://spirit.sourceforge.net/ +
++ In addition, you can link internally to an XML refentry like: +
+[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: +
+[link xml.refentry] ++
+ This gets converted into <link linkend="xml.refentry">xml.refentry</link>. +
++ If you want to link to a function, class, member, enum, concept or + header in the reference section, you can use: +
+[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: +
+[classref boost::bar::baz] ++
+ would have "boost::bar::baz" as the link text. +
++ The escape mark-up is used when we don't want to do any processing. +
+''' +escape (no processing/formatting) +''' ++
+ Escaping allows us to pass XML markup to BoostBook + or DocBook. For example: +
+''' +<emphasis role="bold">This is direct XML markup</emphasis> +''' ++
+ This is direct XML markup +
+ +
+ 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.
+
+ \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.
+
[$image.jpg] ++
+ 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:
+
[footnote A sample footnote] ++
+ will generate this[2]. +
+__a_macro_identifier__ ++
+ See Macros for details. +
+[a_template_identifier] ++
+ See Templates for + details. +
++ Every document must begin with a Document Info section, which should + look like this: +
+[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: +
++ 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. +
++ Starting a new section is accomplished with: +
+[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: +
+[endsect] ++
+ Sections can nest, and that results in a hierarchy in the table of + contents. +
++ You can include another XML file with: +
+[xinclude file.xml] ++
+ This is useful when file.xml has been generated by Doxygen and contains + your reference section. +
++ 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. +
+# One +# Two +# Three ++
+ will generate: +
++ List hierarchies are supported. Example: +
+# One +# Two +# Three + # Three.a + # Three.b + # Three.c +# Four + # Four.a + # Four.a.i + # Four.a.ii +# Five ++
+ will generate: +
++ Long lines will be wrapped appropriately. Example: +
+# 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. ++
* First +* Second +* Third ++
+ will generate: +
++ Mixed lists (ordered and unordered) are supported. Example: +
+# One +# Two +# Three + * Three.a + * Three.b + * Three.c +# Four ++
+ will generate: +
++ And... +
+# 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: +
++ Preformatted code starts with a space or a tab. The code will be syntax + highlighted according to the current Source + Mode: +
+#include <iostream> + +int main() +{ + // Sample code + std::cout << "Hello, World\n"; + return 0; +} ++
import cgi + +def cookForHtml(text): + '''"Cooks" the input text for HTML.''' + + return cgi.escape(text) ++
+ Macros that are already defined are expanded in source code. Example: +
+[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: +
+using boost::array; ++
+ 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: +
+void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``() +{ +} ++
+ Will generate: +
+void foo() +{ +} ++
+ When escaping from code to QuickBook, only phrase level markups are + allowed. Block level markups like lists, tables etc. are not allowed. +
++ Sometimes, you don't want some preformatted text to be parsed as C++. + In such cases, use the [pre ... ] markup block. +
+[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: +
+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. +
+[:sometext...] ++
+++ Indents the paragraph. This applies to one paragraph only. +
+
[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: +
++ This is a note +
++ This is a tip +
++ This is important +
++ This is a caution +
++ 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. +
+[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: +
+[link section_id.normalized_header_text The link text] ++
+ to link to them. See Anchor + links and Section + for more info. +
++ In cases when you don't want to care about the heading level (1 to + 6), you can use the Generic Heading: +
+[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: +
+[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: +
+[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. +
+[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: +
+[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. +
++ +
++ 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: +
+[def :-) [$theme/smiley.png]] +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] ++ +
+ Invoking these macros: +
+Hi __spirit__ :-) ++
+ will generate this: +
++ Hi Spirit +
++ Quickbook has some predefined macros that you can already use. +
+
+ + Macro + + |
+
+ + Meaning + + |
+
+ + Example + + |
+
---|---|---|
+ + __DATE__ + + |
+
+ + Today's date + + |
+
+ + 2000-Dec-20 + + |
+
+ + __TIME__ + + |
+
+ + The current time + + |
+
+ + 12:00:00 PM + + |
+
+ + __FILENAME__ + + |
+
+ + Quickbook source filename + + |
+
+ + quickbook_manual-1_4.quickbook + + |
+
+ 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: +
+[template person[name age what] + +Hi, my name is [name]. I am [age] years old. I am a [what]. + +] ++
+ Template identifiers can either consist of: +
++ 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 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. +
++ 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: +
+[template sample[arg1 arg2...argN] replacement text... ] ++
+ Block templates are of the form: +
+[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. +
++ You expand a template this way: +
+[template_identifier arg1..arg2..arg3] ++
+ At template expansion, you supply the actual arguments. The template + will be expanded with your supplied arguments. Example: +
+[person James Bond..39..Spy] +[person Santa Clause..87..Big Red Fatso] ++
+ Which will expand to: +
++ Hi, my name is James Bond. I am 39 years old. I am a Spy. +
++ Hi, my name is Santa Clause. I am 87 years old. I am a Big Red Fatso. +
++ 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 + QuickBook phrase. Arguments + are separated by the double dot ".." and terminated + by the close parenthesis. +
++ Nullary templates look and act like simple macros. Example: +
+[template alpha[]'''α'''] +[template beta[]'''β'''] ++
+ Expanding: +
+Some squigles...[*[alpha][beta]]+
+ We have: +
++ Some squiggles...αβ +
++ The difference with macros are +
++ 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: +
+[template aristotle_quote Aristotle: [*['Education is the best provision +for the journey to old age.]]] ++
+ Expanding: +
+Here's a quote from [aristotle_quote]. ++
+ We have: +
++ Here's a quote from Aristotle: Education + is the best provision for the journey to old age.. +
+
+ 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:
+
[template tag\ _tag] ++
+ Then expanding: +
+`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. +
++ 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: +
++ For example: +
+[template simple[a b c d] [a][b][c][d]] +[simple w x y z] ++
+ will produce: +
++ wxyz +
++ "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: +
+[simple w x y z trail] ++
+ will produce: +
++ wxyz 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: +
+[simple what do you think ..m a n?] ++
+ will produce: +
++ what do you think man? +
++ 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 template + identifiers. Example: +
+[template ![bar] <hey>[bar]</hey>] ++
+ Now, expanding this: +
+[!baz] ++
+ We will have: +
+<hey>baz</hey> ++
[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: +
++ + 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++. +
++ Prefer admonitions + wherever appropriate. +
+[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: +
+
+ + 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: +
+[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: +
+
+ + 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: +
+[table Table with code + [[Comment] [Code]] + [ + [My first program] + [`` + #include <iostream> + + int main() + { + std::cout << "Hello, World!" << std::endl; + return 0; + } + ``] + ] +] ++
+ + Comment + + |
+
+ + Code + + |
+
---|---|
+ + My first program + + |
+
+ + #include <iostream> + +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} ++ + |
+
[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: +
++ The definition of term 1 +
++ The definition of term 2 +
++ 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". +
++ You can include one QuickBook file from another. The syntax is simply: +
+[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 [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: +
+[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]. +
++ 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. +
++ You can effortlessly import code snippets from source code into your + QuickBook. The following illustrates how this is done: +
+[import ../test/stub.cpp] +[foo] +[bar] ++
+ The first line: +
+[import ../test/stub.cpp] ++
+ collects specially marked-up code snippets from 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:
+
[foo] +[bar] ++
+ And the result is: +
++ This is the foo + function. +
++ This description can have paragraphs... +
++ And any quickbook block markup. +
++
std::string foo() +{ + // return 'em, foo man! + return "foo"; +} ++ +
+ This is the bar + function +
++
std::string bar() +{ + // return 'em, bar man! + return "bar"; +} ++ +
+ Some trailing text here +
++ Note how the code snippets in 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.
+
+ 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. +
++ 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 + Callouts + for details. Example: +
++
std::string foo_bar() (1) +{ + return "foo-bar"; (2) +} ++ +
+ The Mythical FooBar. See + Foobar for details +
++ return 'em, foo-bar man! +
++ Checkout stub.cpp to see the actual + code. +
++ 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 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. +
+xsltproc
+ for Windows. There are many ways to get this tool, but to keep things
+ simple, use the binary
+ packages made by Igor Zlatkovic. At the very least, you need
+ to download the following packages: iconv
,
+ zlib
, libxml2
+ and libxslt
.
+ bin
, include
+ and lib
directories
+ within the hierarchy. These instructions use C:\Users\example\Documents\boost\xml
+ as the root for all files.
+ bin
+ directory and launch xsltproc.exe
+ to ensure it works. You should get usage information on screen.
+ C:\Users\example\Documents\boost\xml\docbook-xml
.
+ docbook-xsl
(bypassing the version name):
+ C:\Users\example\Documents\boost\xml\docbook-xsl
.
+ 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: +
+BOOST_ROOT\tools\quickbook
).
+ bjam
+ --v2
.
+ 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
.
+ user-config.jam
+ file:
+ using quickbook + : "C:/Users/example/Documents/boost/xml/bin/quickbook.exe" + ; ++
+ 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 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: +
+BOOST_ROOT/tools/quickbook
).
+ bjam
+ --v2
.
+ quickbook
+ binary (located under the BOOST_ROOT/bin.v2
+ hierarchy) to a safe place. The traditional location is /usr/local/bin
.
+ user-config.jam
+ file, using the full path of the quickbook executable:
+ using quickbook + : /usr/local/bin/quickbook + ; ++
+ 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. +
++ + You may submit your settings, tips, and suggestions to the authors, or + through the docs + Boost Docs mailing list. +
++++ 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. +
++ + 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. +
+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=] ++
+ + Thanks to Rene Rivera for the above SciTE settings. +
++ 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: +
+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 + ; ++
+ [cpp] +
+
+ + 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] + + |
+
+ + Replaceble + + |
+
+ + source mode + + |
+
+ + [c++] or [python] + + |
+
+ + Source Mode + + |
+
+ + inline code + + |
+
+ + `int main();` + + |
+
+ + Inline code + + |
+
+ + code block + + |
+
+ + ``int main();`` + + |
+
+ + Code + + |
+
+ + code escape + + |
+
+ + ``from c++ to QuickBook`` + + |
+ + + | +
+ + 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] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + class link + + |
+
+ + [classref fully::qualified::class_name Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + member link + + |
+
+ + [memberref fully::qualified::member_name Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + enum link + + |
+
+ + [enumref fully::qualified::enum_name Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + macro link + + |
+
+ + [macroref MACRO_NAME Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + concept link + + |
+
+ + [conceptref ConceptName Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + header link + + |
+
+ + [headerref path/to/header.hpp Link text] + + |
+
+ + function, class, + member, enum, macro, concept or header links + + |
+
+ + escape + + |
+
+ + '''escaped text (no processing/formatting)''' + + |
+
+ + Escape + + |
+
+ + single char escape + + |
+
+ + \c + + |
+ + + | +
+ + 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 + + |
+
+# one +# two +# three ++ |
+
+ + Ordered + lists + + |
+
+ + unordered list + + |
+
+* one +* two +* three ++ |
+ + + | +
+ + 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 Title +[[a][b][c]] +[[a][b][c]] +] ++ |
+
+ + Tables + + |
+
+ + variablelist + + |
+
+[variablelist Title +[[a][b]] +[[a][b]] +] ++ |
+
+ + Variable Lists + + |
+
+ + include + + |
+
+ + [include someother.qbk] + + |
+
+ + Include + + |
+
+ [1] + Thanks to David Barrett, author of 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. +
++ [2] A sample + footnote +
+quoted). + +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
+ Keyword [role] +
+ + 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 @@ + + ++ Keyword +
++ road Red Three + Colours Red Red Road +
+ + 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 @@ + + ++ Table of contents +
+ ++ Table of contents +
+ ++ Table of contents +
++ Table of contents +
++ Table of contents +
++ 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 bold +
++ not_underlined_ +
++ _Should not underline escaped markup_. _or this escaped_ markup form. +
++ Matti Meik\u00E4l\u00E4inen +
++ replaced +
++ replaced +
++ _mac\ ro_ +
++ italic\ +
++ These shouldn't be interepted as markup: == // ** +
++ < \< \\< +
++
/*=============================================================================
+ 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)
+=============================================================================*/
+
+
+ +
struct Foo{ + + Foo(); + +}; + + +int main() +{ + Foo x; +} ++ +
+
def foo: + print('foo') ++ + + 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 @@ + + +
+
int main() {} ++ + + 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 @@ + + +
int main () {}
but plain
+ text
.
+ int main () {}
+ int main () {}
+ int main() {}
+ int main () {}
and int main ()
+ {}
should both be C++ highlighted. int
+ main() {}
shouldn't be, but int
+ main () {}
should.
+ int main () {}
. Not highlighted:
+ int main() {}
.
+ + Table of contents +
+
+int main() {}+ |
+
+void foo() {}+ |
+
Plain text...+
+ int main() {}
but plain
+ text
.
+
int main() {}
+ int main() {}
+ int main() {}
+
+ int main() {}
and int main()
+ {}
should both be C++ highlighted. int
+ main() {}
shouldn't be, but int
+ main() {}
+ should.
+
+ int main() {}
. Not highlighted:
+ int main() {}
.
+
int main() {}+
+ X]Y +
+ + 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+ +
+ + 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 @@ + + ++ Table of contents +
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + A + + |
+
+ + B + + |
+
---|---|
+ + a + + |
+
+ + b + + |
+
+ + x + + |
+
+ + Header 1. Paragraph 1 + ++ Header 1. Paragraph 2 + + |
+
+ + Header 2 + + |
+
---|---|
+ + Row 1. Cell 1. + + |
+
+ + Row 1. Cell 2. + ++ Row 1. Cell 2. Paragraph 2. + + |
+
+ + Header 1 + + |
+
+ + Header 2 + + |
+ |||
---|---|---|---|---|
+
+
+
|
+ ||||
+ + Something. + + |
+
+ + a + + |
+
---|
+ + b + + |
+
+ Table of contents +
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + A + + |
+
+ + B + + |
+
---|---|
+ + a + + |
+
+ + b + + |
+
+ + x + + |
+
+ + Header 1. Paragraph 1 + ++ Header 1. Paragraph 2 + + |
+
+ + Header 2 + + |
+
---|---|
+ + Row 1. Cell 1. + + |
+
+ + Row 1. Cell 2. + ++ Row 1. Cell 2. Paragraph 2. + + |
+
+ + Header 1 + + |
+
+ + Header 2 + + |
+ |||
---|---|---|---|---|
+
+
+
|
+ ||||
+ + Something. + + |
+
+ + a + + |
+
---|
+ + b + + |
+
+ Table of contents +
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + Cell 1 + + |
+
+ + Cell 2 + + |
+
+ + Heading + + |
+
---|
+ + Cell 1 + + |
+
+ + Cell 2 + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + A + + |
+
+ + B + + |
+
---|---|
+ + a + + |
+
+ + b + + |
+
+ + x + + |
+
+ + Header 1. Paragraph 1 + ++ Header 1. Paragraph 2 + + |
+
+ + Header 2 + + |
+
---|---|
+ + Row 1. Cell 1. + + |
+
+ + Row 1. Cell 2. + ++ Row 1. Cell 2. Paragraph 2. + + |
+
+ + Header 1 + + |
+
+ + Header 2 + + |
+ |||
---|---|---|---|---|
+
+
+
|
+ ||||
+ + Something. + + |
+
+ + a + + |
+
---|
+ + b + + |
+
+ Table of contents +
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + Heading + + |
+
---|
+ + Cell 1 + + |
+
+ + Cell 2 + + |
+
+ + Heading + + |
+
---|
+ + Cell 1 + + |
+
+ + Cell 2 + + |
+
+ + Heading + + |
+
---|
+ + cell + + |
+
+ + A + + |
+
+ + B + + |
+
---|---|
+ + a + + |
+
+ + b + + |
+
+ + x + + |
+
+ + 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 2. + +
|
+
+ + Header 1 + + |
+
+ + Header 2 + + |
+ |||
---|---|---|---|---|
+
+
+
|
+ ||||
+ + Something. + + |
+
+ + a + + |
+
---|
+ + b + + |
+
+ Table of contents +
++ Some text before the section. +
++ Hello. +
++ Goodbye. +
++ Table of contents +
++ nullary_arg +
++ foo baz +
++ foo baz +
++ This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... +
++ baz +
++ This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... +
++ zoom peanut zoom +
++ exactly xanadu +
++ wx +
++ wxyz wxyz trail +
+int main() +{ + std::cout << "Hello, World" << std::endl; +} ++
+ x2 +
++ α2 +
++ x2 +
++ got a banana? +
++ .0 00 +
++ [fool] +
++ Pre +
++ Start block template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End block template. +
++ Post +
++ Pre +
++ Start block template. +
++ Start phrase template. Hello! End phrase template. +
++ End block template. +
++ Post +
++ Pre +
++ Start phrase template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End phrase template. +
++ Post +
++ Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post +
++
+int main() {}+
+ Paragraphs 1 +
++ Paragraphs 2 +
++
+int main() {}+
+ Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook +
++ Table of contents +
++ dynamic scoping +
++ old +
++ {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {[1-2} {1..2-3} {1..2-3} +
++ {[binary 1 2-3} 4] +
++ {1-2-3} {1-2-3} {1-2-3 4} {1 2-3-4} {[1-2-3} +
++ Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook +
++ Table of contents +
++ nullary_arg +
++ foo baz +
++ foo baz +
++ This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... +
++ baz +
++ This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... +
++ zoom peanut zoom +
++ exactly xanadu +
++ wx +
++ wxyz wxyz trail +
+int main() +{ + std::cout << "Hello, World" << std::endl; +} ++
+ x2 +
++ α2 +
++ x2 +
++ got a banana? +
++ .0 00 +
++ [fool] +
++ Pre +
++ Start block template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End block template. +
++ Post +
++ Pre +
++ Start block template. +
++ Start phrase template. Hello! End phrase template. +
++ End block template. +
++ Post +
++ Pre +
++ Start phrase template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End phrase template. +
++ Post +
++ Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post +
++
+int main() {}+
+ Paragraphs 1 +
++ Paragraphs 2 +
++
+int main() {}+
+ static scoping +
++ [a] +
++ new +
++ foo foo +
++ {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} +
++ { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} +
++ {[1-2] 3} {[1-2] 3} {[1-2} +
++ {1-2-3} {1-2-3} +
++ Some text +
++ A <emphasis>paragraph</emphasis>. +
++ Some *text* A paragraph. +
++
+ Not real boostbook Also not real boostbook More fake boostbook Final fake + boostbook +
+code
+ + Table of contents +
++ nullary_arg +
++ foo baz +
++ foo baz +
++ This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... +
++ baz +
++ This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... +
++ zoom peanut zoom +
++ exactly xanadu +
++ wx +
++ wxyz wxyz trail +
+int main() +{ + std::cout << "Hello, World" << std::endl; +} ++
+ x2 +
++ α2 +
++ x2 +
++ got a banana? +
++ .0 00 +
++ [fool] +
++ Pre +
++ Start block template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End block template. +
++ Post +
++ Pre +
++ Start block template. +
++ Start phrase template. Hello! End phrase template. +
++ End block template. +
++ Post +
++ Pre +
++ Start phrase template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End phrase template. +
++ Post +
++ Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post +
++
+int main() {}+
+ Paragraphs 1 +
++ Paragraphs 2 +
++
+int main() {}+
+ static scoping +
++ [a] +
++ new +
++ foo foo +
++ {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} +
++ { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} +
++ {[1-2] 3} {[1-2] 3} {[1-2} +
++ {1-2-3} {1-2-3} +
++ Some text +
++ A <emphasis>paragraph</emphasis>. +
++ Some *text* A paragraph. +
++
+ Argument +
+code
+ code
+ + Not real boostbook More fake boostbook +
+code
+ + Table of contents +
++ nullary_arg +
++ foo baz +
++ foo baz +
++ This is a complete paragraph. kalamazoo kalamazoo kalamazoo kalamazoo kalamazoo + kalamazoo kalamazoo kalamazoo kalamazoo.... blah blah blah...... +
++ baz +
++ This is a complete paragraph. madagascar madagascar madagascar madagascar + madagascar madagascar madagascar madagascar madagascar.... blah blah blah...... +
++ zoom peanut zoom +
++ exactly xanadu +
++ wx +
++ wxyz wxyz trail +
+int main() +{ + std::cout << "Hello, World" << std::endl; +} ++
+ x2 +
++ α2 +
++ x2 +
++ got a banana? +
++ .0 00 +
++ [fool] +
++ Pre +
++ Start block template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End block template. +
++ Post +
++ Pre +
++ Start block template. +
++ Start phrase template. Hello! End phrase template. +
++ End block template. +
++ Post +
++ Pre Start phrase template. +
++ Start block template. +
++ Hello! +
++ End block template. +
++ End phrase template. Post +
++ Pre Start phrase template. Start phrase template. Hello! End phrase template. + End phrase template. Post +
++
+int main() {}+
+ Paragraphs 1 +
++ Paragraphs 2 +
++
+int main() {}+
+ static scoping +
++ [a] +
++ new +
++ foo foo +
++ {1-2} {1-2} {1-2 3 4} {1 2-3 4} {1 2 3-4} {1..2-3} {1..2-3} +
++ { {1 2-3}-4} { {1 2-3}-4} { {1-2 3}-4} +
++ {[1-2] 3} {[1-2] 3} {[1-2} +
++ {1-2-3} {1-2-3} +
++ Some text +
++ A <emphasis>paragraph</emphasis>. +
++ Some *text* A paragraph. +
++
+ Text2 afterwards. Text3 before. +
++ Text4 before. +
++ Text4 afterwards. +
++ * Not a list. +
++ * Not a list. +
++ Argument +
+code
+ code
+ + Not real boostbook More fake boostbook +
++ In the unlikely event that you've got a Mahjong font: +
++ [non-element] +
++ [non-element] +
+ + 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 @@ + + ++ [non-element] +
++ [non-element] +
+ + 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 new file mode 100644 index 000000000..be2bcbc44 Binary files /dev/null and b/src/boost/tools/quickbook/test/utf16be_bom-1_5-fail.quickbook differ 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 new file mode 100644 index 000000000..d9782a465 Binary files /dev/null and b/src/boost/tools/quickbook/test/utf16le_bom-1_5-fail.quickbook differ 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 @@ + + ++ b +
++ b +
++ c +
++ b +
++ b +
++ c +
++ b +
++ c +
++ d +
++ b +
++ c +
++ d +
++ e +
++ b +
++ b +
++ Import: +
++ Include: +
++ Table of contents +
++ correct +
++ Some text +
++ Some text +
++ Some text +
++ Table of contents +
++ Some text +
++ Some text +
++ Some text +
++ Table of contents +
++ Some text +
++ Some text +
++ Some text +
++ Table of contents +
++ Some text +
++ Some text +
++ Some text +
++ & should be &, < should < +
++ Table of contents +
+ ++ & should be &, < should < +
++ Table of contents +
+ +