3

I can use docutils to parse reStructuredText formatted docstrings, but it doesn't parse the directives themselves that belong to the Python domain. For example, :type path: unicode gets parsed as:

<field>
        <field_name>type path</field_name>
        <field_body>
                <paragraph>unicode</paragraph>
        </field_body>
</field>

Can I use Sphinx to programmatically get more meaning out of it? I.e. parameter names, etc?

Márcio
  • 677
  • 8
  • 15
  • I think this should be possible by [writing a Sphinx extension](http://sphinx-doc.org/ext/tutorial.html) that does whatever you want by inspecting the generated doctree. Also checking the list of [available builders](http://sphinx-doc.org/builders.html) and looking at their source could help. – Lukas Graf Oct 05 '13 at 17:03
  • Thanks, that was my first idea too, I'll give it a go. – Márcio Oct 05 '13 at 21:24
  • 1
    Similar: http://stackoverflow.com/q/8125238/407651 – mzjn Oct 06 '13 at 14:09

0 Answers0