Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
_version.py
/build/
/dist/
/.python-version

# Testing
/.coverage
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test = [
]
doc = [
'scanpydoc[typehints]',
'sphinx<7', # https://github.com/readthedocs/sphinx_rtd_theme/issues/1463
'sphinx-rtd-theme',
]
typehints = ['sphinx-autodoc-typehints>=1.15.2']
Expand Down
9 changes: 5 additions & 4 deletions src/scanpydoc/definition_list_typed_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def make_refs(role_name, name, node):
def handle_item(
fieldarg: str, content: list[nodes.inline]
) -> nodes.definition_list_item:
head = nodes.term()
head = nodes.inline()
head += make_refs(self.rolename, fieldarg, addnodes.literal_strong)
field_type = types.pop(fieldarg, None)
if field_type is not None:
Expand All @@ -61,15 +61,16 @@ def handle_item(
else:
head += field_type

# Contents are wrapped into a span for pydata sphinx theme
head_wrap = nodes.term("", "", head)
body_content = nodes.paragraph("", "", *content)
body = nodes.definition("", body_content)

return nodes.definition_list_item("", head, body)
return nodes.definition_list_item("", head_wrap, body)

field_name = nodes.field_name("", self.label)
assert not self.can_collapse
# “field-list” for pydata sphinx theme
body_node = self.list_type(classes=["field-list"])
body_node = self.list_type(classes=["simple"])
for field_arg, content in items:
body_node += handle_item(field_arg, content)
field_body = nodes.field_body("", body_node)
Expand Down