Skip to content

Commit 701ba60

Browse files
committed
docs: Various documentation updates
1 parent 7f9757d commit 701ba60

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

docs/usage/configuration/headings.md

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ plugins:
5959
6060
## `parameter_headings`
6161

62-
[:octicons-heart-fill-24:{ .pulse } Sponsors only](../../insiders/index.md){ .insiders } —
6362
[:octicons-tag-24: Insiders 1.6.0](../../insiders/changelog.md#1.6.0)
6463

6564
- **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }**

docs/usage/configuration/members.md

-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ package
552552

553553
## `summary`
554554

555-
[:octicons-heart-fill-24:{ .pulse } Sponsors only](../../insiders/index.md){ .insiders } —
556555
[:octicons-tag-24: Insiders 1.2.0](../../insiders/changelog.md#1.2.0)
557556

558557
- **:octicons-package-24: Type <code><autoref identifier="bool" optional>bool</autoref> | <autoref identifier="dict" optional>dict</autoref>[<autoref identifier="str" optional>str</autoref>, <autoref identifier="bool" optional>bool</autoref>]</code> :material-equal: `False`{ title="default value" }**

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.14",
2626
"Topic :: Documentation",
2727
"Topic :: Software Development",
28+
"Topic :: Software Development :: Documentation",
2829
"Topic :: Utilities",
2930
"Typing :: Typed",
3031
]

src/mkdocstrings_handlers/python/handler.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class PythonHandler(BaseHandler):
104104
"show_docstring_yields": True,
105105
"show_source": True,
106106
"show_bases": True,
107+
"show_inheritance_diagram": False,
107108
"show_submodules": False,
108109
"group_by_category": True,
109110
"heading_level": 2,
@@ -119,13 +120,15 @@ class PythonHandler(BaseHandler):
119120
"show_labels": True,
120121
"unwrap_annotated": False,
121122
"parameter_headings": False,
123+
"modernize_annotations": False,
122124
}
123125
"""Default handler configuration.
124126
125127
Attributes: General options:
126128
find_stubs_package (bool): Whether to load stubs package (package-stubs) when extracting docstrings. Default `False`.
127129
allow_inspection (bool): Whether to allow inspecting modules when visiting them is not possible. Default: `True`.
128130
show_bases (bool): Show the base classes of a class. Default: `True`.
131+
show_inheritance_diagram (bool): Show the inheritance diagram of a class using Mermaid. Default: `False`.
129132
show_source (bool): Show the source code of this object. Default: `True`.
130133
preload_modules (list[str] | None): Pre-load modules that are
131134
not specified directly in autodoc instructions (`::: identifier`).
@@ -200,6 +203,7 @@ class PythonHandler(BaseHandler):
200203
separate_signature (bool): Whether to put the whole signature in a code block below the heading.
201204
If Black is installed, the signature is also formatted using it. Default: `False`.
202205
unwrap_annotated (bool): Whether to unwrap `Annotated` types to show only the type without the annotations. Default: `False`.
206+
modernize_annotations (bool): Whether to modernize annotations, for example `Optional[str]` into `str | None`. Default: `False`.
203207
"""
204208

205209
def __init__(
@@ -274,7 +278,7 @@ def load_inventory(
274278
) -> Iterator[tuple[str, str]]:
275279
"""Yield items and their URLs from an inventory file streamed from `in_file`.
276280
277-
This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.plugin`][mkdocstrings.plugin]).
281+
This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.plugin`][]).
278282
279283
Arguments:
280284
in_file: The binary file-like object to read the inventory from.

src/mkdocstrings_handlers/python/rendering.py

+2
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ def __init__(self, current_object: Object | Alias, config: dict[str, Any]) -> No
612612
config: The configuration dictionary.
613613
"""
614614
self.current_object = current_object
615+
"""The current object being rendered."""
615616
self.config = config
617+
"""The configuration options."""
616618

617619
def expand_identifier(self, identifier: str) -> str:
618620
"""Expand an identifier.

src/mkdocstrings_handlers/python/templates/readthedocs/_base/language.html.jinja

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
{% set lang_pth = "languages/" ~ locale | get_template %}
1111
{% if lang_pth is existing_template %}
12-
{% import lang_pth as lang %}
13-
{% import "languages/en"|get_template as fallback %}
14-
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
12+
{% import lang_pth as lang %}
13+
{% import "languages/en"|get_template as fallback %}
14+
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
1515
{% else %}
16-
{% import "languages/en"|get_template as lang %}
17-
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
16+
{% import "languages/en"|get_template as lang %}
17+
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
1818
{% endif %}

0 commit comments

Comments
 (0)