[docs] [issue37390] Generate table of audit events for docs

Karthikeyan Singaravelan report at bugs.python.org
Mon Jun 24 15:08:04 EDT 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

I think my approach suffers from the drawback where duplicate items cannot be separated correctly as you have mentioned. Example as below where socket.connect and socket.connect_ex emit same event and I am not able to retrieve the function at which the audit event block is present thus generating the same entry twice in the table. Maybe I need to store some more metadata.

1153:.. method:: socket.connect(address)
1165:   .. audit-event:: socket.connect "self address"
1174:.. method:: socket.connect_ex(address)
1183:   .. audit-event:: socket.connect "self address"

> * include links back to the section where they came from

Sphinx doesn't seem to support hyperlinking to line numbers. One approach would be to just link to the functions that emit the events that could solve the above problem too.

I did this as a PoC and kind of stuck with moving the file to a separate to a different table of content. I also seemed to have hit a sphinx bug that I couldn't get out of and my skills are limited too in Sphinx. I will give it another try over this week to see if I can come up with something mergeable :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37390>
_______________________________________


More information about the docs mailing list