mkdocstrings-matlab 0.2.2__tar.gz → 0.3.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- mkdocstrings_matlab-0.3.0/.python-version +1 -0
- mkdocstrings_matlab-0.3.0/.vscode/launch.json +26 -0
- mkdocstrings_matlab-0.3.0/.vscode/settings.json +3 -0
- mkdocstrings_matlab-0.3.0/LICENSE +15 -0
- mkdocstrings_matlab-0.3.0/PKG-INFO +82 -0
- mkdocstrings_matlab-0.3.0/README.md +51 -0
- mkdocstrings_matlab-0.3.0/docs/index.md +6 -0
- mkdocstrings_matlab-0.3.0/docs/license.md +10 -0
- mkdocstrings_matlab-0.3.0/docs/logo.png +0 -0
- mkdocstrings_matlab-0.3.0/docs/stylesheets/extra.css +3 -0
- mkdocstrings_matlab-0.3.0/docs/usage/docstrings/google.md +28 -0
- mkdocstrings_matlab-0.3.0/docs/usage/docstrings/numpy.md +11 -0
- mkdocstrings_matlab-0.3.0/docs/usage/docstrings/sphinx.md +6 -0
- mkdocstrings_matlab-0.3.0/docs/usage/index.md +140 -0
- mkdocstrings_matlab-0.3.0/logo.png +0 -0
- mkdocstrings_matlab-0.3.0/mkdocs.yml +226 -0
- mkdocstrings_matlab-0.3.0/pyproject.toml +70 -0
- mkdocstrings_matlab-0.3.0/requirements.lock +47 -0
- mkdocstrings_matlab-0.3.0/src/mkdocs_material_matlab/__init__.py +4 -0
- mkdocstrings_matlab-0.3.0/src/mkdocs_material_matlab/css/style.css +7 -0
- mkdocstrings_matlab-0.3.0/src/mkdocs_material_matlab/mkdocs_material_matlab.py +20 -0
- mkdocstrings_matlab-0.3.0/src/mkdocstrings_handlers/matlab/collect.py +597 -0
- mkdocstrings_matlab-0.3.0/src/mkdocstrings_handlers/matlab/enums.py +35 -0
- mkdocstrings_matlab-0.3.0/src/mkdocstrings_handlers/matlab/handler.py +294 -0
- mkdocstrings_matlab-0.3.0/src/mkdocstrings_handlers/matlab/models.py +560 -0
- mkdocstrings_matlab-0.3.0/src/mkdocstrings_handlers/matlab/treesitter.py +654 -0
- mkdocstrings_matlab-0.3.0/test/debug.py +33 -0
- mkdocstrings_matlab-0.3.0/test/docs/api.md +16 -0
- mkdocstrings_matlab-0.3.0/test/docs/index.md +5 -0
- mkdocstrings_matlab-0.3.0/test/docs/namespace.md +6 -0
- mkdocstrings_matlab-0.3.0/test/mkdocs.yml +32 -0
- mkdocstrings_matlab-0.3.0/test/src/+myNamespace/+subpackage/nested.m +18 -0
- mkdocstrings_matlab-0.3.0/test/src/+myNamespace/@myClass/customMethod.m +21 -0
- mkdocstrings_matlab-0.3.0/test/src/+myNamespace/@myClass/myClass.m +47 -0
- mkdocstrings_matlab-0.3.0/test/src/+myNamespace/namespacefunction.m +21 -0
- mkdocstrings_matlab-0.3.0/test/src/AbstractFramework.m +9 -0
- mkdocstrings_matlab-0.3.0/test/src/DocumentationFramework.m +141 -0
- mkdocstrings_matlab-0.3.0/test/src/myfunction.m +40 -0
- mkdocstrings_matlab-0.3.0/uv.lock +1729 -0
- mkdocstrings_matlab-0.2.2/LICENSE +0 -21
- mkdocstrings_matlab-0.2.2/PKG-INFO +0 -19
- mkdocstrings_matlab-0.2.2/README.md +0 -3
- mkdocstrings_matlab-0.2.2/docs/index.md +0 -25
- mkdocstrings_matlab-0.2.2/mkdocs.yml +0 -28
- mkdocstrings_matlab-0.2.2/pyproject.toml +0 -32
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/collections.py +0 -17
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/handler.py +0 -539
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/builtin.m +0 -27
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/class.m +0 -12
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/func.m +0 -5
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/method.m +0 -6
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+case/namespace.m +0 -28
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/argument.m +0 -67
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/class.m +0 -51
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/func.m +0 -14
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/namespace.m +0 -14
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/property.m +0 -50
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+metadata/script.m +0 -15
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/dedent.m +0 -33
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/get_namespace_path.m +0 -26
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/+utils/parse_doc.m +0 -21
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/exception.m +0 -7
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/+docstring/resolve.m +0 -104
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/matlab/matlab_startup.m +0 -21
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/models.py +0 -176
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/parser.py +0 -31
- mkdocstrings_matlab-0.2.2/src/mkdocstrings_handlers/matlab/resources/grammar.yml +0 -566
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023a/.gitignore +0 -10
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023a/LICENSE +0 -21
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023a/README.md +0 -5
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023a/pyproject.toml +0 -55
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023a/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -8
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023b/.gitignore +0 -10
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023b/LICENSE +0 -21
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023b/README.md +0 -3
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023b/pyproject.toml +0 -54
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2023b/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -8
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024a/.gitignore +0 -10
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024a/LICENSE +0 -21
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024a/README.md +0 -4
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024a/pyproject.toml +0 -53
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024a/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -8
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024b/.gitignore +0 -10
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024b/LICENSE +0 -21
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024b/README.md +0 -4
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024b/pyproject.toml +0 -54
- mkdocstrings_matlab-0.2.2/submodules/mkdocstrings-matlab-r2024b/src/mkdocstrings_handlers/matlab_engine/__init__.py +0 -8
- {mkdocstrings_matlab-0.2.2 → mkdocstrings_matlab-0.3.0}/.gitignore +0 -0
- {mkdocstrings_matlab-0.2.2 → mkdocstrings_matlab-0.3.0}/src/mkdocstrings_handlers/matlab/__init__.py +0 -0
- {mkdocstrings_matlab-0.2.2 → mkdocstrings_matlab-0.3.0}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
3.12
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
3
|
+
// Hover to view descriptions of existing attributes.
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
+
"version": "0.2.0",
|
6
|
+
"configurations": [
|
7
|
+
{
|
8
|
+
"name": "Python Debugger: Current File",
|
9
|
+
"type": "debugpy",
|
10
|
+
"request": "launch",
|
11
|
+
"program": "${file}",
|
12
|
+
"console": "integratedTerminal",
|
13
|
+
"justMyCode": false,
|
14
|
+
"jinja": true
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"name": "Python Debugger: mkdocstrings test",
|
18
|
+
"type": "debugpy",
|
19
|
+
"request": "launch",
|
20
|
+
"program": "test/debug.py",
|
21
|
+
"console": "integratedTerminal",
|
22
|
+
"justMyCode": false,
|
23
|
+
"jinja": true
|
24
|
+
}
|
25
|
+
]
|
26
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Mark Shui Hu
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: mkdocstrings-matlab
|
3
|
+
Version: 0.3.0
|
4
|
+
Summary: A MATLAB handler for mkdocstrings
|
5
|
+
Author-email: Mark Hu <watermarkhu@gmail.com>
|
6
|
+
License: ISC
|
7
|
+
License-File: LICENSE
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
9
|
+
Classifier: Intended Audience :: Developers
|
10
|
+
Classifier: Programming Language :: Python
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
18
|
+
Classifier: Topic :: Documentation
|
19
|
+
Classifier: Topic :: Software Development
|
20
|
+
Classifier: Topic :: Software Development :: Documentation
|
21
|
+
Classifier: Topic :: Utilities
|
22
|
+
Classifier: Typing :: Typed
|
23
|
+
Requires-Python: >=3.10
|
24
|
+
Requires-Dist: charset-normalizer>=3.3.2
|
25
|
+
Requires-Dist: griffe>=1.5.1
|
26
|
+
Requires-Dist: mkdocs>=1.6.0
|
27
|
+
Requires-Dist: mkdocstrings[python]>=0.18
|
28
|
+
Requires-Dist: tree-sitter-matlab>=1.0.2
|
29
|
+
Requires-Dist: tree-sitter>=0.23.2
|
30
|
+
Description-Content-Type: text/markdown
|
31
|
+
|
32
|
+
<h1 align="center">mkdocstrings-matlab</h1>
|
33
|
+
|
34
|
+
<p align="center">A MATLAB handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
|
35
|
+
|
36
|
+
|
37
|
+
---
|
38
|
+
|
39
|
+
<p align="center"><img src="logo.png"></p>
|
40
|
+
|
41
|
+
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
|
+
|
43
|
+
## Installation
|
44
|
+
|
45
|
+
You can install this handler by specifying it as a dependency:
|
46
|
+
|
47
|
+
```toml title="pyproject.toml"
|
48
|
+
# PEP 621 dependencies declaration
|
49
|
+
# adapt to your dependencies manager
|
50
|
+
[project]
|
51
|
+
dependencies = [
|
52
|
+
"mkdocstrings-matlab>=0.3",
|
53
|
+
]
|
54
|
+
```
|
55
|
+
|
56
|
+
## Features
|
57
|
+
|
58
|
+
- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
|
59
|
+
[Tree-sitter](https://tree-sitter.github.io/tree-sitter/).
|
60
|
+
|
61
|
+
- **Support for argument validation blocks:** Tree-sitter collects your [function and method argument validation](https://mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html)
|
62
|
+
blocks to display input and output argument types and default values.
|
63
|
+
It is even able to automatically add cross-references o other objects from your API.
|
64
|
+
|
65
|
+
- **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.
|
67
|
+
|
68
|
+
- **Support for documented properties:** properties definitions followed by a docstring will be recognized in classes.
|
69
|
+
|
70
|
+
- **Multiple docstring-styles support:** common support for Google-style, Numpydoc-style,
|
71
|
+
and Sphinx-style docstrings. See [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/) on docstrings support.
|
72
|
+
|
73
|
+
- **Admonition support in Google docstrings:** blocks like `Note:` or `Warning:` will be transformed
|
74
|
+
to their [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) equivalent.
|
75
|
+
*We do not support nested admonitions in docstrings!*
|
76
|
+
|
77
|
+
- **Every object has a TOC entry:** we render a heading for each object, meaning *MkDocs* picks them into the Table
|
78
|
+
of Contents, which is nicely displayed by the Material theme. Thanks to *mkdocstrings* cross-reference ability,
|
79
|
+
you can reference other objects within your docstrings, with the classic Markdown syntax:
|
80
|
+
`[this object][namespace.subnamespace.object]` or directly with `[namespace.subnamespace.object][]`
|
81
|
+
|
82
|
+
- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<h1 align="center">mkdocstrings-matlab</h1>
|
2
|
+
|
3
|
+
<p align="center">A MATLAB handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
|
4
|
+
|
5
|
+
|
6
|
+
---
|
7
|
+
|
8
|
+
<p align="center"><img src="logo.png"></p>
|
9
|
+
|
10
|
+
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/).
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
You can install this handler by specifying it as a dependency:
|
15
|
+
|
16
|
+
```toml title="pyproject.toml"
|
17
|
+
# PEP 621 dependencies declaration
|
18
|
+
# adapt to your dependencies manager
|
19
|
+
[project]
|
20
|
+
dependencies = [
|
21
|
+
"mkdocstrings-matlab>=0.3",
|
22
|
+
]
|
23
|
+
```
|
24
|
+
|
25
|
+
## Features
|
26
|
+
|
27
|
+
- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
|
28
|
+
[Tree-sitter](https://tree-sitter.github.io/tree-sitter/).
|
29
|
+
|
30
|
+
- **Support for argument validation blocks:** Tree-sitter collects your [function and method argument validation](https://mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html)
|
31
|
+
blocks to display input and output argument types and default values.
|
32
|
+
It is even able to automatically add cross-references o other objects from your API.
|
33
|
+
|
34
|
+
- **Recursive documentation of MATLAB [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html):**
|
35
|
+
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.
|
36
|
+
|
37
|
+
- **Support for documented properties:** properties definitions followed by a docstring will be recognized in classes.
|
38
|
+
|
39
|
+
- **Multiple docstring-styles support:** common support for Google-style, Numpydoc-style,
|
40
|
+
and Sphinx-style docstrings. See [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/) on docstrings support.
|
41
|
+
|
42
|
+
- **Admonition support in Google docstrings:** blocks like `Note:` or `Warning:` will be transformed
|
43
|
+
to their [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) equivalent.
|
44
|
+
*We do not support nested admonitions in docstrings!*
|
45
|
+
|
46
|
+
- **Every object has a TOC entry:** we render a heading for each object, meaning *MkDocs* picks them into the Table
|
47
|
+
of Contents, which is nicely displayed by the Material theme. Thanks to *mkdocstrings* cross-reference ability,
|
48
|
+
you can reference other objects within your docstrings, with the classic Markdown syntax:
|
49
|
+
`[this object][namespace.subnamespace.object]` or directly with `[namespace.subnamespace.object][]`
|
50
|
+
|
51
|
+
- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Google style
|
2
|
+
|
3
|
+
## :warning: Work in Progress!
|
4
|
+
|
5
|
+
### Google-style admonitions
|
6
|
+
|
7
|
+
With Google-style docstrings, any section that is not recognized will be transformed into its admonition equivalent.
|
8
|
+
For example:
|
9
|
+
|
10
|
+
=== "Docstring"
|
11
|
+
```python
|
12
|
+
"""
|
13
|
+
Note:
|
14
|
+
It looks like a section, but it will be rendered as an admonition.
|
15
|
+
|
16
|
+
Tip: You can even choose a title.
|
17
|
+
This admonition has a custom title!
|
18
|
+
"""
|
19
|
+
```
|
20
|
+
|
21
|
+
=== "Result"
|
22
|
+
NOTE: It looks like a section, but it will be rendered as an admonition.
|
23
|
+
|
24
|
+
TIP: **You can even choose a title.**
|
25
|
+
This admonition has a custom title!
|
26
|
+
|
27
|
+
See [Napoleon's documentation](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html).
|
28
|
+
See the supported docstring sections on [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/).
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Numpydoc style
|
2
|
+
|
3
|
+
## :warning: Work in Progress!
|
4
|
+
|
5
|
+
NOTE: As Numpy-style is partially supported by the underlying parser,
|
6
|
+
you may experience problems in the building process if your docstring
|
7
|
+
has a `Methods` section in the class docstring
|
8
|
+
(see [#366](https://github.com/mkdocstrings/mkdocstrings/issues/366)).
|
9
|
+
|
10
|
+
See [Numpydoc's documentation](https://numpydoc.readthedocs.io/en/latest/format.html).
|
11
|
+
See the supported docstring sections on [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/).
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Sphinx style
|
2
|
+
|
3
|
+
## :warning: Work in Progress!
|
4
|
+
|
5
|
+
See [Sphinx's documentation](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html).
|
6
|
+
See the supported docstring sections on [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/).
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# Usage
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
You can install this handler by specifying it as a dependency:
|
6
|
+
|
7
|
+
```toml title="pyproject.toml"
|
8
|
+
# PEP 621 dependencies declaration
|
9
|
+
# adapt to your dependencies manager
|
10
|
+
[project]
|
11
|
+
dependencies = [
|
12
|
+
"mkdocstrings-matlab>=0.3",
|
13
|
+
]
|
14
|
+
```
|
15
|
+
|
16
|
+
For *mkdocstrings* the default will be the Python handler. You can change the default handler,
|
17
|
+
or explicitely set the MATLAB handler as default by defining the `default_handler`
|
18
|
+
configuration option of `mkdocstrings` in `mkdocs.yml`:
|
19
|
+
|
20
|
+
```yaml title="mkdocs.yml"
|
21
|
+
plugins:
|
22
|
+
- mkdocstrings:
|
23
|
+
default_handler: matlab
|
24
|
+
```
|
25
|
+
|
26
|
+
## Injecting documentation
|
27
|
+
|
28
|
+
With the MATLAB handler installed and configured as default handler,
|
29
|
+
you can inject documentation for a module, class, function, or any other MATLAB object
|
30
|
+
with *mkdocstrings*' [autodoc syntax], in your Markdown pages:
|
31
|
+
|
32
|
+
```md
|
33
|
+
::: path.to.object
|
34
|
+
```
|
35
|
+
|
36
|
+
If another handler was defined as default handler,
|
37
|
+
you can explicitely ask for the MATLAB handler to be used when injecting documentation
|
38
|
+
with the `handler` option:
|
39
|
+
|
40
|
+
```md
|
41
|
+
::: path.to.object
|
42
|
+
handler: matlab
|
43
|
+
```
|
44
|
+
|
45
|
+
## Configuration
|
46
|
+
|
47
|
+
When installed, the MATLAB handler becomes the default *mkdocstrings* handler.
|
48
|
+
You can configure it in `mkdocs.yml`:
|
49
|
+
|
50
|
+
```yaml title="mkdocs.yml"
|
51
|
+
plugins:
|
52
|
+
- mkdocstrings:
|
53
|
+
handlers:
|
54
|
+
python:
|
55
|
+
... # the Python handler configuration
|
56
|
+
```
|
57
|
+
|
58
|
+
### Global-only options
|
59
|
+
|
60
|
+
Some options are **global only**, and go directly under the handler's name.
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
#### `paths`
|
65
|
+
|
66
|
+
This option is used to set the [MATLAB search path](https://mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html).
|
67
|
+
The MATLAB search path is a subset of all the folders in the file system.
|
68
|
+
The order of folders on the search path is important.
|
69
|
+
When files with the same name appear in multiple folders on the search path,
|
70
|
+
MATLAB uses the one found in the folder nearest to the top of the search path.
|
71
|
+
|
72
|
+
Non-absolute paths are computed as relative to MkDocs configuration file. Example:
|
73
|
+
|
74
|
+
```yaml title="mkdocs.yml"
|
75
|
+
plugins:
|
76
|
+
- mkdocstrings:
|
77
|
+
handlers:
|
78
|
+
matlab:
|
79
|
+
paths: [src] # search files in the src folder
|
80
|
+
```
|
81
|
+
|
82
|
+
|
83
|
+
#### `load_external_modules`
|
84
|
+
|
85
|
+
This option allows you to specify whether the handler should recursively search through the directories specified in the `paths` option. When set to `true`, the handler will look for MATLAB files in all subdirectories of the specified paths.
|
86
|
+
|
87
|
+
Example:
|
88
|
+
|
89
|
+
```yaml title="mkdocs.yml"
|
90
|
+
plugins:
|
91
|
+
- mkdocstrings:
|
92
|
+
handlers:
|
93
|
+
matlab:
|
94
|
+
paths: [src] # search files in the src folder
|
95
|
+
paths_recursive: true # search recursively in subfolders
|
96
|
+
```
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
### Global/local options
|
101
|
+
|
102
|
+
The other options can be used both globally *and* locally, under the `options` key.
|
103
|
+
For example, globally:
|
104
|
+
|
105
|
+
```yaml title="mkdocs.yml"
|
106
|
+
plugins:
|
107
|
+
- mkdocstrings:
|
108
|
+
handlers:
|
109
|
+
python:
|
110
|
+
options:
|
111
|
+
do_something: true
|
112
|
+
```
|
113
|
+
|
114
|
+
...and locally, overriding the global configuration:
|
115
|
+
|
116
|
+
```md title="docs/some_page.md"
|
117
|
+
::: package.module.class
|
118
|
+
options:
|
119
|
+
do_something: false
|
120
|
+
```
|
121
|
+
|
122
|
+
These options affect how the documentation is collected from sources and rendered.
|
123
|
+
See the following tables summarizing the options, and get more details for each option
|
124
|
+
in the following pages:
|
125
|
+
|
126
|
+
- [General options](configuration/general.md): various options that do not fit in the other categories
|
127
|
+
- [Headings options](configuration/headings.md): options related to headings and the table of contents
|
128
|
+
(or sidebar, depending on the theme used)
|
129
|
+
- [Members options](configuration/members.md): options related to filtering or ordering members
|
130
|
+
in the generated documentation
|
131
|
+
- [Docstrings options](configuration/docstrings.md): options related to docstrings (parsing and rendering)
|
132
|
+
- [Signature options](configuration/signatures.md): options related to signatures and type annotations
|
133
|
+
|
134
|
+
#### Options summary
|
135
|
+
|
136
|
+
::: mkdocstrings_handlers.matlab.handler.MatlabHandler.default_config
|
137
|
+
handler: python
|
138
|
+
options:
|
139
|
+
show_root_heading: false
|
140
|
+
show_root_toc_entry: false
|
Binary file
|
@@ -0,0 +1,226 @@
|
|
1
|
+
site_name: "mkdocstrings-matlab"
|
2
|
+
site_description: "A MATLAB handler for mkdocstrings."
|
3
|
+
# site_url: "https://mkdocstrings.github.io/python"
|
4
|
+
repo_url: "https://github.com/watermarkhu/mkdocstrings-matlab"
|
5
|
+
repo_name: "watermarkhu/mkdocstrings-matlabn"
|
6
|
+
site_dir: "site"
|
7
|
+
watch: [mkdocs.yml, README.md, src/mkdocstrings_handlers]
|
8
|
+
copyright: Copyright © 2024 Mark Shui Hu
|
9
|
+
edit_uri: edit/main/docs/
|
10
|
+
|
11
|
+
validation:
|
12
|
+
omitted_files: warn
|
13
|
+
absolute_links: warn
|
14
|
+
unrecognized_links: warn
|
15
|
+
|
16
|
+
nav:
|
17
|
+
- Home:
|
18
|
+
- Overview: index.md
|
19
|
+
# - Changelog: changelog.md
|
20
|
+
# - Credits: credits.md
|
21
|
+
- License: license.md
|
22
|
+
- Usage:
|
23
|
+
- usage/index.md
|
24
|
+
# - Configuration options:
|
25
|
+
# - General: usage/configuration/general.md
|
26
|
+
# - Headings: usage/configuration/headings.md
|
27
|
+
# - Members: usage/configuration/members.md
|
28
|
+
# - Docstrings: usage/configuration/docstrings.md
|
29
|
+
# - Signatures: usage/configuration/signatures.md
|
30
|
+
- Docstring styles:
|
31
|
+
- Google: usage/docstrings/google.md
|
32
|
+
- Numpy: usage/docstrings/numpy.md
|
33
|
+
- Sphinx: usage/docstrings/sphinx.md
|
34
|
+
# # defer to gen-files + literate-nav
|
35
|
+
# - API reference:
|
36
|
+
# - mkdocstrings-python: reference/
|
37
|
+
# - Development:
|
38
|
+
# - Contributing: contributing.md
|
39
|
+
# - Code of Conduct: code_of_conduct.md
|
40
|
+
# # - Coverage report: coverage.md
|
41
|
+
# - Insiders:
|
42
|
+
# - insiders/index.md
|
43
|
+
# - Getting started:
|
44
|
+
# - Installation: insiders/installation.md
|
45
|
+
# - Changelog: insiders/changelog.md
|
46
|
+
# - mkdocstrings: https://mkdocstrings.github.io/
|
47
|
+
|
48
|
+
theme:
|
49
|
+
name: material
|
50
|
+
logo: logo.png
|
51
|
+
features:
|
52
|
+
- announce.dismiss
|
53
|
+
- content.action.edit
|
54
|
+
- content.action.view
|
55
|
+
- content.code.annotate
|
56
|
+
- content.code.copy
|
57
|
+
- content.tooltips
|
58
|
+
- navigation.footer
|
59
|
+
- navigation.indexes
|
60
|
+
- navigation.sections
|
61
|
+
- navigation.tabs
|
62
|
+
- navigation.tabs.sticky
|
63
|
+
- navigation.top
|
64
|
+
- search.highlight
|
65
|
+
- search.suggest
|
66
|
+
- toc.follow
|
67
|
+
palette:
|
68
|
+
- media: "(prefers-color-scheme)"
|
69
|
+
toggle:
|
70
|
+
icon: material/brightness-auto
|
71
|
+
name: Switch to light mode
|
72
|
+
- media: "(prefers-color-scheme: light)"
|
73
|
+
scheme: matlab
|
74
|
+
toggle:
|
75
|
+
icon: material/weather-sunny
|
76
|
+
name: Switch to dark mode
|
77
|
+
- media: "(prefers-color-scheme: dark)"
|
78
|
+
scheme: slate
|
79
|
+
primary: black
|
80
|
+
accent: lime
|
81
|
+
toggle:
|
82
|
+
icon: material/weather-night
|
83
|
+
name: Switch to system preference
|
84
|
+
|
85
|
+
extra_css:
|
86
|
+
- stylesheets/extra.css
|
87
|
+
|
88
|
+
markdown_extensions:
|
89
|
+
- abbr
|
90
|
+
- attr_list
|
91
|
+
- admonition
|
92
|
+
|
93
|
+
- footnotes
|
94
|
+
- md_in_html
|
95
|
+
- pymdownx.blocks.admonition
|
96
|
+
- pymdownx.blocks.details
|
97
|
+
- pymdownx.blocks.tab:
|
98
|
+
alternate_style: true
|
99
|
+
slugify: !!python/object/apply:pymdownx.slugs.slugify
|
100
|
+
kwds:
|
101
|
+
case: lower
|
102
|
+
- pymdownx.emoji:
|
103
|
+
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
104
|
+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
105
|
+
- pymdownx.highlight:
|
106
|
+
pygments_lang_class: true
|
107
|
+
- pymdownx.magiclink
|
108
|
+
- pymdownx.snippets:
|
109
|
+
# auto_append: [docs/.glossary.md]
|
110
|
+
base_path: [!relative $config_dir]
|
111
|
+
check_paths: true
|
112
|
+
- pymdownx.superfences:
|
113
|
+
custom_fences:
|
114
|
+
- name: mermaid
|
115
|
+
class: mermaid
|
116
|
+
format: !!python/name:pymdownx.superfences.fence_code_format
|
117
|
+
- pymdownx.tabbed:
|
118
|
+
alternate_style: true
|
119
|
+
slugify: !!python/object/apply:pymdownx.slugs.slugify
|
120
|
+
kwds:
|
121
|
+
case: lower
|
122
|
+
- pymdownx.tasklist:
|
123
|
+
custom_checkbox: true
|
124
|
+
- toc:
|
125
|
+
permalink: "¤"
|
126
|
+
|
127
|
+
plugins:
|
128
|
+
- autorefs
|
129
|
+
- search
|
130
|
+
- markdown-exec
|
131
|
+
- callouts
|
132
|
+
# - gen-files:
|
133
|
+
# scripts:
|
134
|
+
# - scripts/gen_ref_nav.py
|
135
|
+
# - literate-nav:
|
136
|
+
# nav_file: SUMMARY.md
|
137
|
+
- mkdocs-material-matlab
|
138
|
+
- mkdocstrings:
|
139
|
+
default_handler: matlab
|
140
|
+
handlers:
|
141
|
+
matlab:
|
142
|
+
paths: ["docs/snippets"]
|
143
|
+
options:
|
144
|
+
show_inheritance_diagram: true
|
145
|
+
show_source: true
|
146
|
+
heading_level: 2
|
147
|
+
show_root_heading: true
|
148
|
+
show_root_toc_entry: false
|
149
|
+
show_root_full_path: true
|
150
|
+
show_root_members_full_path: false
|
151
|
+
show_object_full_path: false
|
152
|
+
show_category_heading: false
|
153
|
+
show_symbol_type_heading: true
|
154
|
+
show_symbol_type_toc: true
|
155
|
+
|
156
|
+
inherited_members: false
|
157
|
+
member_order: "bysource"
|
158
|
+
summary: true
|
159
|
+
show_labels: true
|
160
|
+
|
161
|
+
docstring_style: google
|
162
|
+
docstring_section_style: table
|
163
|
+
create_from_argument_blocks: true
|
164
|
+
merge_constructor_into_class: true
|
165
|
+
show_if_no_docstring: true
|
166
|
+
show_docstring_attributes": true
|
167
|
+
show_docstring_functions": true
|
168
|
+
show_docstring_classes": true
|
169
|
+
show_docstring_modules": true
|
170
|
+
show_docstring_description": true
|
171
|
+
show_docstring_examples": true
|
172
|
+
show_docstring_other_parameters": true
|
173
|
+
show_docstring_parameters": false
|
174
|
+
show_docstring_raises": true
|
175
|
+
show_docstring_receives": true
|
176
|
+
show_docstring_returns": false
|
177
|
+
show_docstring_warns": true
|
178
|
+
|
179
|
+
annotations_path: full
|
180
|
+
show_signature: true
|
181
|
+
show_signature_annotations: false
|
182
|
+
separate_signature: false
|
183
|
+
python:
|
184
|
+
paths: [src, docs/snippets]
|
185
|
+
import:
|
186
|
+
- https://docs.python.org/3/objects.inv
|
187
|
+
- https://mkdocstrings.github.io/objects.inv
|
188
|
+
- https://mkdocstrings.github.io/autorefs/objects.inv
|
189
|
+
- https://mkdocstrings.github.io/griffe/objects.inv
|
190
|
+
- https://python-markdown.github.io/objects.inv
|
191
|
+
options:
|
192
|
+
docstring_options:
|
193
|
+
ignore_init_summary: true
|
194
|
+
docstring_section_style: list
|
195
|
+
filters: ["!^_"]
|
196
|
+
heading_level: 1
|
197
|
+
inherited_members: true
|
198
|
+
merge_init_into_class: true
|
199
|
+
parameter_headings: true
|
200
|
+
preload_modules: [mkdocstrings]
|
201
|
+
relative_crossrefs: true
|
202
|
+
scoped_crossrefs: true
|
203
|
+
separate_signature: true
|
204
|
+
show_bases: false
|
205
|
+
show_inheritance_diagram: true
|
206
|
+
show_root_heading: true
|
207
|
+
show_root_full_path: false
|
208
|
+
show_signature_annotations: true
|
209
|
+
show_source: false
|
210
|
+
show_symbol_type_heading: true
|
211
|
+
show_symbol_type_toc: true
|
212
|
+
signature_crossrefs: true
|
213
|
+
summary: true
|
214
|
+
unwrap_annotated: true
|
215
|
+
|
216
|
+
- git-revision-date-localized:
|
217
|
+
enabled: !ENV [DEPLOY, false]
|
218
|
+
enable_creation_date: true
|
219
|
+
type: timeago
|
220
|
+
- minify:
|
221
|
+
minify_html: !ENV [DEPLOY, false]
|
222
|
+
- group:
|
223
|
+
enabled: !ENV [MATERIAL_INSIDERS, false]
|
224
|
+
plugins:
|
225
|
+
- typeset
|
226
|
+
|