Skip to content

Commit a0e223a

Browse files
committed
tweak docstring example
1 parent 656242e commit a0e223a

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

docs/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ plugins:
3838
- redirects:
3939
redirect_maps:
4040
"index.md": "getting_started/index.md"
41-
- mkdocstrings
42-
41+
- mkdocstrings:
42+
default_handler: python
4343
markdown_extensions:
4444
- attr_list
4545

element_array_ephys/docstring_example.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# element_array_ephys/docstring_example.py
22

3-
"""Provide several sample math calculations.
3+
"""--Module-level docstring--
44
55
This module allows the user to make mathematical calculations.
66
@@ -25,7 +25,9 @@
2525
from typing import Union
2626

2727
def add(a: Union[float, int], b: Union[float, int]) -> float:
28-
"""Compute and return the sum of two numbers.
28+
"""--Function-level docstring--
29+
30+
Compute and return the sum of two numbers.
2931
3032
Examples:
3133
>>> add(4.0, 2.0)
@@ -40,4 +42,19 @@ def add(a: Union[float, int], b: Union[float, int]) -> float:
4042
Returns:
4143
A number representing the artihmetic sum of `a` and `b`.
4244
"""
43-
return float(a + b)
45+
return float(a + b)
46+
47+
class MyClass:
48+
"""--Class-level docstring--"""
49+
50+
def method_a(self):
51+
"""Print A!"""
52+
print("A!")
53+
54+
def method_b(self):
55+
"""Print B!"""
56+
print("B!")
57+
58+
def method_c(self):
59+
"""Print C!"""
60+
print("C!")

0 commit comments

Comments
 (0)