def __init__(self, *args): self.rst_terms['section'] = ['slide', 'visit_section', 'depart_section'] # [0] might be replaced later self.rst_terms['slide_contents'] = ('section', 'default_visit', 'default_departure') self.rst_terms['title'] = (None, 'visit_title', 'depart_title') # flatten titles self.rst_terms['presentation'] = (None, 'visit_presentation', None) HTML5Translator.__init__(self, *args) self.metatags.append(tag.meta(generator='rst2html5slides')) self.metatags.append(tag.meta(generator_homepage='https://pypi.python.org/pypi/rst2html5slides')) self._reset_settings() return
def _compacted_paragraph(self, node): ''' a single node followed by a single field list should also be compacted ''' field_list_sibling = len([n for n in node.parent if not isinstance(n, (nodes.field_list))]) == 1 return not node['classes'] and \ (HTML5Translator._compacted_paragraph(self, node) or field_list_sibling)