Skip to content

Commit

Permalink
docs: Various documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 12, 2024
1 parent 7f9757d commit 701ba60
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/usage/configuration/headings.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ plugins:
## `parameter_headings`

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

- **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }**
Expand Down
1 change: 0 additions & 1 deletion docs/usage/configuration/members.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ package

## `summary`

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

- **: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" }**
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.14",
"Topic :: Documentation",
"Topic :: Software Development",
"Topic :: Software Development :: Documentation",
"Topic :: Utilities",
"Typing :: Typed",
]
Expand Down
6 changes: 5 additions & 1 deletion src/mkdocstrings_handlers/python/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class PythonHandler(BaseHandler):
"show_docstring_yields": True,
"show_source": True,
"show_bases": True,
"show_inheritance_diagram": False,
"show_submodules": False,
"group_by_category": True,
"heading_level": 2,
Expand All @@ -119,13 +120,15 @@ class PythonHandler(BaseHandler):
"show_labels": True,
"unwrap_annotated": False,
"parameter_headings": False,
"modernize_annotations": False,
}
"""Default handler configuration.
Attributes: General options:
find_stubs_package (bool): Whether to load stubs package (package-stubs) when extracting docstrings. Default `False`.
allow_inspection (bool): Whether to allow inspecting modules when visiting them is not possible. Default: `True`.
show_bases (bool): Show the base classes of a class. Default: `True`.
show_inheritance_diagram (bool): Show the inheritance diagram of a class using Mermaid. Default: `False`.
show_source (bool): Show the source code of this object. Default: `True`.
preload_modules (list[str] | None): Pre-load modules that are
not specified directly in autodoc instructions (`::: identifier`).
Expand Down Expand Up @@ -200,6 +203,7 @@ class PythonHandler(BaseHandler):
separate_signature (bool): Whether to put the whole signature in a code block below the heading.
If Black is installed, the signature is also formatted using it. Default: `False`.
unwrap_annotated (bool): Whether to unwrap `Annotated` types to show only the type without the annotations. Default: `False`.
modernize_annotations (bool): Whether to modernize annotations, for example `Optional[str]` into `str | None`. Default: `False`.
"""

def __init__(
Expand Down Expand Up @@ -274,7 +278,7 @@ def load_inventory(
) -> Iterator[tuple[str, str]]:
"""Yield items and their URLs from an inventory file streamed from `in_file`.
This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.plugin`][mkdocstrings.plugin]).
This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.plugin`][]).
Arguments:
in_file: The binary file-like object to read the inventory from.
Expand Down
2 changes: 2 additions & 0 deletions src/mkdocstrings_handlers/python/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ def __init__(self, current_object: Object | Alias, config: dict[str, Any]) -> No
config: The configuration dictionary.
"""
self.current_object = current_object
"""The current object being rendered."""
self.config = config
"""The configuration options."""

def expand_identifier(self, identifier: str) -> str:
"""Expand an identifier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

{% set lang_pth = "languages/" ~ locale | get_template %}
{% if lang_pth is existing_template %}
{% import lang_pth as lang %}
{% import "languages/en"|get_template as fallback %}
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
{% import lang_pth as lang %}
{% import "languages/en"|get_template as fallback %}
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
{% else %}
{% import "languages/en"|get_template as lang %}
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
{% import "languages/en"|get_template as lang %}
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
{% endif %}

0 comments on commit 701ba60

Please sign in to comment.