James Tocknell committed 51ab306

Added template for handler class

  • Participants
  • Parent commits 1d3c6c7

Comments (0)

Files changed (2)

File docs/fake/shinypress/

+class Handler(object):
+    """
+    Handlers convert content into something that can be rendered onto a cairo
+    context
+    """
+    templates = []
+    def __init__(self):
+        raise NotImplemented
+    def layout(self, theme):
+        """
+        Takes a theme, and returns a list of tuples, with each tuple
+        corresponding to a slide. Each tuple is composed of a string, which is
+        the name of the template to be used for that slide, and a dictionary
+        mapping a named block to a function which takes a cairo context and
+        renders the handlers content onto the context.
+        :param theme: a theme object
+        :rtype: a list of tuples of a template and a dictionary mapping blocks
+            to functions
+        """
+        raise NotImplemented

File docs/layout.rst

 the handler can use are not given. Handlers should specify what templates can be
 used as a list of strings in ``Handler.templates``.
+.. automodule:: shinypress.handler
+    :members: