James Tocknell avatar James Tocknell committed 51ab306

Added template for handler class

Comments (0)

Files changed (2)

docs/fake/shinypress/handler.py

+
+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
+
 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:
+
 Themes
 ~~~~~~
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.