Machine readable documentation

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Machine readable documentation

Post by MasterOfGizmo » Thu May 05, 2022 11:02 am

For my uPIDE micropython IDE I would like to do some micropython specific conext help. I would like to use the .rst files as a basis. Like e.g. this file for the machine module:

https://github.com/micropython/micropyt ... achine.rst

But I am unable to find anything that can read this into a real pythonic data structure. Docutils should be able to do this. But these are sphinx files which are an extension to rst which docutils can't read. Sphinx itself can be used to convert this and there's even a Makefile at https://github.com/micropython/micropyt ... s/Makefile that does this kind of conversion. But even if I use that to convert the rst to let's say JSON then most of the contents ends up HTML'ised to strings inside JSON.

Is there a (pythonic) way of reading those rst files into data structures that allow me to easily extract a description for e.g. a certain module, class or function? I am hesitant to write a parser from scratch ...

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Machine readable documentation

Post by aivarannamaa » Fri May 06, 2022 9:53 am

Aivar Annamaa
https://thonny.org

Post Reply