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
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'))