def build_styled_text(self): # TODO: what about refid? try: destination = rt.NamedDestination(*self._ids) return rt.AnnotatedText(self.process_content(), destination) except IndexError: return self.process_content() # TODO: use refname?
def build_styled_text(self): content = self.process_content() ids = self.get('ids') if ids: # TODO: add destination for each id destination = rt.NamedDestination(ids[0]) content = rt.AnnotatedText(content, destination) return content
def build_styled_text(self): annotation = self.annotation content = self.process_content() if annotation is None: return rt.MixedStyledText(content, style='broken link') style = ('external link' if annotation.type == 'URI' else 'internal link') return rt.AnnotatedText(content, annotation, style=style)
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 build_styled_text(self): content = self.process_content() if self._ids: destination = rt.NamedDestination(*self._ids) content = rt.AnnotatedText(content, destination) return content