mkdocstrings-matlab 0.3.0__tar.gz → 0.3.2__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.
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/PKG-INFO +1 -1
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/pyproject.toml +1 -1
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/collect.py +74 -40
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/handler.py +5 -2
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/models.py +4 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/.gitignore +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/.python-version +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/.vscode/launch.json +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/.vscode/settings.json +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/LICENSE +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/README.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/index.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/license.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/logo.png +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/stylesheets/extra.css +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/usage/docstrings/google.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/usage/docstrings/numpy.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/usage/docstrings/sphinx.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/docs/usage/index.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/logo.png +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/mkdocs.yml +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/requirements.lock +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocs_material_matlab/__init__.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocs_material_matlab/css/style.css +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocs_material_matlab/mkdocs_material_matlab.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/__init__.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/enums.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/treesitter.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/debug.py +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/docs/api.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/docs/index.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/docs/namespace.md +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/mkdocs.yml +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/+subpackage/nested.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/@myClass/customMethod.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/@myClass/myClass.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/namespacefunction.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/AbstractFramework.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/DocumentationFramework.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/myfunction.m +0 -0
- {mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/uv.lock +0 -0
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/collect.py
RENAMED
@@ -200,7 +200,7 @@ class PathCollection(ModulesCollection):
|
|
200
200
|
return model
|
201
201
|
return None
|
202
202
|
|
203
|
-
def update_model(self, model: MatlabMixin, config: Mapping):
|
203
|
+
def update_model(self, model: MatlabMixin, config: Mapping) -> MatlabMixin:
|
204
204
|
"""
|
205
205
|
Update the given model based on the provided configuration.
|
206
206
|
|
@@ -276,43 +276,55 @@ class PathCollection(ModulesCollection):
|
|
276
276
|
document_parameters = not docstring_parameters and arguments_parameters
|
277
277
|
document_returns = not docstring_returns and arguments_returns
|
278
278
|
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
279
|
+
standard_parameters = [
|
280
|
+
param for param in model.parameters
|
281
|
+
if param.kind is not ParameterKind.keyword_only
|
282
|
+
]
|
283
|
+
|
284
|
+
keyword_parameters = [
|
285
|
+
param for param in model.parameters
|
286
|
+
if param.kind is ParameterKind.keyword_only
|
287
|
+
]
|
288
|
+
|
289
|
+
if document_parameters and standard_parameters:
|
290
|
+
model.docstring._extra_sections.append(
|
291
|
+
DocstringSectionParameters(
|
292
|
+
[
|
293
|
+
DocstringParameter(
|
294
|
+
name=param.name,
|
295
|
+
value=str(param.default)
|
296
|
+
if param.default is not None
|
297
|
+
else None,
|
298
|
+
annotation=param.annotation,
|
299
|
+
description=param.docstring.value
|
300
|
+
if param.docstring is not None
|
301
|
+
else "",
|
302
|
+
)
|
303
|
+
for param in standard_parameters
|
304
|
+
]
|
305
|
+
)
|
295
306
|
)
|
296
307
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
308
|
+
if document_parameters and keyword_parameters:
|
309
|
+
|
310
|
+
model.docstring._extra_sections.append(
|
311
|
+
DocstringSectionParameters(
|
312
|
+
[
|
313
|
+
DocstringParameter(
|
314
|
+
name=param.name,
|
315
|
+
value=str(param.default)
|
316
|
+
if param.default is not None
|
317
|
+
else None,
|
318
|
+
annotation=param.annotation,
|
319
|
+
description=param.docstring.value
|
320
|
+
if param.docstring is not None
|
321
|
+
else "",
|
322
|
+
)
|
323
|
+
for param in keyword_parameters
|
324
|
+
],
|
325
|
+
title="Keyword Arguments:",
|
326
|
+
)
|
313
327
|
)
|
314
|
-
model.docstring._extra_sections.append(parameters)
|
315
|
-
model.docstring._extra_sections.append(keywords)
|
316
328
|
|
317
329
|
if document_returns:
|
318
330
|
returns = DocstringSectionReturns(
|
@@ -568,12 +580,17 @@ class LazyModel:
|
|
568
580
|
if (
|
569
581
|
member.is_file()
|
570
582
|
and member.suffix == ".m"
|
571
|
-
and member.name != "Contents.m"
|
572
583
|
and member != classfile
|
573
584
|
):
|
574
|
-
|
575
|
-
|
576
|
-
|
585
|
+
if member.name == "Contents.m" and model.docstring is None:
|
586
|
+
contentsfile = self._collect_path(member)
|
587
|
+
model.docstring = contentsfile.docstring
|
588
|
+
else:
|
589
|
+
method = self._collect_path(member)
|
590
|
+
method.parent = model
|
591
|
+
model.members[method.name] = method
|
592
|
+
if model.docstring is None:
|
593
|
+
model.docstring = self._collect_readme_md(path, model)
|
577
594
|
return model
|
578
595
|
|
579
596
|
def _collect_namespace(self, path: Path) -> Namespace | None:
|
@@ -589,9 +606,26 @@ class LazyModel:
|
|
589
606
|
elif member.is_file() and member.suffix == ".m":
|
590
607
|
if member.name == "Contents.m":
|
591
608
|
contentsfile = self._collect_path(member)
|
592
|
-
|
609
|
+
model.docstring = contentsfile.docstring
|
593
610
|
else:
|
594
611
|
submodel = self._path_collection._models[member].model()
|
595
612
|
if submodel is not None:
|
596
613
|
model.members[submodel.name] = submodel
|
614
|
+
|
615
|
+
if model.docstring is None:
|
616
|
+
model.docstring = self._collect_readme_md(path, model)
|
617
|
+
|
597
618
|
return model
|
619
|
+
|
620
|
+
def _collect_readme_md(self, path, parent: MatlabMixin) -> Docstring | None:
|
621
|
+
|
622
|
+
if (path / "README.md").exists():
|
623
|
+
readme = path / "README.md"
|
624
|
+
elif (path / "readme.md").exists():
|
625
|
+
readme = path / "readme.md"
|
626
|
+
else:
|
627
|
+
return None
|
628
|
+
|
629
|
+
with open(readme, "r") as file:
|
630
|
+
content = file.read()
|
631
|
+
return Docstring(content, parent=parent)
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/handler.py
RENAMED
@@ -21,7 +21,10 @@ class MatlabHandler(BaseHandler):
|
|
21
21
|
"""Whether this handler is interested in enabling the creation of the `objects.inv` Sphinx inventory file."""
|
22
22
|
fallback_theme = "material"
|
23
23
|
"""The fallback theme."""
|
24
|
-
fallback_config: ClassVar[dict] = {
|
24
|
+
fallback_config: ClassVar[dict] = {
|
25
|
+
"fallback": True,
|
26
|
+
"merge_constructor_into_class": True,
|
27
|
+
}
|
25
28
|
"""The configuration used to collect item during autorefs fallback."""
|
26
29
|
default_config: ClassVar[dict] = {
|
27
30
|
# General options
|
@@ -51,7 +54,7 @@ class MatlabHandler(BaseHandler):
|
|
51
54
|
"docstring_options": {},
|
52
55
|
"docstring_section_style": "table",
|
53
56
|
"create_from_argument_blocks": False,
|
54
|
-
"merge_constructor_into_class":
|
57
|
+
"merge_constructor_into_class": True,
|
55
58
|
"show_if_no_docstring": False,
|
56
59
|
"show_docstring_attributes": True,
|
57
60
|
"show_docstring_functions": True,
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/models.py
RENAMED
@@ -558,3 +558,7 @@ class Namespace(MatlabMixin, PathMixin, Module, MatlabObject):
|
|
558
558
|
|
559
559
|
def __repr__(self) -> str:
|
560
560
|
return f"Namespace({self.path!r})"
|
561
|
+
|
562
|
+
@property
|
563
|
+
def is_internal(self) -> bool:
|
564
|
+
return any(part == "+internal" for part in self.filepath.parts) if self.filepath else False
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocs_material_matlab/__init__.py
RENAMED
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocs_material_matlab/css/style.css
RENAMED
File without changes
|
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/__init__.py
RENAMED
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/enums.py
RENAMED
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/src/mkdocstrings_handlers/matlab/py.typed
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/+subpackage/nested.m
RENAMED
File without changes
|
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/@myClass/myClass.m
RENAMED
File without changes
|
{mkdocstrings_matlab-0.3.0 → mkdocstrings_matlab-0.3.2}/test/src/+myNamespace/namespacefunction.m
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|