mkdocstrings-matlab 0.1.7__tar.gz → 0.2.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/PKG-INFO +1 -1
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/mkdocs.yml +1 -1
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/pyproject.toml +1 -1
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/handler.py +126 -35
- mkdocstrings_matlab-0.2.1/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/builtin.m +27 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/class.m +7 -2
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/resolve.m +1 -1
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/models.py +1 -1
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023a/pyproject.toml +2 -2
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023b/pyproject.toml +2 -2
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2024a/pyproject.toml +2 -2
- mkdocstrings_matlab-0.2.1/submodules/mkdocstrings-matlab-r2024b/.gitignore +10 -0
- mkdocstrings_matlab-0.2.1/submodules/mkdocstrings-matlab-r2024b/LICENSE +21 -0
- mkdocstrings_matlab-0.2.1/submodules/mkdocstrings-matlab-r2024b/README.md +4 -0
- mkdocstrings_matlab-0.2.1/submodules/mkdocstrings-matlab-r2024b/pyproject.toml +54 -0
- mkdocstrings_matlab-0.2.1/submodules/mkdocstrings-matlab-r2024b/src/mkdocstrings_handlers/matlab_engine/__init__.py +8 -0
- mkdocstrings_matlab-0.1.7/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/builtin.m +0 -8
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/.gitignore +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/LICENSE +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/README.md +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/docs/index.md +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/__init__.py +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/collections.py +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/class.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/func.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/method.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/namespace.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/argument.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/func.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/namespace.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/property.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/script.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/dedent.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/get_namespace_path.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/parse_doc.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/+docstring/exception.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/matlab/matlab_startup.m +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/parser.py +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/resources/grammar.yml +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023a/.gitignore +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023a/LICENSE +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023a/README.md +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023a/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023b/.gitignore +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023b/LICENSE +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023b/README.md +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2023b/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2024a/.gitignore +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2024a/LICENSE +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2024a/README.md +0 -0
- {mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/submodules/mkdocstrings-matlab-r2024a/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -0
{mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/handler.py
RENAMED
@@ -10,6 +10,7 @@ from pprint import pprint
|
|
10
10
|
|
11
11
|
import charset_normalizer
|
12
12
|
import json
|
13
|
+
import requests
|
13
14
|
|
14
15
|
|
15
16
|
from mkdocstrings_handlers.matlab.collections import LinesCollection, ModelsCollection
|
@@ -60,7 +61,8 @@ class MatlabHandler(BaseHandler):
|
|
60
61
|
# "find_stubs_package": False,
|
61
62
|
# "allow_inspection": True,
|
62
63
|
"show_bases": True,
|
63
|
-
"show_inheritance_diagram":
|
64
|
+
"show_inheritance_diagram": True,
|
65
|
+
"inheritance_diagram_show_builtin": False,
|
64
66
|
"show_source": True,
|
65
67
|
# "preload_modules": None,
|
66
68
|
# Heading options
|
@@ -143,6 +145,50 @@ class MatlabHandler(BaseHandler):
|
|
143
145
|
# (it assumes the python handler is installed)
|
144
146
|
return super().get_templates_dir("python")
|
145
147
|
|
148
|
+
def get_ast(self, identifier:str, config: Mapping[str, Any]) -> dict:
|
149
|
+
"""Retrieve the Abstract Syntax Tree (AST) for a given MATLAB identifier.
|
150
|
+
|
151
|
+
This method resolves the docstring for the specified identifier and parses it into an AST.
|
152
|
+
If the identifier corresponds to a class, it processes its superclasses and optionally
|
153
|
+
includes an inheritance diagram based on the provided configuration.
|
154
|
+
Args:
|
155
|
+
identifier (str): The MATLAB identifier to resolve.
|
156
|
+
config (Mapping[str, Any]): Configuration options for processing the AST.
|
157
|
+
Returns:
|
158
|
+
dict: The parsed AST for the given identifier.
|
159
|
+
Raises:
|
160
|
+
MatlabExecutionError: If there is an error resolving the superclass AST.
|
161
|
+
"""
|
162
|
+
|
163
|
+
ast_json = self.engine.docstring.resolve(identifier)
|
164
|
+
ast = json.loads(ast_json)
|
165
|
+
|
166
|
+
if ast['type'] == 'class':
|
167
|
+
|
168
|
+
if isinstance(ast["superclasses"], str):
|
169
|
+
ast["superclasses"] = [ast["superclasses"]]
|
170
|
+
if isinstance(ast["properties"], dict):
|
171
|
+
ast["properties"] = [ast["properties"]]
|
172
|
+
if isinstance(ast["methods"], dict):
|
173
|
+
ast["methods"] = [ast["methods"]]
|
174
|
+
|
175
|
+
if config["show_inheritance_diagram"]:
|
176
|
+
# Check if class is builtin and skip superclasses if option is not set
|
177
|
+
builtin = ast.get('builtin', False) or ast["name"].startswith("matlab.")
|
178
|
+
resursive = not builtin or config["inheritance_diagram_show_builtin"]
|
179
|
+
if not resursive:
|
180
|
+
ast["superclasses"] = []
|
181
|
+
|
182
|
+
# Get superclasses AST
|
183
|
+
for index, base in enumerate(ast["superclasses"]):
|
184
|
+
try:
|
185
|
+
ast["superclasses"][index] = self.get_ast(base, config)
|
186
|
+
ast["superclasses"][index]["name"] = base
|
187
|
+
except MatlabExecutionError:
|
188
|
+
ast["superclasses"][index] = {"name": base}
|
189
|
+
return ast
|
190
|
+
|
191
|
+
|
146
192
|
def collect(self, identifier: str, config: Mapping[str, Any]) -> CollectorItem:
|
147
193
|
"""Collect data given an identifier and user configuration.
|
148
194
|
|
@@ -156,26 +202,28 @@ class MatlabHandler(BaseHandler):
|
|
156
202
|
Returns:
|
157
203
|
CollectorItem
|
158
204
|
"""
|
205
|
+
if identifier == "":
|
206
|
+
raise CollectionError("Empty identifier")
|
207
|
+
|
159
208
|
final_config = ChainMap(config, self.default_config) # type: ignore[arg-type]
|
160
209
|
if identifier in self.models:
|
161
210
|
return self.models[identifier]
|
162
211
|
|
163
212
|
try:
|
164
|
-
|
213
|
+
ast = self.get_ast(identifier, final_config)
|
165
214
|
except MatlabExecutionError as error:
|
166
215
|
raise CollectionError(error.args[0].strip()) from error
|
167
|
-
ast_dict = json.loads(ast_json)
|
168
216
|
|
169
|
-
filepath = Path(
|
217
|
+
filepath = Path(ast["path"])
|
170
218
|
if filepath not in self.lines:
|
171
219
|
lines = str(charset_normalizer.from_path(filepath).best()).splitlines()
|
172
220
|
self.lines[filepath] = lines
|
173
221
|
|
174
|
-
match
|
222
|
+
match ast["type"]:
|
175
223
|
case "function" | "method":
|
176
|
-
return self.collect_function(
|
224
|
+
return self.collect_function(ast, final_config)
|
177
225
|
case "class":
|
178
|
-
return self.collect_class(
|
226
|
+
return self.collect_class(ast, final_config)
|
179
227
|
case _:
|
180
228
|
return None
|
181
229
|
|
@@ -247,15 +295,11 @@ class MatlabHandler(BaseHandler):
|
|
247
295
|
lambda template_name: template_name in self.env.list_templates()
|
248
296
|
)
|
249
297
|
|
250
|
-
def collect_class(self,
|
251
|
-
docstring = (
|
252
|
-
Docstring(ast_dict["docstring"], parser=config["docstring_style"])
|
253
|
-
if ast_dict["docstring"]
|
254
|
-
else None
|
255
|
-
)
|
298
|
+
def collect_class(self, ast: dict, config: Mapping) -> Class:
|
256
299
|
|
257
|
-
filepath = Path(
|
300
|
+
filepath = Path(ast["path"])
|
258
301
|
|
302
|
+
# Parse textmate object
|
259
303
|
if config["show_source"]:
|
260
304
|
tmObject = self.parser.parse_file(filepath)
|
261
305
|
tmClass = next(
|
@@ -266,18 +310,24 @@ class MatlabHandler(BaseHandler):
|
|
266
310
|
else:
|
267
311
|
tmClass = None
|
268
312
|
|
269
|
-
|
270
|
-
|
271
|
-
|
313
|
+
# Get bases
|
314
|
+
if config["show_bases"]:
|
315
|
+
if config["show_inheritance_diagram"]:
|
316
|
+
bases = [base["name"] for base in ast["superclasses"]]
|
317
|
+
else:
|
318
|
+
bases = ast["superclasses"] if isinstance(ast["superclasses"], list) else [ast["superclasses"]]
|
319
|
+
else:
|
320
|
+
bases = []
|
321
|
+
|
322
|
+
# Load model
|
272
323
|
model = Class(
|
273
|
-
|
274
|
-
docstring=docstring,
|
324
|
+
ast["name"],
|
275
325
|
parent=self.get_parent(filepath.parent),
|
276
|
-
hidden=
|
277
|
-
sealed=
|
278
|
-
abstract=
|
279
|
-
enumeration=
|
280
|
-
handle=
|
326
|
+
hidden=ast["hidden"],
|
327
|
+
sealed=ast["sealed"],
|
328
|
+
abstract=ast["abstract"],
|
329
|
+
enumeration=ast["enumeration"],
|
330
|
+
handle=ast["handle"],
|
281
331
|
bases=bases,
|
282
332
|
filepath=filepath,
|
283
333
|
modules_collection=self.models,
|
@@ -286,8 +336,21 @@ class MatlabHandler(BaseHandler):
|
|
286
336
|
endlineno=len(self.lines[filepath]),
|
287
337
|
textmate=tmClass,
|
288
338
|
)
|
339
|
+
ast["name"] = model.canonical_path
|
340
|
+
|
341
|
+
# Format mermaid inheritance diagram
|
342
|
+
if config["show_inheritance_diagram"] and ast["superclasses"]:
|
343
|
+
section = get_inheritance_diagram(ast)
|
344
|
+
docstring = Docstring(ast["docstring"] + section, parser=config["docstring_style"])
|
345
|
+
elif ast["docstring"]:
|
346
|
+
docstring = Docstring(ast["docstring"], parser=config["docstring_style"])
|
347
|
+
else:
|
348
|
+
docstring = None
|
289
349
|
|
290
|
-
|
350
|
+
model.docstring = docstring
|
351
|
+
|
352
|
+
# Load properties
|
353
|
+
for property_dict in ast["properties"]:
|
291
354
|
name = property_dict.pop("name")
|
292
355
|
defining_class = property_dict.pop("class")
|
293
356
|
property_doc = property_dict.pop("docstring")
|
@@ -306,7 +369,8 @@ class MatlabHandler(BaseHandler):
|
|
306
369
|
model.members[name] = prop
|
307
370
|
self.models[prop.canonical_path] = prop
|
308
371
|
|
309
|
-
|
372
|
+
# Load methods
|
373
|
+
for method_dict in ast["methods"]:
|
310
374
|
name = method_dict.pop("name")
|
311
375
|
defining_class = method_dict.pop("class")
|
312
376
|
if (
|
@@ -330,20 +394,21 @@ class MatlabHandler(BaseHandler):
|
|
330
394
|
if config["merge_init_into_class"] and model.name in model.members:
|
331
395
|
constructor = model.members.pop(model.name)
|
332
396
|
model.members["__init__"] = constructor
|
333
|
-
|
397
|
+
|
398
|
+
if getattr(constructor.docstring, 'value', '') == getattr(model.docstring, 'value', ''):
|
334
399
|
model.docstring = None
|
335
400
|
|
336
401
|
self.models[model.canonical_path] = model
|
337
402
|
|
338
403
|
return model
|
339
404
|
|
340
|
-
def collect_function(self,
|
405
|
+
def collect_function(self, ast: dict, config: Mapping) -> Function:
|
341
406
|
parameters = []
|
342
407
|
|
343
408
|
inputs = (
|
344
|
-
|
345
|
-
if isinstance(
|
346
|
-
else [
|
409
|
+
ast["inputs"]
|
410
|
+
if isinstance(ast["inputs"], list)
|
411
|
+
else [ast["inputs"]]
|
347
412
|
)
|
348
413
|
for input_dict in inputs:
|
349
414
|
if input_dict["name"] == "varargin":
|
@@ -362,16 +427,16 @@ class MatlabHandler(BaseHandler):
|
|
362
427
|
)
|
363
428
|
)
|
364
429
|
|
365
|
-
filepath = Path(
|
430
|
+
filepath = Path(ast["path"])
|
366
431
|
model = Function(
|
367
|
-
|
432
|
+
ast["name"],
|
368
433
|
parameters=Parameters(*parameters),
|
369
434
|
docstring=Docstring(
|
370
|
-
|
435
|
+
ast["docstring"],
|
371
436
|
parser=config["docstring_style"],
|
372
437
|
parser_options=config["docstring_options"],
|
373
438
|
)
|
374
|
-
if
|
439
|
+
if ast["docstring"]
|
375
440
|
else None,
|
376
441
|
parent=self.get_parent(filepath.parent),
|
377
442
|
filepath=filepath,
|
@@ -409,6 +474,32 @@ class MatlabHandler(BaseHandler):
|
|
409
474
|
parent = ROOT
|
410
475
|
return parent
|
411
476
|
|
477
|
+
def get_inheritance_diagram(ast: dict) -> str:
|
478
|
+
def get_id(str: str) -> str:
|
479
|
+
return str.replace('.', '_')
|
480
|
+
def get_nodes(ast: dict, nodes: set[str] = set(), clicks: set[str] = set()) -> str:
|
481
|
+
id = get_id(ast['name'])
|
482
|
+
nodes.add(f" {id}[{ast['name']}]")
|
483
|
+
if "help" in ast:
|
484
|
+
clicks.add(f" click {id} \"{ast['help']}\"")
|
485
|
+
if "superclasses" in ast:
|
486
|
+
for superclass in ast["superclasses"]:
|
487
|
+
get_nodes(superclass, nodes)
|
488
|
+
return (nodes, clicks)
|
489
|
+
def get_links(ast: dict, links: set[str] = set()) -> str:
|
490
|
+
if "superclasses" in ast:
|
491
|
+
for superclass in ast["superclasses"]:
|
492
|
+
links.add(f" {get_id(ast['name'])} --> {get_id(superclass['name'])}")
|
493
|
+
get_links(superclass, links)
|
494
|
+
return links
|
495
|
+
|
496
|
+
(nodes, clicks) = get_nodes(ast)
|
497
|
+
nodes_str = '\n'.join(list(nodes))
|
498
|
+
clicks_str = '\n'.join(list(clicks))
|
499
|
+
links_str = '\n'.join(list(get_links(ast)))
|
500
|
+
section = f"\n\n## Inheritance diagram\n\n```mermaid\nflowchart BT\n{nodes_str}\n{clicks_str}\n{links_str}\n```"
|
501
|
+
return section
|
502
|
+
|
412
503
|
|
413
504
|
def get_handler(
|
414
505
|
*,
|
@@ -0,0 +1,27 @@
|
|
1
|
+
function data = builtin(identifier)
|
2
|
+
if isMATLABReleaseOlderThan('R2024a')
|
3
|
+
metaclass = @meta.class.fromName;
|
4
|
+
else
|
5
|
+
metaclass = @matlab.metadata.Class.fromName;
|
6
|
+
end
|
7
|
+
|
8
|
+
object = metaclass(identifier);
|
9
|
+
|
10
|
+
if isempty(object)
|
11
|
+
data.name = identifier;
|
12
|
+
data.type = 'function';
|
13
|
+
data.doc = help(identifier);
|
14
|
+
data.location = string(which(identifier));
|
15
|
+
data.inputs = struct.empty();
|
16
|
+
data.outputs = struct.empty();
|
17
|
+
if ~contains(identifier, '.internal.')
|
18
|
+
data.help = sprintf('https://mathworks.com/help/matlab/ref/%s.html', lower(identifier));
|
19
|
+
end
|
20
|
+
else
|
21
|
+
data = docstring.metadata.class(object, 'builtin', true);
|
22
|
+
if ~contains(identifier, '.internal.')
|
23
|
+
data.help = sprintf('https://mathworks.com/help/matlab/ref/%s-class.html', lower(identifier));
|
24
|
+
end
|
25
|
+
end
|
26
|
+
data.builtin = true;
|
27
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
function data = class(object)
|
1
|
+
function data = class(object, opts)
|
2
2
|
arguments
|
3
3
|
object (1,1) % meta.class matlab.metadata.Class
|
4
|
+
opts.builtin (1,1) logical = false
|
4
5
|
end
|
5
6
|
data.type = 'class';
|
6
7
|
|
@@ -8,7 +9,6 @@ function data = class(object)
|
|
8
9
|
data.name = namespaces{end};
|
9
10
|
|
10
11
|
data.docstring = docstring.utils.parse_doc(object);
|
11
|
-
data.path = matlab.internal.metafunction(object.Name).Location;
|
12
12
|
data.hidden = object.Hidden;
|
13
13
|
data.sealed = object.Sealed;
|
14
14
|
data.abstract = object.Abstract;
|
@@ -16,6 +16,11 @@ function data = class(object)
|
|
16
16
|
data.superclasses = arrayfun(@(o) string(o.Name), object.SuperclassList);
|
17
17
|
data.handle = object.HandleCompatible;
|
18
18
|
data.aliases = object.Aliases;
|
19
|
+
if opts.builtin
|
20
|
+
data.path = '';
|
21
|
+
else
|
22
|
+
data.path = matlab.internal.metafunction(object.Name).Location;
|
23
|
+
end
|
19
24
|
|
20
25
|
data.methods = [];
|
21
26
|
for methodObject = object.MethodList'
|
@@ -46,7 +46,7 @@ if contains(identifier, '.')
|
|
46
46
|
end
|
47
47
|
|
48
48
|
% Try built-in aliases with which
|
49
|
-
if contains(which(identifier), ' built-in ')
|
49
|
+
if contains(which(identifier), {' built-in ', matlabroot})
|
50
50
|
data = docstring.case.builtin(identifier);
|
51
51
|
jsonString = jsonencode(data);
|
52
52
|
return
|
{mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/models.py
RENAMED
@@ -62,7 +62,7 @@ class Class(CanonicalPathMixin, PathMixin, GriffeClass):
|
|
62
62
|
for block in self._textmate.children
|
63
63
|
if block.token == "meta.methods.matlab"
|
64
64
|
]:
|
65
|
-
for method in block.children:
|
65
|
+
for method in [c for c in block.children if c.token == "meta.function.matlab"]:
|
66
66
|
declaration = next(
|
67
67
|
item
|
68
68
|
for item in method.children
|
@@ -35,8 +35,8 @@ classifiers = [
|
|
35
35
|
|
36
36
|
[project.urls]
|
37
37
|
Documentation = "http://watermarkhu.nl/mkdocstrings-matlab/"
|
38
|
-
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab
|
39
|
-
Issues = "https://github.com/watermarkhu/mkdocstrings-
|
38
|
+
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab"
|
39
|
+
Issues = "https://github.com/watermarkhu/mkdocstrings-matlab/issues"
|
40
40
|
|
41
41
|
|
42
42
|
[build-system]
|
@@ -35,8 +35,8 @@ classifiers = [
|
|
35
35
|
|
36
36
|
[project.urls]
|
37
37
|
Documentation = "http://watermarkhu.nl/mkdocstrings-matlab/"
|
38
|
-
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab
|
39
|
-
Issues = "https://github.com/watermarkhu/mkdocstrings-
|
38
|
+
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab"
|
39
|
+
Issues = "https://github.com/watermarkhu/mkdocstrings-matlab/issues"
|
40
40
|
|
41
41
|
[build-system]
|
42
42
|
requires = ["hatchling"]
|
@@ -35,8 +35,8 @@ classifiers = [
|
|
35
35
|
|
36
36
|
[project.urls]
|
37
37
|
Documentation = "http://watermarkhu.nl/mkdocstrings-matlab/"
|
38
|
-
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab
|
39
|
-
Issues = "https://github.com/watermarkhu/mkdocstrings-
|
38
|
+
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab"
|
39
|
+
Issues = "https://github.com/watermarkhu/mkdocstrings-matlab/issues"
|
40
40
|
|
41
41
|
[build-system]
|
42
42
|
requires = ["hatchling"]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Mark Shui Hu
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
[project]
|
2
|
+
name = "mkdocstrings-matlab-r2024b"
|
3
|
+
version = "0.1.2"
|
4
|
+
description = "Add your description here"
|
5
|
+
authors = [
|
6
|
+
{ name = "Mark Shui Hu", email = "watermarkhu@gmail.com" }
|
7
|
+
]
|
8
|
+
dependencies = [
|
9
|
+
"matlabengine==24.2.1",
|
10
|
+
]
|
11
|
+
readme = "README.md"
|
12
|
+
requires-python = ">=3.9,<3.13"
|
13
|
+
keywords = ["mkdocs", "mkdocstrings", "documentation", "docstring", "matlab"]
|
14
|
+
license = {file = "LICENSE"}
|
15
|
+
classifiers = [
|
16
|
+
# How mature is this project? Common values are
|
17
|
+
# 3 - Alpha
|
18
|
+
# 4 - Beta
|
19
|
+
# 5 - Production/Stable
|
20
|
+
"Development Status :: 3 - Alpha",
|
21
|
+
|
22
|
+
# Indicate who your project is intended for
|
23
|
+
"Intended Audience :: Developers",
|
24
|
+
"Topic :: Software Development :: Documentation",
|
25
|
+
|
26
|
+
# Pick your license as you wish (see also "license" above)
|
27
|
+
"License :: OSI Approved :: MIT License",
|
28
|
+
|
29
|
+
# Specify the Python versions you support here.
|
30
|
+
"Programming Language :: Python :: 3",
|
31
|
+
"Programming Language :: Python :: 3.9",
|
32
|
+
"Programming Language :: Python :: 3.10",
|
33
|
+
"Programming Language :: Python :: 3.11",
|
34
|
+
"Programming Language :: Python :: 3.12",
|
35
|
+
]
|
36
|
+
|
37
|
+
[project.urls]
|
38
|
+
Documentation = "http://watermarkhu.nl/mkdocstrings-matlab/"
|
39
|
+
Repository = "https://github.com/watermarkhu/mkdocstrings-matlab"
|
40
|
+
Issues = "https://github.com/watermarkhu/mkdocstrings-matlab/issues"
|
41
|
+
|
42
|
+
[build-system]
|
43
|
+
requires = ["hatchling"]
|
44
|
+
build-backend = "hatchling.build"
|
45
|
+
|
46
|
+
[tool.rye]
|
47
|
+
managed = true
|
48
|
+
dev-dependencies = []
|
49
|
+
|
50
|
+
[tool.hatch.metadata]
|
51
|
+
allow-direct-references = true
|
52
|
+
|
53
|
+
[tool.hatch.build.targets.wheel]
|
54
|
+
packages = ["src/mkdocstrings_handlers"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/__init__.py
RENAMED
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.1.7 → mkdocstrings_matlab-0.2.1}/src/mkdocstrings_handlers/matlab/parser.py
RENAMED
File without changes
|
{mkdocstrings_matlab-0.1.7 → mkdocstrings_matlab-0.2.1}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|