mkdocstrings-python 1.8.0__tar.gz → 1.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/PKG-INFO +8 -20
  2. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/README.md +5 -17
  3. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/pyproject.toml +3 -54
  4. mkdocstrings_python-1.9.1/src/mkdocstrings_handlers/python/__init__.py +5 -0
  5. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/handler.py +14 -2
  6. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/rendering.py +9 -0
  7. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html +3 -3
  8. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html +3 -3
  9. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html +3 -3
  10. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html +3 -3
  11. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html +3 -3
  12. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html +3 -3
  13. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html +3 -3
  14. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html +3 -3
  15. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html +3 -3
  16. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html +3 -3
  17. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html +3 -3
  18. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/labels.html +1 -1
  19. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/style.css +6 -1
  20. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/tests/conftest.py +3 -3
  21. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/tests/test_themes.py +6 -7
  22. mkdocstrings_python-1.8.0/src/mkdocstrings_handlers/python/__init__.py +0 -9
  23. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/LICENSE +0 -0
  24. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/debug.py +0 -0
  25. {mkdocstrings_python-1.8.0/src/mkdocstrings_handlers → mkdocstrings_python-1.9.1/src/mkdocstrings_handlers/python}/py.typed +0 -0
  26. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html +0 -0
  27. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/children.html +0 -0
  28. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/class.html +0 -0
  29. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html +0 -0
  30. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html +0 -0
  31. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html +0 -0
  32. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/expression.html +0 -0
  33. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/function.html +0 -0
  34. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html +0 -0
  35. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html +0 -0
  36. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html +0 -0
  37. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/module.html +0 -0
  38. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/signature.html +0 -0
  39. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html +0 -0
  40. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html +0 -0
  41. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html +0 -0
  42. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html +0 -0
  43. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/_base/summary.html +0 -0
  44. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/attribute.html +0 -0
  45. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/children.html +0 -0
  46. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/class.html +0 -0
  47. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/admonition.html +0 -0
  48. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/attributes.html +0 -0
  49. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/classes.html +0 -0
  50. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/examples.html +0 -0
  51. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/functions.html +0 -0
  52. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/modules.html +0 -0
  53. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/other_parameters.html +0 -0
  54. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/parameters.html +0 -0
  55. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/raises.html +0 -0
  56. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/receives.html +0 -0
  57. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/returns.html +0 -0
  58. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/warns.html +0 -0
  59. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring/yields.html +0 -0
  60. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/docstring.html +0 -0
  61. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/expression.html +0 -0
  62. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/function.html +0 -0
  63. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/labels.html +0 -0
  64. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/language.html +0 -0
  65. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/languages/en.html +0 -0
  66. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/languages/ja.html +0 -0
  67. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/languages/zh.html +0 -0
  68. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/module.html +0 -0
  69. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/signature.html +0 -0
  70. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/summary/attributes.html +0 -0
  71. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/summary/classes.html +0 -0
  72. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/summary/functions.html +0 -0
  73. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/summary/modules.html +0 -0
  74. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/material/summary.html +0 -0
  75. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/attributes.html +0 -0
  76. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/other_parameters.html +0 -0
  77. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/parameters.html +0 -0
  78. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/raises.html +0 -0
  79. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/receives.html +0 -0
  80. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html +0 -0
  81. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/warns.html +0 -0
  82. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/yields.html +0 -0
  83. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/language.html +0 -0
  84. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/languages/en.html +0 -0
  85. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/languages/ja.html +0 -0
  86. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/languages/zh.html +0 -0
  87. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/src/mkdocstrings_handlers/python/templates/readthedocs/style.css +0 -0
  88. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/tests/__init__.py +0 -0
  89. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/tests/test_handler.py +0 -0
  90. {mkdocstrings_python-1.8.0 → mkdocstrings_python-1.9.1}/tests/test_rendering.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocstrings-python
3
- Version: 1.8.0
3
+ Version: 1.9.1
4
4
  Summary: A Python handler for mkdocstrings.
5
- Author-Email: Timothée Mazzucotelli <pawamoy@pm.me>
5
+ Author-Email: Timothée Mazzucotelli <dev@pawamoy.fr>
6
6
  License: ISC
7
7
  Classifier: Development Status :: 4 - Beta
8
8
  Classifier: Intended Audience :: Developers
@@ -16,7 +16,6 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Topic :: Documentation
18
18
  Classifier: Topic :: Software Development
19
- Classifier: Topic :: Software Development :: Documentation
20
19
  Classifier: Topic :: Utilities
21
20
  Classifier: Typing :: Typed
22
21
  Project-URL: Homepage, https://mkdocstrings.github.io/python
@@ -28,6 +27,7 @@ Project-URL: Discussions, https://github.com/mkdocstrings/python/discussions
28
27
  Project-URL: Gitter, https://gitter.im/mkdocstrings/python
29
28
  Project-URL: Funding, https://github.com/sponsors/pawamoy
30
29
  Requires-Python: >=3.8
30
+ Requires-Dist: markdown<3.6,>=3.3
31
31
  Requires-Dist: mkdocstrings>=0.20
32
32
  Requires-Dist: griffe>=0.37
33
33
  Description-Content-Type: text/markdown
@@ -36,23 +36,11 @@ Description-Content-Type: text/markdown
36
36
 
37
37
  <p align="center">A Python handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
38
38
 
39
- <p align="center">
40
- <a href="https://github.com/mkdocstrings/python/actions?query=workflow%3Aci">
41
- <img alt="ci" src="https://github.com/mkdocstrings/python/workflows/ci/badge.svg" />
42
- </a>
43
- <a href="https://mkdocstrings.github.io/python/">
44
- <img alt="documentation" src="https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat" />
45
- </a>
46
- <a href="https://pypi.org/project/mkdocstrings-python/">
47
- <img alt="pypi version" src="https://img.shields.io/pypi/v/mkdocstrings-python.svg" />
48
- </a>
49
- <a href="https://gitpod.io/#https://github.com/mkdocstrings/python">
50
- <img alt="gitpod" src="https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat" />
51
- </a>
52
- <a href="https://app.gitter.im/#/room/#mkdocstrings_python:gitter.im">
53
- <img alt="gitter" src="https://badges.gitter.im/join%20chat.svg" />
54
- </a>
55
- </p>
39
+ [![ci](https://github.com/mkdocstrings/python/workflows/ci/badge.svg)](https://github.com/mkdocstrings/python/actions?query=workflow%3Aci)
40
+ [![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/python/)
41
+ [![pypi version](https://img.shields.io/pypi/v/mkdocstrings-python.svg)](https://pypi.org/project/mkdocstrings-python/)
42
+ [![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/python)
43
+ [![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#python:gitter.im)
56
44
 
57
45
  ---
58
46
 
@@ -2,23 +2,11 @@
2
2
 
3
3
  <p align="center">A Python handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
4
4
 
5
- <p align="center">
6
- <a href="https://github.com/mkdocstrings/python/actions?query=workflow%3Aci">
7
- <img alt="ci" src="https://github.com/mkdocstrings/python/workflows/ci/badge.svg" />
8
- </a>
9
- <a href="https://mkdocstrings.github.io/python/">
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/">
13
- <img alt="pypi version" src="https://img.shields.io/pypi/v/mkdocstrings-python.svg" />
14
- </a>
15
- <a href="https://gitpod.io/#https://github.com/mkdocstrings/python">
16
- <img alt="gitpod" src="https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat" />
17
- </a>
18
- <a href="https://app.gitter.im/#/room/#mkdocstrings_python:gitter.im">
19
- <img alt="gitter" src="https://badges.gitter.im/join%20chat.svg" />
20
- </a>
21
- </p>
5
+ [![ci](https://github.com/mkdocstrings/python/workflows/ci/badge.svg)](https://github.com/mkdocstrings/python/actions?query=workflow%3Aci)
6
+ [![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/python/)
7
+ [![pypi version](https://img.shields.io/pypi/v/mkdocstrings-python.svg)](https://pypi.org/project/mkdocstrings-python/)
8
+ [![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/python)
9
+ [![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#python:gitter.im)
22
10
 
23
11
  ---
24
12
 
@@ -8,7 +8,7 @@ build-backend = "pdm.backend"
8
8
  name = "mkdocstrings-python"
9
9
  description = "A Python handler for mkdocstrings."
10
10
  authors = [
11
- { name = "Timothée Mazzucotelli", email = "pawamoy@pm.me" },
11
+ { name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr" },
12
12
  ]
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.8"
@@ -27,15 +27,15 @@ classifiers = [
27
27
  "Programming Language :: Python :: 3.12",
28
28
  "Topic :: Documentation",
29
29
  "Topic :: Software Development",
30
- "Topic :: Software Development :: Documentation",
31
30
  "Topic :: Utilities",
32
31
  "Typing :: Typed",
33
32
  ]
34
33
  dependencies = [
34
+ "markdown>=3.3,<3.6",
35
35
  "mkdocstrings>=0.20",
36
36
  "griffe>=0.37",
37
37
  ]
38
- version = "1.8.0"
38
+ version = "1.9.1"
39
39
 
40
40
  [project.license]
41
41
  text = "ISC"
@@ -50,11 +50,6 @@ Discussions = "https://github.com/mkdocstrings/python/discussions"
50
50
  Gitter = "https://gitter.im/mkdocstrings/python"
51
51
  Funding = "https://github.com/sponsors/pawamoy"
52
52
 
53
- [tool.pdm]
54
- plugins = [
55
- "pdm-multirun",
56
- ]
57
-
58
53
  [tool.pdm.version]
59
54
  source = "scm"
60
55
 
@@ -64,49 +59,3 @@ includes = [
64
59
  "src/mkdocstrings_handlers",
65
60
  ]
66
61
  editable-backend = "editables"
67
-
68
- [tool.pdm.dev-dependencies]
69
- duty = [
70
- "duty>=0.10",
71
- ]
72
- ci-quality = [
73
- "mkdocstrings-python[duty,docs,quality,typing,security]",
74
- ]
75
- ci-tests = [
76
- "mkdocstrings-python[duty,docs,tests]",
77
- ]
78
- docs = [
79
- "black>=23.9",
80
- "markdown-callouts>=0.3",
81
- "markdown-exec>=1.7",
82
- "mkdocs>=1.5",
83
- "mkdocs-coverage>=1.0",
84
- "mkdocs-gen-files>=0.5",
85
- "mkdocs-git-committers-plugin-2>=1.2",
86
- "mkdocs-literate-nav>=0.6",
87
- "mkdocs-material>=9.4",
88
- "mkdocs-minify-plugin>=0.7",
89
- "tomli>=2.0; python_version < '3.11'",
90
- ]
91
- maintain = [
92
- "black>=23.9",
93
- "blacken-docs>=1.16",
94
- "git-changelog>=2.3",
95
- ]
96
- quality = [
97
- "ruff>=0.0",
98
- ]
99
- tests = [
100
- "pytest>=7.4",
101
- "pytest-cov>=4.1",
102
- "pytest-randomly>=3.15",
103
- "pytest-xdist>=3.3",
104
- ]
105
- typing = [
106
- "mypy>=1.5",
107
- "types-markdown>=3.5",
108
- "types-pyyaml>=6.0",
109
- ]
110
- security = [
111
- "safety>=2.3",
112
- ]
@@ -0,0 +1,5 @@
1
+ """Python handler for mkdocstrings."""
2
+
3
+ from mkdocstrings_handlers.python.handler import get_handler
4
+
5
+ __all__ = ["get_handler"]
@@ -61,6 +61,7 @@ class PythonHandler(BaseHandler):
61
61
  fallback_config: ClassVar[dict] = {"fallback": True}
62
62
  """The configuration used to collect item during autorefs fallback."""
63
63
  default_config: ClassVar[dict] = {
64
+ "find_stubs_package": False,
64
65
  "docstring_style": "google",
65
66
  "docstring_options": {},
66
67
  "show_symbol_type_heading": False,
@@ -105,11 +106,13 @@ class PythonHandler(BaseHandler):
105
106
  "preload_modules": None,
106
107
  "allow_inspection": True,
107
108
  "summary": False,
109
+ "show_labels": True,
108
110
  "unwrap_annotated": False,
109
111
  }
110
112
  """Default handler configuration.
111
113
 
112
114
  Attributes: General options:
115
+ find_stubs_package (bool): Whether to load stubs package (package-stubs) when extracting docstrings. Default `False`.
113
116
  allow_inspection (bool): Whether to allow inspecting modules when visiting them is not possible. Default: `True`.
114
117
  show_bases (bool): Show the base classes of a class. Default: `True`.
115
118
  show_source (bool): Show the source code of this object. Default: `True`.
@@ -152,6 +155,7 @@ class PythonHandler(BaseHandler):
152
155
  group_by_category (bool): Group the object's children by categories: attributes, classes, functions, and modules. Default: `True`.
153
156
  show_submodules (bool): When rendering a module, show its submodules recursively. Default: `False`.
154
157
  summary (bool | dict[str, bool]): Whether to render summaries of modules, classes, functions (methods) and attributes.
158
+ show_labels (bool): Whether to show labels of the members. Default: `True`.
155
159
 
156
160
  Attributes: Docstrings options:
157
161
  docstring_style (str): The docstring style to use: `google`, `numpy`, `sphinx`, or `None`. Default: `"google"`.
@@ -279,8 +283,16 @@ class PythonHandler(BaseHandler):
279
283
  try:
280
284
  for pre_loaded_module in final_config.get("preload_modules") or []:
281
285
  if pre_loaded_module not in self._modules_collection:
282
- loader.load(pre_loaded_module)
283
- loader.load(module_name)
286
+ loader.load(
287
+ pre_loaded_module,
288
+ try_relative_path=False,
289
+ find_stubs_package=final_config["find_stubs_package"],
290
+ )
291
+ loader.load(
292
+ module_name,
293
+ try_relative_path=False,
294
+ find_stubs_package=final_config["find_stubs_package"],
295
+ )
284
296
  except ImportError as error:
285
297
  raise CollectionError(str(error)) from error
286
298
  unresolved, iterations = loader.resolve_aliases(
@@ -166,6 +166,15 @@ def do_format_signature(
166
166
  ),
167
167
  )
168
168
 
169
+ # Since we highlight the signature without `def`,
170
+ # Pygments sees it as a function call and not a function definition.
171
+ # The result is that the function name is not parsed as such,
172
+ # but instead as a regular name: `n` CSS class instead of `nf`.
173
+ # To fix it, we replace the first occurrence of an `n` CSS class
174
+ # with an `nf` one, unless we found `nf` already.
175
+ if signature.find('class="nf"') == -1:
176
+ signature = signature.replace('class="n"', 'class="nf"', 1)
177
+
169
178
  if stash:
170
179
  for key, value in stash.items():
171
180
  signature = re.sub(rf"\b{key}\b", value, signature)
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -35,7 +35,7 @@
35
35
  </table>
36
36
  {% endblock table_style %}
37
37
  {% elif config.docstring_section_style == "list" %}
38
- {% block list_style %}
38
+ {% block list_style scoped %}
39
39
  <p>{{ section.title or lang.t("Attributes:") }}</p>
40
40
  <ul>
41
41
  {% for attribute in section.value %}
@@ -55,7 +55,7 @@
55
55
  </ul>
56
56
  {% endblock list_style %}
57
57
  {% elif config.docstring_section_style == "spacy" %}
58
- {% block spacy_style %}
58
+ {% block spacy_style scoped %}
59
59
  <table>
60
60
  <thead>
61
61
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Classes:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -27,7 +27,7 @@
27
27
  </table>
28
28
  {% endblock table_style %}
29
29
  {% elif config.docstring_section_style == "list" %}
30
- {% block list_style %}
30
+ {% block list_style scoped %}
31
31
  <p>{{ section.title or lang.t("Classes:") }}</p>
32
32
  <ul>
33
33
  {% for class in section.value %}
@@ -42,7 +42,7 @@
42
42
  </ul>
43
43
  {% endblock list_style %}
44
44
  {% elif config.docstring_section_style == "spacy" %}
45
- {% block spacy_style %}
45
+ {% block spacy_style scoped %}
46
46
  <table>
47
47
  <thead>
48
48
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -29,7 +29,7 @@
29
29
  </table>
30
30
  {% endblock table_style %}
31
31
  {% elif config.docstring_section_style == "list" %}
32
- {% block list_style %}
32
+ {% block list_style scoped %}
33
33
  <p>{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</p>
34
34
  <ul>
35
35
  {% for function in section.value %}
@@ -46,7 +46,7 @@
46
46
  </ul>
47
47
  {% endblock list_style %}
48
48
  {% elif config.docstring_section_style == "spacy" %}
49
- {% block spacy_style %}
49
+ {% block spacy_style scoped %}
50
50
  <table>
51
51
  <thead>
52
52
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Modules:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -27,7 +27,7 @@
27
27
  </table>
28
28
  {% endblock table_style %}
29
29
  {% elif config.docstring_section_style == "list" %}
30
- {% block list_style %}
30
+ {% block list_style scoped %}
31
31
  <p>{{ section.title or lang.t("Modules:") }}</p>
32
32
  <ul>
33
33
  {% for module in section.value %}
@@ -42,7 +42,7 @@
42
42
  </ul>
43
43
  {% endblock list_style %}
44
44
  {% elif config.docstring_section_style == "spacy" %}
45
- {% block spacy_style %}
45
+ {% block spacy_style scoped %}
46
46
  <table>
47
47
  <thead>
48
48
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Other Parameters:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -35,7 +35,7 @@
35
35
  </table>
36
36
  {% endblock table_style %}
37
37
  {% elif config.docstring_section_style == "list" %}
38
- {% block list_style %}
38
+ {% block list_style scoped %}
39
39
  <p>{{ section.title or lang.t("Other Parameters:") }}</p>
40
40
  <ul>
41
41
  {% for parameter in section.value %}
@@ -55,7 +55,7 @@
55
55
  </ul>
56
56
  {% endblock list_style %}
57
57
  {% elif config.docstring_section_style == "spacy" %}
58
- {% block spacy_style %}
58
+ {% block spacy_style scoped %}
59
59
  <table>
60
60
  <thead>
61
61
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -45,7 +45,7 @@
45
45
  </table>
46
46
  {% endblock table_style %}
47
47
  {% elif config.docstring_section_style == "list" %}
48
- {% block list_style %}
48
+ {% block list_style scoped %}
49
49
  <p>{{ section.title or lang.t("Parameters:") }}</p>
50
50
  <ul>
51
51
  {% for parameter in section.value %}
@@ -70,7 +70,7 @@
70
70
  </ul>
71
71
  {% endblock list_style %}
72
72
  {% elif config.docstring_section_style == "spacy" %}
73
- {% block spacy_style %}
73
+ {% block spacy_style scoped %}
74
74
  <table>
75
75
  <thead>
76
76
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Raises:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -33,7 +33,7 @@
33
33
  </table>
34
34
  {% endblock table_style %}
35
35
  {% elif config.docstring_section_style == "list" %}
36
- {% block list_style %}
36
+ {% block list_style scoped %}
37
37
  <p>{{ lang.t(section.title) or lang.t("Raises:") }}</p>
38
38
  <ul>
39
39
  {% for raises in section.value %}
@@ -52,7 +52,7 @@
52
52
  </ul>
53
53
  {% endblock list_style %}
54
54
  {% elif config.docstring_section_style == "spacy" %}
55
- {% block spacy_style %}
55
+ {% block spacy_style scoped %}
56
56
  <table>
57
57
  <thead>
58
58
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  {% set name_column = section.value|selectattr("name")|any %}
8
8
  <p><strong>{{ section.title or lang.t("Receives:") }}</strong></p>
9
9
  <table>
@@ -36,7 +36,7 @@
36
36
  </table>
37
37
  {% endblock table_style %}
38
38
  {% elif config.docstring_section_style == "list" %}
39
- {% block list_style %}
39
+ {% block list_style scoped %}
40
40
  <p>{{ section.title or lang.t("Receives:") }}</p>
41
41
  <ul>
42
42
  {% for receives in section.value %}
@@ -58,7 +58,7 @@
58
58
  </ul>
59
59
  {% endblock list_style %}
60
60
  {% elif config.docstring_section_style == "spacy" %}
61
- {% block spacy_style %}
61
+ {% block spacy_style scoped %}
62
62
  <table>
63
63
  <thead>
64
64
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  {% set name_column = section.value|selectattr("name")|any %}
8
8
  <p><strong>{{ section.title or lang.t("Returns:") }}</strong></p>
9
9
  <table>
@@ -36,7 +36,7 @@
36
36
  </table>
37
37
  {% endblock table_style %}
38
38
  {% elif config.docstring_section_style == "list" %}
39
- {% block list_style %}
39
+ {% block list_style scoped %}
40
40
  <p>{{ section.title or lang.t("Returns:") }}</p>
41
41
  <ul>
42
42
  {% for returns in section.value %}
@@ -58,7 +58,7 @@
58
58
  </ul>
59
59
  {% endblock list_style %}
60
60
  {% elif config.docstring_section_style == "spacy" %}
61
- {% block spacy_style %}
61
+ {% block spacy_style scoped %}
62
62
  <table>
63
63
  <thead>
64
64
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  <p><strong>{{ section.title or lang.t("Warns:") }}</strong></p>
8
8
  <table>
9
9
  <thead>
@@ -33,7 +33,7 @@
33
33
  </table>
34
34
  {% endblock table_style %}
35
35
  {% elif config.docstring_section_style == "list" %}
36
- {% block list_style %}
36
+ {% block list_style scoped %}
37
37
  <p>{{ section.title or lang.t("Warns:") }}</p>
38
38
  <ul>
39
39
  {% for warns in section.value %}
@@ -52,7 +52,7 @@
52
52
  </ul>
53
53
  {% endblock list_style %}
54
54
  {% elif config.docstring_section_style == "spacy" %}
55
- {% block spacy_style %}
55
+ {% block spacy_style scoped %}
56
56
  <table>
57
57
  <thead>
58
58
  <tr>
@@ -3,7 +3,7 @@
3
3
  {% import "language.html" as lang with context %}
4
4
 
5
5
  {% if config.docstring_section_style == "table" %}
6
- {% block table_style %}
6
+ {% block table_style scoped %}
7
7
  {% set name_column = section.value|selectattr("name")|any %}
8
8
  <p><strong>{{ section.title or lang.t("Yields:") }}</strong></p>
9
9
  <table>
@@ -36,7 +36,7 @@
36
36
  </table>
37
37
  {% endblock table_style %}
38
38
  {% elif config.docstring_section_style == "list" %}
39
- {% block list_style %}
39
+ {% block list_style scoped %}
40
40
  <p>{{ section.title or lang.t("Yields:") }}</p>
41
41
  <ul>
42
42
  {% for yields in section.value %}
@@ -58,7 +58,7 @@
58
58
  </ul>
59
59
  {% endblock list_style %}
60
60
  {% elif config.docstring_section_style == "spacy" %}
61
- {% block spacy_style %}
61
+ {% block spacy_style scoped %}
62
62
  <table>
63
63
  <thead>
64
64
  <tr>
@@ -1,4 +1,4 @@
1
- {% if labels %}
1
+ {% if config.show_labels and labels %}
2
2
  {{ log.debug("Rendering labels") }}
3
3
  <span class="doc doc-labels">
4
4
  {% for label in labels|sort %}
@@ -105,4 +105,9 @@ code.doc-symbol-module {
105
105
 
106
106
  code.doc-symbol-module::after {
107
107
  content: "mod";
108
- }
108
+ }
109
+
110
+ .doc-signature .autorefs {
111
+ color: inherit;
112
+ border-bottom: 1px dotted currentcolor;
113
+ }
@@ -60,7 +60,7 @@ def fixture_plugin(mkdocs_conf: config.Config) -> MkdocstringsPlugin:
60
60
  """Return a plugin instance.
61
61
 
62
62
  Parameters:
63
- mkdocs_conf: Pytest fixture: [tests.conftest.fixture_mkdocs_conf][].
63
+ mkdocs_conf: Pytest fixture (see conftest.py).
64
64
 
65
65
  Returns:
66
66
  mkdocstrings plugin instance.
@@ -73,7 +73,7 @@ def fixture_ext_markdown(mkdocs_conf: config.Config) -> Markdown:
73
73
  """Return a Markdown instance with MkdocstringsExtension.
74
74
 
75
75
  Parameters:
76
- mkdocs_conf: Pytest fixture: [tests.conftest.fixture_mkdocs_conf][].
76
+ mkdocs_conf: Pytest fixture (see conftest.py).
77
77
 
78
78
  Returns:
79
79
  A Markdown instance.
@@ -86,7 +86,7 @@ def fixture_handler(plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> Pytho
86
86
  """Return a handler instance.
87
87
 
88
88
  Parameters:
89
- plugin: Pytest fixture: [tests.conftest.fixture_plugin][].
89
+ plugin: Pytest fixture (see conftest.py).
90
90
 
91
91
  Returns:
92
92
  A handler instance.
@@ -2,7 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import sys
6
5
  from typing import TYPE_CHECKING
7
6
 
8
7
  import pytest
@@ -22,7 +21,7 @@ if TYPE_CHECKING:
22
21
  indirect=["plugin"],
23
22
  )
24
23
  @pytest.mark.parametrize(
25
- "module",
24
+ "identifier",
26
25
  [
27
26
  "mkdocstrings.extension",
28
27
  "mkdocstrings.inventory",
@@ -33,15 +32,15 @@ if TYPE_CHECKING:
33
32
  "mkdocstrings_handlers.python",
34
33
  ],
35
34
  )
36
- @pytest.mark.skipif(sys.version_info < (3, 7), reason="material is not installed on Python 3.6")
37
- def test_render_themes_templates_python(module: str, plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> None:
35
+ def test_render_themes_templates_python(identifier: str, plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> None:
38
36
  """Test rendering of a given theme's templates.
39
37
 
40
38
  Parameters:
41
- module: Parametrized argument.
42
- plugin: Pytest fixture: [tests.conftest.fixture_plugin][].
39
+ identifier: Parametrized identifier.
40
+ plugin: Pytest fixture (see conftest.py).
41
+ ext_markdown: Pytest fixture (see conftest.py).
43
42
  """
44
43
  handler = plugin.handlers.get_handler("python")
45
44
  handler._update_env(ext_markdown, plugin.handlers._config)
46
- data = handler.collect(module, {})
45
+ data = handler.collect(identifier, {})
47
46
  handler.render(data, {})
@@ -1,9 +0,0 @@
1
- """This package implements a handler for the Python language."""
2
-
3
- from mkdocstrings_handlers.python.handler import get_handler
4
-
5
- __all__ = ["get_handler"]
6
-
7
- # TODO: CSS classes everywhere in templates
8
- # TODO: name normalization (filenames, Jinja2 variables, HTML tags, CSS classes)
9
- # TODO: Jinja2 blocks everywhere in templates