klauer / blark

Beckhoff TwinCAT ST (IEC 61131-3) code parsing in Python using Lark (Earley)
https://klauer.github.io/blark/
GNU General Public License v2.0
42 stars 5 forks source link

ENH: initial attempts at code summary layer, sphinx domain #12

Closed klauer closed 2 years ago

klauer commented 2 years ago

Changes in no particular order

Documentation?

So far, just function blocks + methods:

image

Generated by way of pointing to the project in Sphinx conf.py:

.. bk:functionblock:: FB_TempSensor

Things which I don't have a clue how to approach just yet:

klauer commented 2 years ago

Despite the above, I'm going to redo this entirely working with docutils.nodes and sphinx addnodes (removing Jinja from the equation). It's a more standard way of doing things, though I'm not finding much documentation on how those nodes should be structured, so it may take a bit.

klauer commented 2 years ago

There's still a lot left to do here, but the structure is OK enough as-is to merge for now.

There will be follow-ups down the line at some point. One day entire PLC projects' API will be easily documentable in sphinx, but today is not that day...