Page MenuHomePhabricator

[lldb][docs] Filter out 'thisown' attribute and inheritance boilerplate

Authored by teemperor on Jan 19 2021, 6:06 AM.



This patch implements a filter that post-processes some of the generated RST sources
of the Python API docs. I mainly want to avoid two things:

  1. Filter out all the inheritance boilerplate that just keeps mentioning for every class that it inherits from the builtin 'object'. There is no inheritance in the SB API.
  2. More importantly, removes the SWIG generated thisown attribute from the public documentation. I don't think we want users to mess with that attribute and this is probably causing more confusion than it would help anyone. It also makes the documentation for some smaller classes more verbose than necessary.

This patch just uses the sphinx event for reading source and removes the parts that we don't want in documentation.

Diff Detail

Event Timeline

teemperor requested review of this revision.Jan 19 2021, 6:06 AM
teemperor created this revision.
JDevlieghere added inline comments.Jan 19 2021, 8:43 AM

How often is this called? If the answer is "a lot" then maybe a re.compile outside this function would be appropriate?

  • Compile regex only once

Something like 30 times maybe? But maybe this will change in the future, so I moved out the compilation

This revision is now accepted and ready to land.Jan 19 2021, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2021, 12:08 AM