示例#1
0
class MinimalTemplate(DocumentTemplate):
    stylesheet = OverrideDefault('sphinx_base14')
    parts = OverrideDefault(['contents'])
    contents = ContentsPartTemplate()
    page = PageTemplate(page_size=Var('paper_size'),
                        chapter_title_flowables=None,
                        header_text=None,
                        footer_text=None)
    contents_page = PageTemplate(base='page')
示例#2
0
class Minimal(DocumentTemplate):
    variables = dict(paper_size='a5')

    stylesheet = OverrideDefault('sphinx_base14')
    parts = OverrideDefault(['contents'])
    contents = ContentsPartTemplate()
    page = PageTemplate(page_size=Var('paper_size'),
                        chapter_title_flowables=None)
    contents_page = PageTemplate(base='page')
示例#3
0
class MyDocumentTemplate(DocumentTemplate):
    identifier = 'my_document_template'

    stylesheet = OverrideDefault(sphinx_article)

    parts = OverrideDefault(['title', 'front_matter', 'contents'])

    # default document part templates
    title = MyTitlePartTemplate()
    front_matter = FixedDocumentPartTemplate(page_number_format='continue')
    contents = ContentsPartTemplate(page_number_format='continue')

    # default page templates
    page = PageTemplate(page_size=Var('paper_size'))
    title_page = MyTitlePageTemplate(base='page', top_margin=8 * CM)
    front_matter_page = PageTemplate(base='page')
    contents_page = PageTemplate(base='page')

    TEMPLATE_IMAGE = Image(Path(__file__).parent / 'template.png')
示例#4
0
class MyDocumentTemplate(DocumentTemplate):
    a = Attribute(Bool, True, 'flag A')
    b = Attribute(Bool, True, 'flag B')
    c = Attribute(Bool, True, 'flag C')

    parts = OverrideDefault(['contents'])

    contents = ContentsPartTemplate()

    contents_page = PageTemplate(page_size=Var('paper_size'),
                                 column_spacing=1 * PT)
示例#5
0
class MyTitlePartTemplate(DocumentPartTemplate):
    drop_if_empty = OverrideDefault(False)

    def _flowables(self, document):
        return iter([])