diff options
author | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-09-17 11:12:15 +0200 |
---|---|---|
committer | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-09-17 11:12:15 +0200 |
commit | 9b03c9f4a0b2fe7401baaf0b0191ecdf95c0c437 (patch) | |
tree | 3b821aeeaef9b8e6e6c47aaf10b35d5ef202593b | |
parent | ecf071dcc4f2447eee93c76d3c6e4201c97b3589 (diff) | |
download | context-rst-9b03c9f4a0b2fe7401baaf0b0191ecdf95c0c437.tar.gz |
using fancybreaks module for transitions. fixed section/transition matching (hope so).
-rw-r--r-- | rst_context.lua | 16 | ||||
-rw-r--r-- | rst_parser.lua | 16 |
2 files changed, 27 insertions, 5 deletions
diff --git a/rst_context.lua b/rst_context.lua index 05ed14f..71e9e09 100644 --- a/rst_context.lua +++ b/rst_context.lua @@ -537,7 +537,9 @@ end -- Prime time for the fancybreak module. function rst_context.transition (str) - return "\n\\hrule\n" + rst_context.addsetups("breaks") + --return "\\fancybreak\n" + return "\\fancybreak{$* * *$}\n" end function rst_context.bullet_marker(str) @@ -1253,4 +1255,16 @@ function optional_setups.lines () ]] end +function optional_setups.breaks () + return [[ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Fancy transitions % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\usemodule[fancybreak] +\setupfancybreak[symbol=star] +]] +end + return rst_context diff --git a/rst_parser.lua b/rst_parser.lua index a83209a..b17e2fd 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -129,8 +129,8 @@ local parser = P{ + Cs(V"list") / rst.escape + Cs(V"line_block") / rst.escape + Cs(V"table_block") / rst.escape + + V"transition" --/ rst.escape + Cs(V"section") / rst.escape - + Cs(V"transition") --/ rst.escape + V"literal_block" + Cs(V"block_quote") / rst.escape + V"comment_block" @@ -928,10 +928,10 @@ local parser = P{ transition_line = C(V"adornment_char"^4), - transition = V"eol"^0 - * V"transition_line" + transition = V"transition_line" * V"eol" * V"end_block" - /rst.transition, + / rst.transition + , -------------------------------------------------------------------------------- -- Sectioning @@ -1299,6 +1299,8 @@ local function get_setups () %{ Setups }% %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% General % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setupcolors[state=start] \setupinteraction[state=start,focus=standard,color=darkgreen,contrastcolor=darkgreen] @@ -1306,6 +1308,12 @@ local function get_setups () \sethyphenatedurlnormal{:=?&} \sethyphenatedurlbefore{?&} \sethyphenatedurlafter {:=/-} + +\doifundefined{startparagraph}{% -->mkii + \let\startparagraph\relax + \let\stopparagraph\endgraf +} + ]] for item, _ in next, state.addme do |