Let's say I have the following restart:
Some text ... :foo: bar Some text ...
I would like it to be like this:
{"foo": "bar"}
I tried using this:
tree = docutils.core.publish_parts(text)
It parses the list of fields, but in the end I get 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 this is just a line, I am not sure how to parse the list of fields from the reST document. How can I do it?
source share