mkdocstrings-matlab 0.3.0__py3-none-any.whl → 0.3.1__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/collect.py +73 -39
- mkdocstrings_handlers/matlab/models.py +4 -0
- {mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/METADATA +1 -1
- {mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/RECORD +7 -7
- {mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/WHEEL +0 -0
- {mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/entry_points.txt +0 -0
- {mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/licenses/LICENSE +0 -0
@@ -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)
|
@@ -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
|
@@ -2,14 +2,14 @@ mkdocs_material_matlab/__init__.py,sha256=9pmrwWbkIyr0T7qvADbsz3OR5bB3rWb231e6JS
|
|
2
2
|
mkdocs_material_matlab/mkdocs_material_matlab.py,sha256=s7vI1lv6hD8s7kDHWBfYKgN6EcldyUstGYJ45sA-VWY,850
|
3
3
|
mkdocs_material_matlab/css/style.css,sha256=iVTPIKljgvK899jEQylD7yu9yjKfrVE_4GLaITjhk4g,132
|
4
4
|
mkdocstrings_handlers/matlab/__init__.py,sha256=laA2bEP5rxdIWBLmfLiKKu7ChZ_HzCe-VeRvxmUTqww,128
|
5
|
-
mkdocstrings_handlers/matlab/collect.py,sha256=
|
5
|
+
mkdocstrings_handlers/matlab/collect.py,sha256=2dqYIQP7S8kHShH8o0cVFkIgTHL8EAoTV7OmtA4NnEs,23020
|
6
6
|
mkdocstrings_handlers/matlab/enums.py,sha256=lr3wLlhPxyBym3O7Rt0cLUZYqPCz6wQ2PYBibLKLTek,982
|
7
7
|
mkdocstrings_handlers/matlab/handler.py,sha256=w_k3jBaBwv3CYxGOg6cELHE1Z8p-nmxPEk-201tjLtE,15367
|
8
|
-
mkdocstrings_handlers/matlab/models.py,sha256=
|
8
|
+
mkdocstrings_handlers/matlab/models.py,sha256=y4ozShL4edxKKgb6jqBAfSI8Z9MEygSbEDnTDfBnRtk,17513
|
9
9
|
mkdocstrings_handlers/matlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
mkdocstrings_handlers/matlab/treesitter.py,sha256=dW4RcSep4A0L505WbAE9PGL2sTqizX7nhXLwQqbJh8Y,21726
|
11
|
-
mkdocstrings_matlab-0.3.
|
12
|
-
mkdocstrings_matlab-0.3.
|
13
|
-
mkdocstrings_matlab-0.3.
|
14
|
-
mkdocstrings_matlab-0.3.
|
15
|
-
mkdocstrings_matlab-0.3.
|
11
|
+
mkdocstrings_matlab-0.3.1.dist-info/METADATA,sha256=R43NGKuEohkr8gSC5bXCW_CEt7ULYTx-yij9DPEQBUo,4097
|
12
|
+
mkdocstrings_matlab-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
+
mkdocstrings_matlab-0.3.1.dist-info/entry_points.txt,sha256=qUZFuB2TKh7KPlg4dR2npfbNgNExw6O6j1vF276PtPw,92
|
14
|
+
mkdocstrings_matlab-0.3.1.dist-info/licenses/LICENSE,sha256=z5Ee0lckFL6K9LhLKftDu0JDl2Uie24Po20IclVk2SI,743
|
15
|
+
mkdocstrings_matlab-0.3.1.dist-info/RECORD,,
|
File without changes
|
{mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{mkdocstrings_matlab-0.3.0.dist-info → mkdocstrings_matlab-0.3.1.dist-info}/licenses/LICENSE
RENAMED
File without changes
|