diff options
-rw-r--r-- | example/demo.rst | 19 | ||||
-rw-r--r-- | presentty/rst.py | 10 |
2 files changed, 28 insertions, 1 deletions
diff --git a/example/demo.rst b/example/demo.rst index b7ee4bb..ad8ae77 100644 --- a/example/demo.rst +++ b/example/demo.rst @@ -68,6 +68,25 @@ Table F T === === +Line Blocks +=========== +| +| I bring fresh showers for the thirsting flowers, +| From the seas and the streams; +| I bear light shade for the leaves when laid +| In their noonday dreams. +| From my wings are shaken the dews that waken +| The sweet buds every one, +| When rocked to rest on their mother's breast, +| As she dances about the sun. +| I wield the flail of the lashing hail, +| And whiten the green plains under, +| And then again I dissolve it in rain, +| And laugh as I pass in thunder. +| + +(From "The Cloud", Percy Bysshe Shelley) + Dissolve Transition =================== Transitions may be "dissolve," where one slide cross-fades into the next... diff --git a/presentty/rst.py b/presentty/rst.py index b4258da..5867ca1 100644 --- a/presentty/rst.py +++ b/presentty/rst.py @@ -253,11 +253,19 @@ class UrwidTranslator(docutils.nodes.GenericNodeVisitor): pad = slide.SlidePadding(text, width='pack') self._append(node, pad, 'pack') + def visit_line_block(self, node): + self.stack.append(slide.SlidePile([])) + + def depart_line_block(self, node): + pile = self.stack.pop() + pad = slide.SlidePadding(pile, left=2) + self._append(node, pad, 'pack') + visit_line = visit_textelement def depart_line(self, node): text = self.stack.pop() - self._append(node, urwid.Text(text.getFormattedText(), wrap='clip'), + self._append(node, urwid.Text(text.getFlowedText(), wrap='clip'), 'pack') visit_title = visit_textelement |