mkdocstrings-matlab 1.0.9__py3-none-any.whl → 1.0.11__py3-none-any.whl
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.
- mkdocstrings_handlers/matlab/handler.py +1 -1
- mkdocstrings_handlers/matlab/rendering.py +21 -26
- {mkdocstrings_matlab-1.0.9.dist-info → mkdocstrings_matlab-1.0.11.dist-info}/METADATA +4 -3
- {mkdocstrings_matlab-1.0.9.dist-info → mkdocstrings_matlab-1.0.11.dist-info}/RECORD +6 -6
- {mkdocstrings_matlab-1.0.9.dist-info → mkdocstrings_matlab-1.0.11.dist-info}/WHEEL +0 -0
- {mkdocstrings_matlab-1.0.9.dist-info → mkdocstrings_matlab-1.0.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -37,14 +37,7 @@ from griffe._internal.docstrings.parsers import DocstringStyle, parse
|
|
|
37
37
|
from jinja2 import pass_context
|
|
38
38
|
from markupsafe import Markup
|
|
39
39
|
from maxx.enums import ArgumentKind
|
|
40
|
-
from maxx.objects import
|
|
41
|
-
Alias,
|
|
42
|
-
Class,
|
|
43
|
-
Function,
|
|
44
|
-
Namespace,
|
|
45
|
-
Object,
|
|
46
|
-
Property,
|
|
47
|
-
)
|
|
40
|
+
from maxx.objects import Alias, Class, Folder, Function, Namespace, Object, Property, Script
|
|
48
41
|
from mkdocs_autorefs import AutorefsHookInterface
|
|
49
42
|
from mkdocstrings import get_logger
|
|
50
43
|
|
|
@@ -54,6 +47,8 @@ if TYPE_CHECKING:
|
|
|
54
47
|
from jinja2.runtime import Context
|
|
55
48
|
from mkdocstrings import CollectorItem
|
|
56
49
|
|
|
50
|
+
MEMBERS = Alias | Class | Folder | Function | Namespace | Property | Script
|
|
51
|
+
|
|
57
52
|
_logger = get_logger(__name__)
|
|
58
53
|
|
|
59
54
|
|
|
@@ -158,16 +153,16 @@ def do_format_signature(
|
|
|
158
153
|
|
|
159
154
|
signature = template.render(new_context, function=function, signature=True)
|
|
160
155
|
signature = str(
|
|
161
|
-
env.filters["highlight"](
|
|
156
|
+
env.filters["highlight"]( # type: ignore
|
|
162
157
|
Markup.escape(signature),
|
|
163
|
-
language="matlab",
|
|
164
|
-
inline=False,
|
|
165
|
-
classes=["doc-signature"],
|
|
166
|
-
linenums=False,
|
|
158
|
+
language="matlab", # type: ignore
|
|
159
|
+
inline=False, # type: ignore
|
|
160
|
+
classes=["doc-signature"], # type: ignore
|
|
161
|
+
linenums=False, # type: ignore
|
|
167
162
|
),
|
|
168
163
|
)
|
|
169
164
|
|
|
170
|
-
if stash := env.filters["stash_crossref"].stash:
|
|
165
|
+
if stash := env.filters["stash_crossref"].stash: # ty: ignore[possibly-missing-attribute]
|
|
171
166
|
for key, value in stash.items():
|
|
172
167
|
signature = re.sub(rf"\b{key}\b", value, signature)
|
|
173
168
|
stash.clear()
|
|
@@ -197,7 +192,7 @@ def do_format_arguments(
|
|
|
197
192
|
|
|
198
193
|
html = template.render(context.parent, section=section)
|
|
199
194
|
|
|
200
|
-
if stash := env.filters["stash_crossref"].stash:
|
|
195
|
+
if stash := env.filters["stash_crossref"].stash: # ty: ignore[possibly-missing-attribute]
|
|
201
196
|
for key, value in stash.items():
|
|
202
197
|
html = re.sub(rf"\b{key}\b", value, html)
|
|
203
198
|
stash.clear()
|
|
@@ -249,16 +244,16 @@ def do_format_property(
|
|
|
249
244
|
signature += f" = {value}"
|
|
250
245
|
|
|
251
246
|
signature = str(
|
|
252
|
-
env.filters["highlight"](
|
|
247
|
+
env.filters["highlight"]( # type: ignore
|
|
253
248
|
Markup.escape(signature),
|
|
254
|
-
language="
|
|
255
|
-
inline=False,
|
|
256
|
-
classes=["doc-signature"],
|
|
257
|
-
linenums=False,
|
|
249
|
+
language="matlab", # type: ignore
|
|
250
|
+
inline=False, # type: ignore
|
|
251
|
+
classes=["doc-signature"], # type: ignore
|
|
252
|
+
linenums=False, # type: ignore
|
|
258
253
|
),
|
|
259
254
|
)
|
|
260
255
|
|
|
261
|
-
if stash := env.filters["stash_crossref"].stash:
|
|
256
|
+
if stash := env.filters["stash_crossref"].stash: # ty: ignore[possibly-missing-attribute]
|
|
262
257
|
for key, value in stash.items():
|
|
263
258
|
signature = re.sub(rf"\b{key}\b", value, signature)
|
|
264
259
|
stash.clear()
|
|
@@ -341,7 +336,7 @@ def _parents(obj: Alias) -> set[str]:
|
|
|
341
336
|
return parents
|
|
342
337
|
|
|
343
338
|
|
|
344
|
-
def _remove_cycles(objects: list[
|
|
339
|
+
def _remove_cycles(objects: list[MEMBERS]) -> Iterator[MEMBERS]:
|
|
345
340
|
"""
|
|
346
341
|
Filter objects to remove those that create cycles in the inheritance graph.
|
|
347
342
|
|
|
@@ -361,7 +356,7 @@ def _remove_cycles(objects: list[Object | Alias]) -> Iterator[Object | Alias]:
|
|
|
361
356
|
|
|
362
357
|
|
|
363
358
|
def do_filter_objects(
|
|
364
|
-
objects_dictionary: dict[str,
|
|
359
|
+
objects_dictionary: dict[str, MEMBERS],
|
|
365
360
|
*,
|
|
366
361
|
filters: Sequence[tuple[Pattern, bool]] | None = None,
|
|
367
362
|
members_list: bool | list[str] | None = None,
|
|
@@ -369,7 +364,7 @@ def do_filter_objects(
|
|
|
369
364
|
private_members: bool | list[str] = False,
|
|
370
365
|
hidden_members: bool | list[str] = False,
|
|
371
366
|
keep_no_docstrings: bool = True,
|
|
372
|
-
) -> list[
|
|
367
|
+
) -> list[MEMBERS]:
|
|
373
368
|
"""Filter a dictionary of objects based on their docstrings.
|
|
374
369
|
|
|
375
370
|
Parameters:
|
|
@@ -817,8 +812,8 @@ class AutorefsHook(AutorefsHookInterface):
|
|
|
817
812
|
}.get(self.current_object.kind.value.lower(), "obj")
|
|
818
813
|
origin = self.current_object.path
|
|
819
814
|
try:
|
|
820
|
-
filepath = self.current_object.docstring.parent.filepath
|
|
821
|
-
lineno = self.current_object.docstring.lineno or 0
|
|
815
|
+
filepath = self.current_object.docstring.parent.filepath # ty: ignore[possibly-missing-attribute]
|
|
816
|
+
lineno = self.current_object.docstring.lineno or 0 # ty: ignore[possibly-missing-attribute]
|
|
822
817
|
except AttributeError:
|
|
823
818
|
filepath = self.current_object.filepath
|
|
824
819
|
lineno = 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocstrings-matlab
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: A MATLAB handler for mkdocstrings
|
|
5
5
|
Author-email: Mark Hu <watermarkhu@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -19,10 +19,10 @@ Classifier: Topic :: Software Development
|
|
|
19
19
|
Classifier: Topic :: Software Development :: Documentation
|
|
20
20
|
Classifier: Topic :: Utilities
|
|
21
21
|
Classifier: Typing :: Typed
|
|
22
|
-
Requires-Python: <3.
|
|
22
|
+
Requires-Python: <3.15,>=3.10
|
|
23
23
|
Requires-Dist: charset-normalizer~=3.4
|
|
24
24
|
Requires-Dist: griffe~=1.14.0
|
|
25
|
-
Requires-Dist: maxx~=0.
|
|
25
|
+
Requires-Dist: maxx~=0.5.0
|
|
26
26
|
Requires-Dist: mkdocs-autorefs~=1.4
|
|
27
27
|
Requires-Dist: mkdocstrings~=0.29
|
|
28
28
|
Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
|
|
@@ -39,6 +39,7 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
[](https://github.com/watermarkhu/mkdocstrings-matlab/actions/workflows/qualify.yaml)
|
|
40
40
|
[](https://watermarkhu.nl/mkdocstrings-matlab)
|
|
41
41
|
[](https://pypi.org/project/mkdocstrings-matlab/)
|
|
42
|
+
[](https://codecov.io/github/watermarkhu/mkdocstrings-matlab)
|
|
42
43
|
|
|
43
44
|
The MATLAB handler uses [maxx](https://github.com/watermarkhu/maxx) to collect documentation from MATLAB source code, which in turn uses [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) and its [MATLAB parser](https://github.com/acristoffers/tree-sitter-matlab).
|
|
44
45
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
mkdocstrings_handlers/matlab/__init__.py,sha256=zLE8MANvIbg-pEVFc9bGhhIUvqAjnSANBGqek-dm3LM,1721
|
|
2
2
|
mkdocstrings_handlers/matlab/config.py,sha256=zpnTijfd21NTc_gIHSvzkOheUO4NTeNoaTyD62SIcNg,26755
|
|
3
|
-
mkdocstrings_handlers/matlab/handler.py,sha256=
|
|
3
|
+
mkdocstrings_handlers/matlab/handler.py,sha256=3hYk1Is4WM4NDlWPvZWTLWCfQ3tEjTTjI05A0QZ5M-U,10026
|
|
4
4
|
mkdocstrings_handlers/matlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
mkdocstrings_handlers/matlab/rendering.py,sha256=
|
|
5
|
+
mkdocstrings_handlers/matlab/rendering.py,sha256=72pdSqGlj8uT4rovGCKK4OcTWbnhToS0ZzLiUFcfpw8,26637
|
|
6
6
|
mkdocstrings_handlers/matlab/templates/material/attributes.html.jinja,sha256=3Wv9tRkBASmxW3NGdAw9V8mc7G6hc1pDIKmVQztlFJk,818
|
|
7
7
|
mkdocstrings_handlers/matlab/templates/material/backlinks.html.jinja,sha256=FFrvIa-KH-DhT1cpc9HL0ecShR2gUVGs3VT9c1q88z8,467
|
|
8
8
|
mkdocstrings_handlers/matlab/templates/material/children.html.jinja,sha256=gWV77R1BSkVlbQdY_VB9wrGSBY30bcm23skPTfOW1Fs,7517
|
|
@@ -34,7 +34,7 @@ mkdocstrings_handlers/matlab/templates/material/summary/classes.html.jinja,sha25
|
|
|
34
34
|
mkdocstrings_handlers/matlab/templates/material/summary/functions.html.jinja,sha256=IhcY4O2HeGYjUjNQ9W9aYiNecCjrTzNVQopgRzxHtz8,921
|
|
35
35
|
mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja,sha256=fWuFO5a2P-OEky2wvv95XLtB-9PTkymFC9MIQ5XS6FE,906
|
|
36
36
|
mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja,sha256=lgVn15U3mg72RjmgvZxCqrRsjx2eEyZ0HM0bt1LxWMM,918
|
|
37
|
-
mkdocstrings_matlab-1.0.
|
|
38
|
-
mkdocstrings_matlab-1.0.
|
|
39
|
-
mkdocstrings_matlab-1.0.
|
|
40
|
-
mkdocstrings_matlab-1.0.
|
|
37
|
+
mkdocstrings_matlab-1.0.11.dist-info/METADATA,sha256=LzMhZxk4Kw7AQzjABoqkUp0uXbf7ce49uRM1IvwNd0U,4781
|
|
38
|
+
mkdocstrings_matlab-1.0.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
39
|
+
mkdocstrings_matlab-1.0.11.dist-info/licenses/LICENSE,sha256=TZQpwBuA3KLH56--XDAY2Qwo9gGdxeTITYhMOylmYhg,743
|
|
40
|
+
mkdocstrings_matlab-1.0.11.dist-info/RECORD,,
|
|
File without changes
|
{mkdocstrings_matlab-1.0.9.dist-info → mkdocstrings_matlab-1.0.11.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|