+ Describes how the handlers should render their content.
+ Load a theme specification from a JSON file.
+ def get_block_size(self, template, block):
+ Get the size of the given block in the named template.
+ :param template: name of the template
+ :param block: name of the block
+ :rtype: (width, height) tuple
This section describes the interaction between handlers and themes.
+To render multiple handlers:
+ from shinypress.theme import Theme
+ with open('my-theme.json', 'rb') as f:
+ theme = Theme.from_json(f)
+ surf = cairo.PDFSurface('slides.pdf', 1024, 768)
+ ctx = cairo.Context(surf)
+ for handler in handlers:
+ slide_layouts = handler.layout(theme)
+ for template, blocks in slide_layouts:
+ theme.render(template, blocks)
+Themes are responsible for deciding where the handlers should draw their blocks.
+.. automodule:: shinypress.theme