From 1af3e6e47b9072c481aa2d40cedd3b9b99220817 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 24 Sep 2010 15:38:46 +0200 Subject: added line block example to manual --- doc/documentation.rst | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ rst_parser.lua | 3 ++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/doc/documentation.rst b/doc/documentation.rst index acb8b18..4a5a692 100644 --- a/doc/documentation.rst +++ b/doc/documentation.rst @@ -231,6 +231,57 @@ v First order list, fifth entry. .. caution:: Don’t forget the blank lines between list items. +Line Blocks +*********** + +Line blocks are a convenient environment for parts of the text +that need to preserve line breaks and indentation. This makes it +the first choice for most kinds of poems: :: + + | When does a dream begin? + | Does it start with a goodnight kiss? + | Is it conceived or simply achieved? + | When does a dream begin? + | + | When does a dream begin? + | Is it born in a moment of bliss? + | Or is it begun when two hearts are one? + | When does a dream exist? + | + | The vision of you appears somehow + Impossible to resist + | But I'm not imagining seeing you + For who could have dreamed of this? + | + | When does a dream begin? + | When reality is dismissed? + | Or does it commence when we lose all pretence? + | When does a dream begin? + +Indentation, continued lines, etc. should work out without +problems: + +| When does a dream begin? +| Does it start with a goodnight kiss? +| Is it conceived or simply achieved? +| When does a dream begin? +| +| When does a dream begin? +| Is it born in a moment of bliss? +| Or is it begun when two hearts are one? +| When does a dream exist? +| +| The vision of you appears somehow + Impossible to resist +| But I'm not imagining seeing you + For who could have dreamed of this? +| +| When does a dream begin? +| When reality is dismissed? +| Or does it commence when we lose all pretence? +| When does a dream begin? + + ========== Directives ========== diff --git a/rst_parser.lua b/rst_parser.lua index 5cf974c..c42b53e 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -559,7 +559,8 @@ local parser = P{ line_block = Cs(V"line_block_first" * (V"line_block_other" + V"line_block_empty")^1) - * V"blank_line" + --* V"blank_line" + * V"end_block" / rst.line_block , -- cgit v1.2.3