Skip to content

Commit

Permalink
docs: Sorts sections of class member summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyfuture authored and JKatzwinkel committed Jan 17, 2024
1 parent 1adbbce commit 719349d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,31 @@
"NodeSource": "delb.typing.NodeSource",
}

# -- Options for autodocsumm extension ---------------------------------------

MEMBER_SECTIONS_ORDER = (
"Node properties",
"content properties",
"Related",
"Attributes",
"query",
"fetch",
"iterate",
"add nodes",
"remove",
"Methods",
"", # fallback returns lowest weight
)


def autodocsumm_sections_sort(item: str) -> int:
for weight, substring in enumerate(MEMBER_SECTIONS_ORDER):
if substring in item:
return weight


autodocsumm_section_sorter = autodocsumm_sections_sort


# -- Options for intersphinx extension ---------------------------------------

Expand Down

0 comments on commit 719349d

Please sign in to comment.