|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85827 - in branches/release: . tools tools/quickbook tools/quickbook/doc tools/quickbook/src tools/quickbook/test tools/quickbook/test/include
From: dnljms_at_[hidden]
Date: 2013-09-22 07:10:03
Author: danieljames
Date: 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013)
New Revision: 85827
URL: http://svn.boost.org/trac/boost/changeset/85827
Log:
Merge quickbook.
Added:
branches/release/tools/quickbook/test/include/source_mode-inc2.quickbook
- copied unchanged from r85590, trunk/tools/quickbook/test/include/source_mode-inc2.quickbook
branches/release/tools/quickbook/test/link-1_7-fail2.quickbook
- copied unchanged from r85808, trunk/tools/quickbook/test/link-1_7-fail2.quickbook
Properties modified:
branches/release/ (props changed)
branches/release/tools/ (props changed)
branches/release/tools/quickbook/ (props changed)
Text files modified:
branches/release/tools/quickbook/doc/1_6.qbk | 41 +++++++++++++++++++++++++++++++++++++++
branches/release/tools/quickbook/doc/1_7.qbk | 13 ++++-------
branches/release/tools/quickbook/doc/Jamfile.v2 | 6 ++++
branches/release/tools/quickbook/doc/change_log.qbk | 4 ++
branches/release/tools/quickbook/doc/quickbook.qbk | 1
branches/release/tools/quickbook/src/actions.cpp | 6 +---
branches/release/tools/quickbook/src/doc_info_grammar.cpp | 13 +++++++----
branches/release/tools/quickbook/src/main_grammar.cpp | 2
branches/release/tools/quickbook/src/quickbook.cpp | 2
branches/release/tools/quickbook/src/state.cpp | 9 +++++++
branches/release/tools/quickbook/src/state.hpp | 2 +
branches/release/tools/quickbook/src/syntax_highlight.cpp | 1
branches/release/tools/quickbook/src/utils.cpp | 29 ++++++++++++++++++++++++++-
branches/release/tools/quickbook/src/utils.hpp | 5 ++-
branches/release/tools/quickbook/test/Jamfile.v2 | 1
branches/release/tools/quickbook/test/include/source_mode-1_5.gold | 2 +
branches/release/tools/quickbook/test/include/source_mode-1_5.quickbook | 3 +
branches/release/tools/quickbook/test/include/source_mode-1_6.gold | 2 +
branches/release/tools/quickbook/test/include/source_mode-1_6.quickbook | 3 +
branches/release/tools/quickbook/test/include/source_mode-inc2.quickbook | 3 ++
branches/release/tools/quickbook/test/link-1_7-fail2.quickbook | 6 +++++
21 files changed, 123 insertions(+), 31 deletions(-)
Modified: branches/release/tools/quickbook/doc/1_6.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/1_6.qbk Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/doc/1_6.qbk 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -9,7 +9,46 @@
[section:1_6 Quickbook 1.6]
-Everything described in here may change depending on the feedback received.
+Upgrading a document from an earlier version of quickbook shouldn't be too
+hard. The first thing to do is update the version in the docinfo block.
+For example, if you were updating the Xpressive documentation, the existing
+docinfo block looks like:
+
+ [library Boost.Xpressive
+ [quickbook 1.3]
+ ...
+ ]
+
+Change this to:
+
+ [library Boost.Xpressive
+ [quickbook 1.6]
+ [compatibility-mode 1.3]
+ ...
+ ]
+
+The =compatibility-mode= tag ensures that automatically generated links
+won't change. It might turn out that it isn't required, but in Xpressive's
+case if it isn't included it will break a lot of links.
+
+Then try building it. You might need to fix some stray square brackets. The
+new version has a stricter parser which will have an error for brackets
+which don't pair up. They might be there by mistake, in which case they
+should probably be deleted, or if they're intentional escaped. For example,
+to write out the half-open range \[a,b), use: `\[a,b)`.
+
+Next, you might need to reconsider how templates and macros are defined.
+If you `include` a file to use its templates, you'll now need to `import` it
+instead as templates are now scoped by included files. Also, if you define
+templates and macros in your main quickbook file, you might want to put them
+into a separate file and `import` that, which allows the main documentation
+files to concentrate on the structure and contents of the document, making them
+easier to read.
+
+Now that headings can have ids, it can be a good idea to add ids to existing
+headings. This means that the headings will have more predictable ids which
+don't change when the text of the heading changes. In order to preserve
+links you can use the existing generated id as the heading.
[section:docinfo Includes with docinfo]
Modified: branches/release/tools/quickbook/doc/1_7.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/1_7.qbk Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/doc/1_7.qbk 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -57,7 +57,7 @@
[section:callouts Callouts in code blocks]
-Currently callouts can only be used in code snippets. 1.7 add
+Currently callouts can only be used in code snippets. 1.7 adds
support in normal code blocks. The same syntax is used as in
code snippets, the callout descriptions appear immediately
after the code block.
@@ -67,7 +67,7 @@
[section:escaped_docinfo_attributes Escaped docbook in docinfo blocks]
Quickbook docinfo attributes will probably never be as rich as docbook
-attributes so to allow more flexible markup, not supported by quickbook
+attributes. To allow more flexible markup that is not supported by quickbook,
escaped docbook can be included in the docinfo block:
```
@@ -82,7 +82,8 @@
```
The escaped docbook is always placed at the end of the docinfo block,
-so it shouldn't be assumed that it will interleave the markup. A mixture
+so it shouldn't be assumed that it will interleave with markup generated from
+quickbook. A mixture
of quickbook and docbook attributes for the same information will not work
well.
@@ -90,8 +91,7 @@
[section:listparagraphs Pargraphs in lists]
-I'm still refining this, but paragraphs and block elements can now be used
-in lists:
+Paragraphs and block elements can now be used in lists:
[pre
* Para 1
@@ -117,9 +117,6 @@
Code block
Para 3
-The docbook markup that this generates is pretty bad, but seems to create okay
-html.
-
[endsect]
[section:templates_in_link_values Templates in link values]
Modified: branches/release/tools/quickbook/doc/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/doc/Jamfile.v2 Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/doc/Jamfile.v2 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -21,7 +21,11 @@
:
quickbook
:
- <xsl:param>boost.root=../../../..
+ <format>html:<xsl:param>boost.root=../../../..
+ <format>html:<xsl:param>img.src.path=../../../../doc/html/
+ <format>xhtml:<xsl:param>boost.root=../../../..
+ <format>xhtml:<xsl:param>img.src.path=../../../../doc/html/
+
#<xsl:param>callout.graphics.path=../../images/callouts//
<format>pdf:<xsl:param>img.src.path=$(images)/
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
Modified: branches/release/tools/quickbook/doc/change_log.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/change_log.qbk Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/doc/change_log.qbk 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -297,7 +297,7 @@
* Clean up the source map implementation (used to get the correct
location for error messages in things like templates and snippets).
-[heading Version 1.6.0 alpha]
+[heading Version 1.6.0 beta 1 - Boost 1.55 beta]
* Remove nested blocks in lists from 1.6, move to 1.7.
(Can still nest block elements in lists though).
@@ -306,6 +306,8 @@
* Improved markup for lists.
* Make escaping templates with a punctuation identifier illegal.
Escaping templates with an alphanumeric identifier is still fine.
+* Fix detection of code blocks at the start of a file.
+* XML encode the contents of the `__FILENAME__` macro.
* 1.7 changes:
* Make it an error to use an element in the wrong context.
* Error if the body of a phrase element doesn't parse.
Modified: branches/release/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/quickbook.qbk Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/doc/quickbook.qbk 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -88,7 +88,6 @@
[include phrase.qbk]
[include block.qbk]
[include language_versions.qbk]
-[include 1_6.qbk]
[include install.qbk]
[include editors.qbk]
[include faq.qbk]
Modified: branches/release/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/src/actions.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/actions.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -1962,8 +1962,7 @@
state.imported = (load_type == block_tags::import);
// update the __FILENAME__ macro
- *boost::spirit::classic::find(state.macro, "__FILENAME__")
- = detail::path_to_generic(state.filename_relative);
+ state.update_filename_macro();
// parse the file
quickbook::parse_file(state, include_doc_id, true);
@@ -1973,8 +1972,7 @@
}
// restore the __FILENAME__ macro
- *boost::spirit::classic::find(state.macro, "__FILENAME__")
- = detail::path_to_generic(state.filename_relative);
+ state.update_filename_macro();
}
void load_source_file(quickbook::state& state,
Modified: branches/release/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- branches/release/tools/quickbook/src/doc_info_grammar.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/doc_info_grammar.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -123,11 +123,14 @@
scoped_parser<to_value_scoped_action> to_value(state);
doc_info_details =
- space [ph::var(local.source_mode_unset) = true]
- >> *( local.doc_attribute
- >> space
+ cl::eps_p [ph::var(local.source_mode_unset) = true]
+ >> *( space
+ >> local.doc_attribute
+ )
+ >> !( space
+ >> local.doc_info_block
)
- >> !local.doc_info_block
+ >> *eol
;
local.doc_info_block =
@@ -155,7 +158,7 @@
)
) [state.values.sort()]
>> ( ']'
- >> (+eol | cl::end_p)
+ >> (eol | cl::end_p)
| cl::eps_p [error]
)
;
Modified: branches/release/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- branches/release/tools/quickbook/src/main_grammar.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/main_grammar.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -914,7 +914,7 @@
>> (*(cl::anychar_p - "'''"))
>> ( cl::str_p("'''")
| cl::eps_p [error("Unclosed boostbook escape.")]
- ) [element_action]
+ )
;
attribute_value_1_7 =
Modified: branches/release/tools/quickbook/src/quickbook.cpp
==============================================================================
--- branches/release/tools/quickbook/src/quickbook.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/quickbook.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -40,7 +40,7 @@
#pragma warning(disable:4355)
#endif
-#define QUICKBOOK_VERSION "Quickbook Version 1.6.0 alpha 1"
+#define QUICKBOOK_VERSION "Quickbook Version 1.6.0 beta 1"
namespace quickbook
{
Modified: branches/release/tools/quickbook/src/state.cpp
==============================================================================
--- branches/release/tools/quickbook/src/state.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/state.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -13,6 +13,7 @@
#include "quickbook.hpp"
#include "grammar.hpp"
#include "input_path.hpp"
+#include "utils.hpp"
#if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310))
#pragma warning(disable:4355)
@@ -63,8 +64,9 @@
macro.add
("__DATE__", std::string(quickbook_get_date))
("__TIME__", std::string(quickbook_get_time))
- ("__FILENAME__", detail::path_to_generic(filename_relative))
+ ("__FILENAME__", std::string())
;
+ update_filename_macro();
boost::scoped_ptr<quickbook_grammar> g(
new quickbook_grammar(*this));
@@ -74,6 +76,11 @@
quickbook_grammar& state::grammar() const {
return *grammar_;
}
+
+ void state::update_filename_macro() {
+ *boost::spirit::classic::find(macro, "__FILENAME__")
+ = detail::encode_string(detail::path_to_generic(filename_relative));
+ }
void state::push_output() {
out.push();
Modified: branches/release/tools/quickbook/src/state.hpp
==============================================================================
--- branches/release/tools/quickbook/src/state.hpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/state.hpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -84,6 +84,8 @@
// actions
///////////////////////////////////////////////////////////////////////////
+ void update_filename_macro();
+
void push_output();
void pop_output();
Modified: branches/release/tools/quickbook/src/syntax_highlight.cpp
==============================================================================
--- branches/release/tools/quickbook/src/syntax_highlight.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/syntax_highlight.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -13,7 +13,6 @@
#include <boost/spirit/include/classic_symbols.hpp>
#include <boost/spirit/include/classic_loops.hpp>
#include "grammar.hpp"
-#include "grammar_impl.hpp" // Just for context stuff. Should move?
#include "state.hpp"
#include "actions.hpp"
#include "utils.hpp"
Modified: branches/release/tools/quickbook/src/utils.cpp
==============================================================================
--- branches/release/tools/quickbook/src/utils.cpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/utils.cpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -15,6 +15,27 @@
namespace quickbook { namespace detail
{
+ std::string encode_string(boost::string_ref str)
+ {
+ std::string result;
+ result.reserve(str.size());
+
+ for (boost::string_ref::const_iterator it = str.begin();
+ it != str.end(); ++it)
+ {
+ switch (*it)
+ {
+ case '<': result += "<"; break;
+ case '>': result += ">"; break;
+ case '&': result += "&"; break;
+ case '"': result += """; break;
+ default: result += *it; break;
+ }
+ }
+
+ return result;
+ }
+
void print_char(char ch, std::ostream& out)
{
switch (ch)
@@ -29,7 +50,7 @@
}
}
- void print_string(boost::string_ref const& str, std::ostream& out)
+ void print_string(boost::string_ref str, std::ostream& out)
{
for (boost::string_ref::const_iterator cur = str.begin();
cur != str.end(); ++cur)
@@ -45,8 +66,11 @@
return static_cast<char>(std::tolower(static_cast<unsigned char>(ch)));
}
- std::string escape_uri(std::string uri)
+ std::string escape_uri(std::string uri_param)
{
+ std::string uri;
+ uri.swap(uri_param);
+
for (std::string::size_type n = 0; n < uri.size(); ++n)
{
static char const mark[] = "-_.!~*'()?\\/";
@@ -60,6 +84,7 @@
n += 2;
}
}
+
return uri;
}
}}
Modified: branches/release/tools/quickbook/src/utils.hpp
==============================================================================
--- branches/release/tools/quickbook/src/utils.hpp Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/src/utils.hpp 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -17,8 +17,9 @@
#include <boost/utility/string_ref.hpp>
namespace quickbook { namespace detail {
+ std::string encode_string(boost::string_ref);
void print_char(char ch, std::ostream& out);
- void print_string(boost::string_ref const& str, std::ostream& out);
+ void print_string(boost::string_ref str, std::ostream& out);
char filter_identifier_char(char ch);
template <typename Range>
@@ -34,7 +35,7 @@
}
std::string escape_uri(std::string uri);
- inline std::string escape_uri(boost::string_ref const& uri) {
+ inline std::string escape_uri(boost::string_ref uri) {
return escape_uri(std::string(uri.begin(), uri.end()));
}
Modified: branches/release/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/test/Jamfile.v2 Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/test/Jamfile.v2 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -69,6 +69,7 @@
[ quickbook-test link-1_6 ]
[ quickbook-test link-1_7 ]
[ quickbook-error-test link-1_7-fail ]
+ [ quickbook-error-test link-1_7-fail2 ]
[ quickbook-test list_test-1_5 ]
[ quickbook-test list_test-1_6 ]
[ quickbook-error-test list_test-1_6-fail ]
Modified: branches/release/tools/quickbook/test/include/source_mode-1_5.gold
==============================================================================
--- branches/release/tools/quickbook/test/include/source_mode-1_5.gold Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/test/include/source_mode-1_5.gold 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -4,4 +4,6 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Souce Mode Include</title>
<programlisting>void main() {}</programlisting>
+<programlisting>void main() {}
+</programlisting>
</article>
Modified: branches/release/tools/quickbook/test/include/source_mode-1_5.quickbook
==============================================================================
--- branches/release/tools/quickbook/test/include/source_mode-1_5.quickbook Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/test/include/source_mode-1_5.quickbook 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -1,3 +1,4 @@
[article Souce Mode Include [source-mode teletype][quickbook 1.5]]
-[include source_mode-inc1.quickbook]
\ No newline at end of file
+[include source_mode-inc1.quickbook]
+[include source_mode-inc2.quickbook]
Modified: branches/release/tools/quickbook/test/include/source_mode-1_6.gold
==============================================================================
--- branches/release/tools/quickbook/test/include/source_mode-1_6.gold Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/test/include/source_mode-1_6.gold 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -8,4 +8,6 @@
<title>Source include with no source-mode</title>
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
</article>
+<programlisting>void main() {}
+</programlisting>
</article>
Modified: branches/release/tools/quickbook/test/include/source_mode-1_6.quickbook
==============================================================================
--- branches/release/tools/quickbook/test/include/source_mode-1_6.quickbook Sun Sep 22 06:49:01 2013 (r85826)
+++ branches/release/tools/quickbook/test/include/source_mode-1_6.quickbook 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827)
@@ -1,4 +1,5 @@
[source-mode teletype][quickbook 1.6]
[article Souce Mode Include]
-[include source_mode-inc1.quickbook]
\ No newline at end of file
+[include source_mode-inc1.quickbook]
+[include source_mode-inc2.quickbook]
Copied: branches/release/tools/quickbook/test/include/source_mode-inc2.quickbook (from r85590, trunk/tools/quickbook/test/include/source_mode-inc2.quickbook)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/release/tools/quickbook/test/include/source_mode-inc2.quickbook 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827, copy of r85590, trunk/tools/quickbook/test/include/source_mode-inc2.quickbook)
@@ -0,0 +1,3 @@
+[/ Source include with no source-mode, and no docinfo.]
+
+ void main() {}
Copied: branches/release/tools/quickbook/test/link-1_7-fail2.quickbook (from r85808, trunk/tools/quickbook/test/link-1_7-fail2.quickbook)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/release/tools/quickbook/test/link-1_7-fail2.quickbook 2013-09-22 07:10:03 EDT (Sun, 22 Sep 2013) (r85827, copy of r85808, trunk/tools/quickbook/test/link-1_7-fail2.quickbook)
@@ -0,0 +1,6 @@
+[article Link fail test
+[quickbook 1.7]
+]
+
+[/ Escapes aren't allowed in links.]
+[link '''escaped stuff''']
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk