Skip to content

Commit

Permalink
Document attributes, signals (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored Aug 13, 2024
1 parent af47e41 commit 3e1b572
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions process_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@
with open("pyqgis_conf.yml") as f:
cfg = yaml.safe_load(f)

from sphinx.ext.autodoc import Documenter
old_get_doc = Documenter.get_doc


def new_get_doc(self) -> list[list[str]] | None:
try:
if self.object_name in self.parent.__attribute_docs__:
docs = self.parent.__attribute_docs__[self.object_name]
return [docs.split('\n')]
except AttributeError:
pass

return old_get_doc(self)


Documenter.get_doc = new_get_doc


# https://github.com/sphinx-doc/sphinx/blob/685e3fdb49c42b464e09ec955e1033e2a8729fff/sphinx/ext/autodoc/__init__.py#L51
# adapted to handle signals
Expand Down

0 comments on commit 3e1b572

Please sign in to comment.