def fixAPI(document, url):
 for node in domhelpers.findElementsWithAttribute(document, 'class', 'API'):
  fullname = _getAPI(node)
  anchor = dom.Element('a')
  anchor.setAttribute('href', (url % (fullname,)))
  anchor.setAttribute('title', fullname)
  while node.childNodes:
   child = node.childNodes[0]
   node.removeChild(child)
   anchor.appendChild(child)
  node.appendChild(anchor)
  if node.hasAttribute('base'):
   node.removeAttribute('base')

def fixAPI ( document , url ) : for node in domhelpers . findElementsWithAttribute ( document , 'class' , 'API' ) : fullname = _getAPI ( node ) anchor = dom . Element ( 'a' ) anchor . setAttribute ( 'href' , ( url % ( fullname , ) ) ) anchor . setAttribute ( 'title' , fullname ) while node . childNodes : child = node . childNodes [ 0 ] node . removeChild ( child ) anchor . appendChild ( child ) node . appendChild ( anchor ) if node . hasAttribute ( 'base' ) : node . removeAttribute ( 'base' )
replace api references with links to api documentation .