mkdocstrings-matlab 0.5.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- mkdocstrings_handlers/matlab/__init__.py +2 -1
- mkdocstrings_handlers/matlab/collect.py +3 -1
- mkdocstrings_handlers/matlab/handler.py +7 -0
- mkdocstrings_handlers/matlab/models.py +2 -0
- mkdocstrings_handlers/matlab/treesitter.py +2 -1
- {mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/METADATA +10 -4
- mkdocstrings_matlab-0.6.0.dist-info/RECORD +15 -0
- mkdocstrings_matlab-0.5.0.dist-info/RECORD +0 -15
- {mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/WHEEL +0 -0
- {mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/entry_points.txt +0 -0
- {mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +1,11 @@
|
|
1
1
|
"""MATLAB handler for mkdocstrings."""
|
2
2
|
|
3
3
|
from mkdocstrings_handlers.matlab.handler import get_handler
|
4
|
+
from mkdocstrings_handlers.matlab import collect, handler, models, treesitter
|
4
5
|
from _griffe.enumerations import DocstringSectionKind
|
5
6
|
from _griffe.docstrings import numpy, google
|
6
7
|
|
7
|
-
__all__ = ["get_handler"]
|
8
|
+
__all__ = ["get_handler", "collect", "handler", "models", "treesitter"]
|
8
9
|
|
9
10
|
|
10
11
|
# Add custom sections to the numpy and google docstring parsers
|
@@ -1,3 +1,5 @@
|
|
1
|
+
"""Functions and classes for collecting MATLAB objects from paths."""
|
2
|
+
|
1
3
|
from collections import defaultdict, deque
|
2
4
|
from copy import copy, deepcopy
|
3
5
|
from pathlib import Path
|
@@ -236,7 +238,7 @@ class PathCollection(ModulesCollection):
|
|
236
238
|
case DocstringSectionKind.parameters:
|
237
239
|
section.title = "Input arguments:"
|
238
240
|
case DocstringSectionKind.returns:
|
239
|
-
section.title= "Output arguments:"
|
241
|
+
section.title = "Output arguments:"
|
240
242
|
case DocstringSectionKind.other_parameters:
|
241
243
|
section.title = "Name-Value Arguments:"
|
242
244
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
"""The mkdocstrings handler for processing MATLAB code documentation."""
|
2
|
+
|
1
3
|
from pathlib import Path
|
2
4
|
from collections import ChainMap
|
3
5
|
from markdown import Markdown
|
@@ -51,6 +53,7 @@ class MatlabHandler(BaseHandler):
|
|
51
53
|
"members_order": rendering.Order.alphabetical.value,
|
52
54
|
"filters": ["!^delete$|^disp$"],
|
53
55
|
"group_by_category": True,
|
56
|
+
"show_subnamespaces": False,
|
54
57
|
"summary": False,
|
55
58
|
"show_labels": True,
|
56
59
|
# Docstring options
|
@@ -118,6 +121,7 @@ class MatlabHandler(BaseHandler):
|
|
118
121
|
The `members` option takes precedence over `filters` (filters will still be applied recursively
|
119
122
|
to lower members in the hierarchy). Default: `["!^delete$|^disp$"]`.
|
120
123
|
group_by_category (bool): Group the object's children by categories: properties, classes, functions, and namespaces. Default: `True`.
|
124
|
+
show_subnamespaces (bool): When rendering a namespace, show its subnamespaces recursively. Default: `False`.
|
121
125
|
summary (bool | dict[str, bool]): Whether to render summaries of namespaces, classes, functions (methods) and properties. Default: `False`.
|
122
126
|
show_labels (bool): Whether to show labels of the members. Default: `True`.
|
123
127
|
|
@@ -249,6 +253,9 @@ class MatlabHandler(BaseHandler):
|
|
249
253
|
}
|
250
254
|
|
251
255
|
# Map docstring options
|
256
|
+
final_config["show_submodules"] = config.get(
|
257
|
+
"show_subnamespaces", False
|
258
|
+
)
|
252
259
|
final_config["show_docstring_attributes"] = config.get(
|
253
260
|
"show_docstring_properties", True
|
254
261
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mkdocstrings-matlab
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0
|
4
4
|
Summary: A MATLAB handler for mkdocstrings
|
5
5
|
Author-email: Mark Hu <watermarkhu@gmail.com>
|
6
6
|
License: ISC
|
@@ -28,6 +28,8 @@ Requires-Dist: tree-sitter-matlab>=1.0.2
|
|
28
28
|
Requires-Dist: tree-sitter>=0.23.2
|
29
29
|
Description-Content-Type: text/markdown
|
30
30
|
|
31
|
+
<!-- --8<-- [start:header] -->
|
32
|
+
|
31
33
|
<h1 align="center">mkdocstrings-matlab</h1>
|
32
34
|
|
33
35
|
<p align="center">A MATLAB handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
|
@@ -40,7 +42,6 @@ Description-Content-Type: text/markdown
|
|
40
42
|
|
41
43
|
The MATLAB handler uses [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) and its [MATLAB parser](https://github.com/acristoffers/tree-sitter-matlab) to collect documentation from MATLAB source code. Via the python bindings the Abstract Syntax Tree (AST) of the source code is traversed to extract useful information. The imported objected are imported as custom [Griffe](https://mkdocstrings.github.io/griffe/) objects and mocked for the [python handler](https://mkdocstrings.github.io/python/).
|
42
44
|
|
43
|
-
## Installation
|
44
45
|
|
45
46
|
You can install this handler by specifying it as a dependency:
|
46
47
|
|
@@ -53,6 +54,9 @@ dependencies = [
|
|
53
54
|
]
|
54
55
|
```
|
55
56
|
|
57
|
+
<!-- --8<-- [end:header] -->
|
58
|
+
<!-- --8<-- [start:footer] -->
|
59
|
+
|
56
60
|
## Features
|
57
61
|
|
58
62
|
- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
|
@@ -63,7 +67,7 @@ dependencies = [
|
|
63
67
|
It is even able to automatically add cross-references o other objects from your API.
|
64
68
|
|
65
69
|
- **Recursive documentation of MATLAB [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html):**
|
66
|
-
just add `+` to the identifer, and you get the full namespace docs. You don't need to inject documentation for each class, function, and script.
|
70
|
+
just add `+` to the identifer, and you get the full namespace docs. You don't need to inject documentation for each class, function, and script. Additionaly, the parent namespace documentation will be either extracted from the `Contents.m` or the `readme.md` file at the root of the namespace.
|
67
71
|
|
68
72
|
- **Support for documented properties:** properties definitions followed by a docstring will be recognized in classes.
|
69
73
|
|
@@ -79,4 +83,6 @@ dependencies = [
|
|
79
83
|
you can reference other objects within your docstrings, with the classic Markdown syntax:
|
80
84
|
`[this object][namespace.subnamespace.object]` or directly with `[namespace.subnamespace.object][]`
|
81
85
|
|
82
|
-
- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
|
86
|
+
- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
|
87
|
+
|
88
|
+
<!-- --8<-- [end:footer] -->
|
@@ -0,0 +1,15 @@
|
|
1
|
+
mkdocs_material_matlab/__init__.py,sha256=9pmrwWbkIyr0T7qvADbsz3OR5bB3rWb231e6JSnwA7o,106
|
2
|
+
mkdocs_material_matlab/mkdocs_material_matlab.py,sha256=s7vI1lv6hD8s7kDHWBfYKgN6EcldyUstGYJ45sA-VWY,850
|
3
|
+
mkdocs_material_matlab/css/style.css,sha256=iVTPIKljgvK899jEQylD7yu9yjKfrVE_4GLaITjhk4g,132
|
4
|
+
mkdocstrings_handlers/matlab/__init__.py,sha256=w5R9cGtqeJF0GUP_Jc_ad8FnS4FpbutnmHvzVRlohPM,1124
|
5
|
+
mkdocstrings_handlers/matlab/collect.py,sha256=i9OudR4oJX-ELPL4GVv_AJSA5N6iZk-zTSY58dfWGNw,27512
|
6
|
+
mkdocstrings_handlers/matlab/enums.py,sha256=lr3wLlhPxyBym3O7Rt0cLUZYqPCz6wQ2PYBibLKLTek,982
|
7
|
+
mkdocstrings_handlers/matlab/handler.py,sha256=koMpRSftxQbI8R2l0fGfBOe36yUkne6lATwDauBa5w0,18676
|
8
|
+
mkdocstrings_handlers/matlab/models.py,sha256=7WWZ-nLaL0dWF-vOYWP-O3kNEGKtMfa5DK_J23mkhhU,18174
|
9
|
+
mkdocstrings_handlers/matlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
mkdocstrings_handlers/matlab/treesitter.py,sha256=FkWGuH7EmE_aO2qub5-_NnOVacYeXW353SkB7cNMlRo,21820
|
11
|
+
mkdocstrings_matlab-0.6.0.dist-info/METADATA,sha256=3Q5DCapIgie22A0okETTVhAkZKtde7wJ_G5W4SgRkJM,4779
|
12
|
+
mkdocstrings_matlab-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
+
mkdocstrings_matlab-0.6.0.dist-info/entry_points.txt,sha256=qUZFuB2TKh7KPlg4dR2npfbNgNExw6O6j1vF276PtPw,92
|
14
|
+
mkdocstrings_matlab-0.6.0.dist-info/licenses/LICENSE,sha256=TZQpwBuA3KLH56--XDAY2Qwo9gGdxeTITYhMOylmYhg,743
|
15
|
+
mkdocstrings_matlab-0.6.0.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
mkdocs_material_matlab/__init__.py,sha256=9pmrwWbkIyr0T7qvADbsz3OR5bB3rWb231e6JSnwA7o,106
|
2
|
-
mkdocs_material_matlab/mkdocs_material_matlab.py,sha256=s7vI1lv6hD8s7kDHWBfYKgN6EcldyUstGYJ45sA-VWY,850
|
3
|
-
mkdocs_material_matlab/css/style.css,sha256=iVTPIKljgvK899jEQylD7yu9yjKfrVE_4GLaITjhk4g,132
|
4
|
-
mkdocstrings_handlers/matlab/__init__.py,sha256=7UCCosKn8S38xgJQQy9_1P2oMyPVsTeDkcLPVIoDneU,1000
|
5
|
-
mkdocstrings_handlers/matlab/collect.py,sha256=JAcYih8LMU9jDgxuyqR86p6zdp5qYJNxVnE3x9c529U,27440
|
6
|
-
mkdocstrings_handlers/matlab/enums.py,sha256=lr3wLlhPxyBym3O7Rt0cLUZYqPCz6wQ2PYBibLKLTek,982
|
7
|
-
mkdocstrings_handlers/matlab/handler.py,sha256=k7TEv2lj8wzD9kSaN78yTBAvl6Y8ZqZiyKSzoCc2uEs,18344
|
8
|
-
mkdocstrings_handlers/matlab/models.py,sha256=YmPE9NKsPJ4GBp6es--0yH6uH8BZLPC8xMOh1QHCmY4,18109
|
9
|
-
mkdocstrings_handlers/matlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
mkdocstrings_handlers/matlab/treesitter.py,sha256=e2rfMPFaprJ6XEPH8xk2i-DKBOY_9UNWFQWPX2R7U98,21756
|
11
|
-
mkdocstrings_matlab-0.5.0.dist-info/METADATA,sha256=3JCGvP6la7GZdx70e3QZyscYs_eWelan_vt7B5SwZyc,4521
|
12
|
-
mkdocstrings_matlab-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
-
mkdocstrings_matlab-0.5.0.dist-info/entry_points.txt,sha256=qUZFuB2TKh7KPlg4dR2npfbNgNExw6O6j1vF276PtPw,92
|
14
|
-
mkdocstrings_matlab-0.5.0.dist-info/licenses/LICENSE,sha256=TZQpwBuA3KLH56--XDAY2Qwo9gGdxeTITYhMOylmYhg,743
|
15
|
-
mkdocstrings_matlab-0.5.0.dist-info/RECORD,,
|
File without changes
|
{mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/entry_points.txt
RENAMED
File without changes
|
{mkdocstrings_matlab-0.5.0.dist-info → mkdocstrings_matlab-0.6.0.dist-info}/licenses/LICENSE
RENAMED
File without changes
|