Esempio n. 1
0
 def _parse_node(self, node):
     if node.tag == 'see':
         return self.domain.see(lookup_cref(node.attrib['cref'], self.services))
     elif node.tag == 'paramref':
         return self.domain.paramref(node.attrib['name'])
     elif node.tag == 'a':
         return '`%s <%s>`_' % (node.text.replace('\n',''), node.attrib['href'])
     elif node.tag == 'c':
         return self.domain.code(node.text)
     elif node.tag == 'math':
         return self.domain.math(node.text)
     elif node.tag == 'list':
         content = ['* %s\n' % indent(self._parse(item[0]), width=2)[2:].rstrip() for item in node]
         return '\n'+''.join(content)
     else:
         raise RuntimeError('Unknown node \'%s\'' % node.tag)
Esempio n. 2
0
 def parsesee_filter(cref):
     obj = lookup_cref(cref, services)
     return domain.see(obj)