Skip to content

Commit

Permalink
docs: Improves presentation of NamedTuple subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyfuture authored and JKatzwinkel committed Jan 17, 2024
1 parent 2fc3040 commit 1adbbce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/querying.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Queries with XPath & CSS
========================

.. automodule:: _delb.xpath
:no-inherited-members:
1 change: 1 addition & 0 deletions docs/api/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Methods that add nodes to a tree take a variety of input data:
Definitions that are used for convenient tree building are held in:

.. autoclass:: _delb.nodes._TagDefinition
:no-inherited-members:
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
extensions = [
# in sphinx-extensions
"class_members_categories",
"namedtuples",
# from the cheeseshop
"autodocsumm",
"sphinx_copybutton",
Expand Down
12 changes: 12 additions & 0 deletions docs/sphinx-extensions/namedtuples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def setup(app):
app.connect("autodoc-process-docstring", namedtuple_strip_alias_reference)
return {
"version": "0.1",
"parallel_read_safe": True,
"parallel_write_safe": True,
}


def namedtuple_strip_alias_reference(app, what, name, obj, options, lines):
if lines and lines[0].startswith("Alias for field number "):
lines.clear()

0 comments on commit 1adbbce

Please sign in to comment.