code: def process_doc(text):
      
      # remove :ref: directives
      document = docutils.core.publish_doctree(text) # http://epydoc.sourceforge.net/docutils/private/docutils.nodes.document-class.html
      visitor = RefVisitor(document)
      document.walk(visitor)
  
      return visitor.kwd, visitor.values
docs: The :ref: role is supported by Sphinx but not by plain docutils