Skip to content

Commit 5d834fa

Browse files
committed
docs: Format code snippets
1 parent d5337af commit 5d834fa

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

docs/usage/configuration/general.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ plugins:
125125
type: quote
126126

127127
```python linenums="1"
128-
def some_function(): ...
128+
def some_function():
129+
...
129130
```
130131
/////
131132
////

docs/usage/configuration/members.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@ plugins:
4747
```python title="package/module.py"
4848
"""Module docstring."""
4949

50+
5051
def this_function():
5152
"""Function docstring."""
5253

54+
5355
class ThisClass:
5456
"""Class docstring."""
57+
5558
def method(self):
5659
"""Method docstring."""
5760

61+
5862
this_attribute = 0
5963
"""Attribute docstring."""
6064
```
@@ -207,6 +211,7 @@ plugins:
207211
```python title="package/module.py"
208212
"""Module docstring."""
209213
214+
210215
class Base:
211216
"""Base class."""
212217
@@ -283,12 +288,15 @@ plugins:
283288
```python title="package/module.py"
284289
"""Module docstring."""
285290
291+
286292
def function_b():
287293
"""Function a."""
288294
295+
289296
def function_a():
290297
"""Function b."""
291298
299+
292300
def function_c():
293301
"""Function c."""
294302
```
@@ -373,8 +381,12 @@ plugins:
373381
```
374382

375383
```python title="package/module.py"
376-
def hello(): ...
377-
def _world(): ...
384+
def hello():
385+
...
386+
387+
388+
def _world():
389+
...
378390
```
379391

380392
/// admonition | Preview
@@ -437,10 +449,19 @@ plugins:
437449
```
438450

439451
```python title="package/module.py"
440-
def function_a(): ...
441-
class ClassB: ...
452+
def function_a():
453+
...
454+
455+
456+
class ClassB:
457+
...
458+
459+
442460
attribute_C = 0
443-
def function_d(): ...
461+
462+
463+
def function_d():
464+
...
444465
```
445466

446467
/// admonition | Preview

docs/usage/customization.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ from pathlib import Path
6363
basedir = "src/mkdocstrings_handlers/python/templates/material"
6464
print("theme/")
6565
for filepath in sorted(path for path in Path(basedir).rglob("*") if "_base" not in str(path) and path.suffix != ".css"):
66-
print(" " * (len(filepath.relative_to(basedir).parent.parts) + 1) + filepath.name + ("/" if filepath.is_dir() else ""))
66+
print(
67+
" " * (len(filepath.relative_to(basedir).parent.parts) + 1)
68+
+ filepath.name
69+
+ ("/" if filepath.is_dir() else "")
70+
)
6771
```
6872

6973
See them [in the repository](https://github.com/mkdocstrings/python/tree/master/src/mkdocstrings_handlers/python/templates/).

0 commit comments

Comments
 (0)