Extract field list from reStructuredText
问题 Say I have the following reST input: Some text ... :foo: bar Some text ... What I would like to end up with is a dict like this: {"foo": "bar"} I tried to use this: tree = docutils.core.publish_parts(text) It does parse the field list, but I end up with some pseudo XML in tree["whole"]? : <document source="<string>"> <docinfo> <field> <field_name> foo <field_body> <paragraph> bar Since the tree dict does not contain any other useful information and that is just a string, I am not sure how to