示例#1
0
文件: rst.py 项目: rhythmus/rinohtype
 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))
示例#2
0
文件: nodes.py 项目: calve/rinohtype
 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')
示例#5
0
文件: rst.py 项目: rhythmus/rinohtype
    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)
示例#6
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     if isinstance(self.parent, Section):
         return rt.Heading(self.text)
     else:
         return rt.Paragraph(self.text, 'title')
示例#7
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     return rt.Paragraph(super().process_content())
示例#8
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     options = (option.process() for option in self.option)
     return rt.Paragraph(intersperse(options, ', '), style='option_group')
示例#9
0
文件: rst.py 项目: rhythmus/rinohtype
 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')
示例#12
0
文件: rst.py 项目: rhythmus/rinohtype
 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')
示例#14
0
 def build_flowables(self):
     yield rt.WarnFlowable("The 'math' directive is not yet supported")
     yield rt.Paragraph(self.process_content(), style=self.style)
示例#15
0
文件: nodes.py 项目: frol/rinohtype
 def build_flowable(self):
     text = self.text.replace(' ', unicodedata.lookup('NO-BREAK SPACE'))
     return rt.Paragraph(text, style='literal')
示例#16
0
文件: nodes.py 项目: frol/rinohtype
 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
示例#17
0
文件: rst.py 项目: rhythmus/rinohtype
 def parse(self, document):
     return rt.Paragraph('footnote', style=self.style('body'))
示例#18
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     return rt.Paragraph(self.text, 'subtitle')
示例#19
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     content = rt.StaticGroupedFlowables(
         [rt.Paragraph(rt.Bold('Tip')),
          super().parse()])
     return rt.Framed(content)
示例#20
0
文件: rst.py 项目: rhythmus/rinohtype
 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())
示例#22
0
文件: nodes.py 项目: MathB/rinohtype
 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')
示例#24
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     return rt.Paragraph(self.process_content() or '\n',
                         style='line block line')
示例#25
0
文件: nodes.py 项目: MathB/rinohtype
 def parse(self):
     return rt.Paragraph(rt.LiteralText(self.text), style='literal')
示例#26
0
文件: nodes.py 项目: MathB/rinohtype
 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')
示例#28
0
文件: rst.py 项目: rhythmus/rinohtype
 def process(self, document, *args, **kwargs):
     return rt.Paragraph(self.text, style=self.style('body'))