Skip to content

Commit 9cfb324

Browse files
committed
docs: Improve docs
1 parent 47c53fc commit 9cfb324

File tree

7 files changed

+414
-220
lines changed

7 files changed

+414
-220
lines changed

README.md

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,86 @@
1-
# mkdocstrings-python (legacy)
1+
<h1 align="center">mkdocstrings-python-legacy</h1>
22

3-
[![ci](https://github.com/mkdocstrings/python-legacy/workflows/ci/badge.svg)](https://github.com/mkdocstrings/python-legacy/actions?query=workflow%3Aci)
4-
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/python-legacy/)
5-
[![pypi version](https://img.shields.io/pypi/v/mkdocstrings-python-legacy.svg)](https://pypi.org/project/mkdocstrings-python-legacy/)
6-
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/python-legacy)
7-
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/mkdocstrings/python-legacy)
3+
<p align="center">The legacy Python handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
84

9-
A legacy Python handler for mkdocstrings.
5+
<p align="center">
6+
<a href="https://github.com/mkdocstrings/python-legacy/actions?query=workflow%3Aci">
7+
<img alt="ci" src="https://github.com/mkdocstrings/python-legacy/workflows/ci/badge.svg" />
8+
</a>
9+
<a href="https://mkdocstrings.github.io/python-legacy/">
10+
<img alt="documentation" src="https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat" />
11+
</a>
12+
<a href="https://pypi.org/project/mkdocstrings-python-legacy/">
13+
<img alt="pypi version" src="https://img.shields.io/pypi/v/mkdocstrings-python-legacy.svg" />
14+
</a>
15+
<a href="https://gitpod.io/#https://github.com/mkdocstrings/python-legacy">
16+
<img alt="gitpod" src="https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat" />
17+
</a>
18+
<a href="https://gitter.im/mkdocstrings/python-legacy">
19+
<img alt="gitter" src="https://badges.gitter.im/join%20chat.svg" />
20+
</a>
21+
</p>
22+
23+
---
24+
25+
<p align="center"><img src="logo.png"></p>
26+
27+
WARNING: We suggest using the new handler instead:
28+
[mkdocstrings-python](https://mkdocstrings.github.io/python/).
1029

1130
## Installation
1231

13-
With `pip`:
14-
```bash
15-
pip install mkdocstrings-python-legacy
32+
You can install this handler as a *mkdocstrings* extra:
33+
34+
```toml title="pyproject.toml"
35+
# PEP 621 dependencies declaration
36+
# adapt to your dependencies manager
37+
[project]
38+
dependencies = [
39+
"mkdocstrings[python-legacy]>=0.18",
40+
]
1641
```
1742

18-
With [`pipx`](https://github.com/pipxproject/pipx):
19-
```bash
20-
python3.7 -m pip install --user pipx
21-
pipx install mkdocstrings-python-legacy
43+
You can also explicitely depend on the handler:
44+
45+
```toml title="pyproject.toml"
46+
# PEP 621 dependencies declaration
47+
# adapt to your dependencies manager
48+
[project]
49+
dependencies = [
50+
"mkdocstrings-python-legacy",
51+
]
2252
```
53+
54+
## Preview
55+
56+
<!-- TODO: update the GIF with a more recent screen capture. Maybe use mp4 instead -->
57+
![mkdocstrings_python_gif](https://user-images.githubusercontent.com/3999221/77157838-7184db80-6aa2-11ea-9f9a-fe77405202de.gif)
58+
59+
## Features
60+
61+
- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
62+
[pytkdocs](https://github.com/mkdocstrings/pytkdocs).
63+
64+
- **Support for type annotations:** pytkdocs collects your type annotations and *mkdocstrings* uses them
65+
to display parameters types or return types.
66+
67+
- **Recursive documentation of Python objects:** just use the module dotted-path as identifier, and you get the full
68+
module docs. You don't need to inject documentation for each class, function, etc.
69+
70+
- **Support for documented attributes:** attributes (variables) followed by a docstring (triple-quoted string) will
71+
be recognized by Griffe in modules, classes and even in `__init__` methods.
72+
73+
- **Multiple docstring-styles support:** common support for Google-style, Numpydoc-style,
74+
and Sphinx-style docstrings.
75+
76+
- **Admonition support in Google docstrings:** blocks like `Note:` or `Warning:` will be transformed
77+
to their [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) equivalent.
78+
*We do not support nested admonitions in docstrings!*
79+
80+
- **Every object has a TOC entry:** we render a heading for each object, meaning *MkDocs* picks them into the Table
81+
of Contents, which is nicely display by the Material theme. Thanks to *mkdocstrings* cross-reference ability,
82+
you can reference other objects within your docstrings, with the classic Markdown syntax:
83+
`[this object][package.module.object]` or directly with `[package.module.object][]`
84+
85+
- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code
86+
of the Python object.

docs/css/mkdocstrings.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* Indentation. */
22
div.doc-contents:not(.first) {
33
padding-left: 25px;
4-
border-left: 4px solid rgba(230, 230, 230);
5-
margin-bottom: 80px;
4+
border-left: .05rem solid var(--md-typeset-table-color);
65
}

docs/logo.png

57.4 KB
Loading

0 commit comments

Comments
 (0)