def parse(self, document): if isinstance(self.parent, List_Item): style = 'list item' else: style = 'body' return rt.Paragraph(super().process_content(document), style=self.style(style))
def process(self): term = self.term.styled_text() try: term += ' : ' + self.classifier.styled_text() except AttributeError: pass return (rt.DefinitionTerm([rt.Paragraph(term)]), self.definition.flowable())
def build_flowable(self): term_text = self.term.styled_text() try: for classifier in self.classifier: term_text += ' : ' + classifier.styled_text() except AttributeError: pass term = rt.StaticGroupedFlowables([rt.Paragraph(term_text)], style='definition term') return rt.LabeledFlowable(term, self.definition.flowable())
def build_flowable(self): if isinstance(self.parent, Document): return rt.SetMetadataFlowable(title=self.process_content()) elif isinstance(self.parent, Section): try: kwargs = dict(custom_label=self.generated.build_styled_text()) except AttributeError: kwargs = dict() return rt.Heading(self.process_content(), **kwargs) else: return rt.Paragraph(self.process_content(), style='title')
def parse_input(self): ## toc = TableOfContents(style=toc_style, styles=toc_levels) self.content_flowables = [] self.content_flowables.append( rt.Paragraph(self.root.title.text, styles['title'])) for section in self.root.section: ## toc.register(flowable) for flowable in section.parse(self): self.content_flowables.append(flowable)
def parse(self): if isinstance(self.parent, Section): return rt.Heading(self.text) else: return rt.Paragraph(self.text, 'title')
def parse(self): return rt.Paragraph(super().process_content())
def parse(self): options = (option.process() for option in self.option) return rt.Paragraph(intersperse(options, ', '), style='option_group')
def parse(self, document): return rt.Paragraph('TIP: ' + super().process_content(document), style=self.style('body'))
def build_flowable(self): label = rt.Paragraph(self.field_name.styled_text(), style='field name') return rt.LabeledFlowable(label, self.field_body.flowable())
def build_flowable(self): return rt.Paragraph(self.process_content() or '\n', style='line block line')
def parse(self, document): return rt.Paragraph(super().process_content(document), style=self.style('block quote'))
def build_flowable(self): return rt.Paragraph(self.process_content(), style='rubric')
def build_flowables(self): yield rt.WarnFlowable("The 'math' directive is not yet supported") yield rt.Paragraph(self.process_content(), style=self.style)
def build_flowable(self): text = self.text.replace(' ', unicodedata.lookup('NO-BREAK SPACE')) return rt.Paragraph(text, style='literal')
def flowable(self): title_par = rt.Paragraph(self.title, style='title') content = rt.StaticGroupedFlowables([title_par, super().flowable()]) framed = rt.Framed(content, style='admonition') framed.admonition_type = self.__class__.__name__.lower() return framed
def parse(self, document): return rt.Paragraph('footnote', style=self.style('body'))
def parse(self): return rt.Paragraph(self.text, 'subtitle')
def parse(self): content = rt.StaticGroupedFlowables( [rt.Paragraph(rt.Bold('Tip')), super().parse()]) return rt.Framed(content)
def parse(self, document): return rt.Paragraph(rt.LiteralText(self.text), style=self.style('literal'))
def build_flowable(self): return rt.Paragraph(super().process_content())
def parse(self): return rt.Paragraph('\N{EM DASH}' + self.process_content(), style='attribution')
def build_flowable(self): return rt.Paragraph('\N{EM DASH}' + self.process_content(), style='attribution')
def parse(self): return rt.Paragraph(self.process_content() or '\n', style='line block line')
def parse(self): return rt.Paragraph(rt.LiteralText(self.text), style='literal')
def parse(self): return rt.Paragraph(self.process_content(), style='field_name')
def build_flowable(self): options = (option.styled_text() for option in self.option) return rt.Paragraph(intersperse(options, ', '), style='option_group')
def process(self, document, *args, **kwargs): return rt.Paragraph(self.text, style=self.style('body'))