Skip to content

Commit d576927

Browse files
committed
docs: Add back missing snippets
1 parent 71ea2d8 commit d576927

4 files changed

Lines changed: 36 additions & 1 deletion

File tree

config/flake8.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = fixtures,site
2+
exclude = fixtures,site,snippets
33
max-line-length = 132
44
docstring-convention = google
55
ban-relative-imports = true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from typing import Optional
2+
3+
4+
def my_function(param1: int, param2: Optional[str] = None) -> str:
5+
"""A short description of this function.
6+
7+
Arguments:
8+
param1: An integer?
9+
param2: A string? If you have a long description,
10+
you can split it on multiple lines.
11+
Just remember to indent those lines consistently.
12+
13+
Complex markup is supported in sections items.
14+
15+
I'm a code block!
16+
"""
17+
return f"{param2}{param1}"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import Optional
2+
3+
4+
def my_function(param1: int, param2: Optional[str] = None) -> str:
5+
"""A short description of this function.
6+
7+
Complex markup is supported in the main description section.
8+
9+
I'm a code block!
10+
11+
:param param1: An integer?
12+
:param param2: A string? If you have a long description,
13+
you can split it on multiple lines.
14+
"""
15+
return f"{param2}{param1}"

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ plugins:
7373
python:
7474
import:
7575
- https://mkdocstrings.github.io/objects.inv
76+
setup_commands:
77+
- import sys
78+
- sys.path.append("docs")
7679
watch:
7780
- src/mkdocstrings
7881

0 commit comments

Comments
 (0)