def process_doc(text):
<EOL>document = docutils.core.publish_doctree(text) <EOL>visitor = RefVisitor(document)<EOL>document.walk(visitor)<EOL>return visitor.kwd, visitor.values<EOL>
The :ref: role is supported by Sphinx but not by plain docutils