|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62700 - in trunk/tools/quickbook: . test
From: daniel_james_at_[hidden]
Date: 2010-06-09 20:14:56
Author: danieljames
Date: 2010-06-09 20:14:56 EDT (Wed, 09 Jun 2010)
New Revision: 62700
URL: http://svn.boost.org/trac/boost/changeset/62700
Log:
Fix paragraph mark up.
* Require an eol after comments, so that an eol with content after it is
interpreted as a paragraph.
* 'eol >> eol' => 'eol >> *blank_p >> eol_p' so that lines containing
only a comment aren't interpreted as paragraph breaks.
* +eol after 'inside paragraphs' so that all the whitespace following
a paragraph is swallowed up. If it wasn't then it'd create lots of
empty paragraphs when there's a lot of whitespace.
Added:
trunk/tools/quickbook/test/para-test.gold (contents, props changed)
trunk/tools/quickbook/test/para-test.quickbook (contents, props changed)
Text files modified:
trunk/tools/quickbook/block.hpp | 9 +++++----
trunk/tools/quickbook/test/Jamfile.v2 | 1 +
2 files changed, 6 insertions(+), 4 deletions(-)
Modified: trunk/tools/quickbook/block.hpp
==============================================================================
--- trunk/tools/quickbook/block.hpp (original)
+++ trunk/tools/quickbook/block.hpp 2010-06-09 20:14:56 EDT (Wed, 09 Jun 2010)
@@ -58,7 +58,7 @@
| code
| list [actions.list]
| hr [actions.hr]
- | comment >> *eol
+ | comment >> +eol
| paragraph [actions.paragraph]
| eol
)
@@ -79,7 +79,8 @@
']' |
if_p(var(no_eols))
[
- eol >> eol // Make sure that we don't go
+ eol >> *blank_p >> eol_p
+ // Make sure that we don't go
] // past a single block, except
; // when preformatted.
@@ -173,7 +174,7 @@
inside_paragraph =
phrase [actions.inside_paragraph]
>> *(
- eol >> eol >> phrase [actions.inside_paragraph]
+ +eol >> phrase [actions.inside_paragraph]
)
;
@@ -408,7 +409,7 @@
;
paragraph_end =
- '[' >> space >> paragraph_end_markups >> hard_space | eol >> eol
+ '[' >> space >> paragraph_end_markups >> hard_space | eol >> *blank_p >> eol_p
;
paragraph =
Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2010-06-09 20:14:56 EDT (Wed, 09 Jun 2010)
@@ -30,6 +30,7 @@
[ quickbook-test section_1_4 ]
[ quickbook-test section_1_5 ]
[ quickbook-test heading ]
+ [ quickbook-test para-test ]
[ quickbook-test table_1_5 ]
[ quickbook-test image_1_5 ]
[ quickbook-test list_test ]
Added: trunk/tools/quickbook/test/para-test.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/para-test.gold 2010-06-09 20:14:56 EDT (Wed, 09 Jun 2010)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="paragraph_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Paragraph Test</title>
+ <articleinfo>
+ </articleinfo>
+ <section id="paragraph_test.some_paragraphs">
+ <title><link linkend="paragraph_test.some_paragraphs">Some Paragraphs</link></title>
+ <para>
+ Shouldn't be a code block.
+ </para>
+ <para>
+ <emphasis role="bold">Should be bold</emphasis>.
+ </para>
+ <para>
+ Should be a single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Lots of newlines round this paragraph.
+ </para>
+ <para>
+ Last paragraph.
+ </para>
+ </section>
+ <section id="paragraph_test.inside___breaking_comment__blocks">
+ <title><link linkend="paragraph_test.inside___breaking_comment__blocks">Inside
+ blocks</link></title>
+ <variablelist>
+ <title></title>
+ <varlistentry>
+ <term>Paragraphs</term>
+ <listitem>
+ <para>
+ Shouldn't be a code block.
+ </para>
+ <para>
+ <emphasis role="bold">Should be bold</emphasis>.
+ </para>
+ <para>
+ Should be a single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Single paragraph.
+ </para>
+ <para>
+ Lots of newlines round this paragraph.
+ </para>
+ <para>
+ Last paragraph.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+</article>
Added: trunk/tools/quickbook/test/para-test.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/para-test.quickbook 2010-06-09 20:14:56 EDT (Wed, 09 Jun 2010)
@@ -0,0 +1,81 @@
+[article Paragraph Test
+ [quickbook 1.5]
+]
+
+[section Some Paragraphs]
+
+[/ Leading comment ] Shouldn't be a code block.
+
+[/ Leading comment ]*Should be bold*.
+
+Should be a
+[/ Breaking comment]
+single paragraph.
+
+Single paragraph.
+[/ Breaking comment]
+
+Single paragraph.
+
+[/ Breaking comment]
+Single paragraph.
+
+Single paragraph.[/ Trailing comment]
+
+
+
+
+
+
+Lots of newlines round this paragraph.
+
+
+
+
+
+
+
+
+Last paragraph.[endsect]
+
+[section Inside
+[/Breaking comment]
+blocks]
+
+[variablelist
+[[Paragraphs][
+[/ Leading comment ] Shouldn't be a code block.
+
+[/ Leading comment ]*Should be bold*.
+
+Should be a
+[/ Breaking comment]
+single paragraph.
+
+Single paragraph.
+[/ Breaking comment]
+
+Single paragraph.
+
+[/ Breaking comment]
+Single paragraph.
+
+Single paragraph.[/ Trailing comment]
+
+
+
+
+
+
+Lots of newlines round this paragraph.
+
+
+
+
+
+
+
+
+Last paragraph.]]]
+
+[endsect]
\ No newline at end of file
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