Skip to content

Commit e741b37

Browse files
pawamoyWillDaSilva
andcommitted
feat: Add show_signature rendering option
Co-authored-by: Will Da Silva <will@willdasilva.xyz>
1 parent c2ff495 commit e741b37

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/mkdocstrings/handlers/python/renderer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class PythonRenderer(BaseRenderer):
3636
"show_object_full_path": False,
3737
"show_category_heading": False,
3838
"show_if_no_docstring": False,
39+
"show_signature": True,
3940
"show_signature_annotations": False,
4041
"show_source": True,
4142
"show_bases": True,
@@ -54,7 +55,8 @@ class PythonRenderer(BaseRenderer):
5455
**`show_root_members_full_path`** | `bool` | Show the full Python path of objects that are children of the root object (for example, classes in a module). When False, `show_object_full_path` overrides. | `False`
5556
**`show_category_heading`** | `bool` | When grouped by categories, show a heading for each category. | `False`
5657
**`show_if_no_docstring`** | `bool` | Show the object heading even if it has no docstring or children with docstrings. | `False`
57-
**`show_signature_annotations`** | `bool` | Show the type annotations in methods and functions signatures. | `False`
58+
**`show_signature`** | `bool` | Show method and function signatures. | `True`
59+
**`show_signature_annotations`** | `bool` | Show the type annotations in method and function signatures. | `False`
5860
**`show_source`** | `bool` | Show the source code of this object. | `True`
5961
**`show_bases`** | `bool` | Show the base classes of a class. | `True`
6062
**`group_by_category`** | `bool` | Group the object's children by categories: attributes, classes, functions, methods, and modules. | `True`

src/mkdocstrings/templates/python/material/signature.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ log.debug() }}
2-
{%- if signature -%}
2+
{%- if signature and config.show_signature -%}
33
{%- with -%}
44
{%- set ns = namespace(render_pos_only_separator=True, render_kw_only_separator=True, equal="=") -%}
55

0 commit comments

Comments
 (0)