示例#1
0
文件: nodes.py 项目: wxtim/rinohtype
 def build_flowable(self):
     children = self.getchildren()
     assert len(children) == 1
     image = self.image.flowable()
     if self.get('refid'):
         image.annotation = rt.NamedDestinationLink(self.get('refid'))
     elif self.get('refuri'):
         image.annotation = rt.HyperLink(self.get('refuri'))
     return image
示例#2
0
文件: nodes.py 项目: frol/rinohtype
 def build_styled_text(self):
     if self.get('refid'):
         link = rt.NamedDestinationLink(self.get('refid'))
         style = 'internal link'
     elif self.get('refuri'):
         link = rt.HyperLink(self.get('refuri'))
         style = 'external link'
     else:
         return rt.MixedStyledText(self.process_content(),
                                   style='broken link')
     return rt.AnnotatedText(self.process_content(), link, style=style)
 def annotation(self):
     if self.get('refid'):
         return rt.NamedDestinationLink(self.get('refid'))
     elif self.get('refuri'):
         return rt.HyperLink(self.get('refuri'))