mkdocstrings-matlab 0.5.0__tar.gz → 0.7.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.github/workflows/qualify.yaml +5 -4
  2. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.github/workflows/release.yaml +2 -2
  3. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/CHANGELOG.md +55 -0
  4. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/PKG-INFO +14 -8
  5. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/README.md +12 -6
  6. mkdocstrings_matlab-0.7.0/docs/api.md +16 -0
  7. mkdocstrings_matlab-0.7.0/docs/img/preview_dark.png +0 -0
  8. mkdocstrings_matlab-0.7.0/docs/img/preview_light.png +0 -0
  9. mkdocstrings_matlab-0.7.0/docs/index.md +32 -0
  10. mkdocstrings_matlab-0.7.0/docs/overrides/main.html +8 -0
  11. mkdocstrings_matlab-0.7.0/docs/overrides/partials/toc-item.html +20 -0
  12. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/stylesheets/extra.css +5 -0
  13. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/configuration/docstrings.md +4 -6
  14. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/configuration/general.md +4 -0
  15. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/configuration/headings.md +4 -0
  16. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/configuration/members.md +63 -2
  17. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/configuration/signatures.md +4 -0
  18. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/index.md +68 -17
  19. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/mkdocs.yml +13 -17
  20. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/pyproject.toml +2 -2
  21. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/__init__.py +2 -1
  22. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/collect.py +87 -33
  23. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/handler.py +7 -1
  24. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/models.py +31 -27
  25. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/treesitter.py +2 -1
  26. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/uv.lock +4 -4
  27. mkdocstrings_matlab-0.5.0/docs/index.md +0 -6
  28. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.github/CODEOWNERS +0 -0
  29. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.github/workflows/docs.yaml +0 -0
  30. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.gitignore +0 -0
  31. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.python-version +0 -0
  32. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.vscode/launch.json +0 -0
  33. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/.vscode/settings.json +0 -0
  34. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/LICENSE +0 -0
  35. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/changelog.md +0 -0
  36. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/credits.md +0 -0
  37. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/debug.py +0 -0
  38. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/license.md +0 -0
  39. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/logo.png +0 -0
  40. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/logo.svg +0 -0
  41. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/+submodule/Contents.m +0 -0
  42. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/+submodule/subfunction.m +0 -0
  43. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/aClass.m +0 -0
  44. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/do_something.m +0 -0
  45. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/module.md +0 -0
  46. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+module/readme.md +0 -0
  47. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mymembers/BaseClass.m +0 -0
  48. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mymembers/Contents.m +0 -0
  49. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mymembers/ThisClass.m +0 -0
  50. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mymembers/mymembers.md +0 -0
  51. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mymembers/this_function.m +0 -0
  52. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mynamespace/classA.m +0 -0
  53. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mynamespace/classB.m +0 -0
  54. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mynamespace/mynamespace.md +0 -0
  55. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mynamespace/readme.md +0 -0
  56. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+mynamespace/typed_function.m +0 -0
  57. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+undocumented/ClassWithoutDocstring.m +0 -0
  58. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+undocumented/function_with_docstring.m +0 -0
  59. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+undocumented/function_without_docstring.m +0 -0
  60. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/+undocumented/undocumented.md +0 -0
  61. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/Class.m +0 -0
  62. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/OtherClass.m +0 -0
  63. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/Thing.m +0 -0
  64. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/do_output.m +0 -0
  65. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/do_something.m +0 -0
  66. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/do_varargin.m +0 -0
  67. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/myClass.m +0 -0
  68. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/myParent.m +0 -0
  69. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/myfunction.m +0 -0
  70. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/snippets/print_hello.m +0 -0
  71. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/docstrings/google.md +0 -0
  72. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/docstrings/numpy.md +0 -0
  73. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/docs/usage/docstrings/sphinx.md +0 -0
  74. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/logo.svg +0 -0
  75. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/renovate.json +0 -0
  76. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/requirements.lock +0 -0
  77. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocs_material_matlab/__init__.py +0 -0
  78. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocs_material_matlab/css/style.css +0 -0
  79. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocs_material_matlab/mkdocs_material_matlab.py +0 -0
  80. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/enums.py +0 -0
  81. {mkdocstrings_matlab-0.5.0 → mkdocstrings_matlab-0.7.0}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
@@ -52,12 +52,13 @@ jobs:
52
52
  - name: Check next semantic version
53
53
  run: |
54
54
  uv sync --dev
55
- OUTPUT=$(uv run semantic-release --noop version --print)
56
- echo "$OUTPUT"
57
- if [ -z "$OUTPUT" ]; then
55
+ NEXT=$(uv run semantic-release --noop version --print-tag)
56
+ CURRENT=$(uv run semantic-release --noop version --print-last-released-tag)
57
+ echo "$NEXT"
58
+ if [ "$NEXT" = "$CURRENT" ]; then
58
59
  echo "comment=No release will be made." >> $GITHUB_ENV
59
60
  else
60
- echo "comment=The next release will be v$OUTPUT" >> $GITHUB_ENV
61
+ echo "comment=The next release will be $NEXT" >> $GITHUB_ENV
61
62
  fi
62
63
 
63
64
  - name: Find Comment
@@ -55,7 +55,7 @@ jobs:
55
55
 
56
56
  - name: Update version and changelogs
57
57
  id: semantic-release
58
- uses: python-semantic-release/python-semantic-release@v9.15.2
58
+ uses: python-semantic-release/python-semantic-release@v9.16.0
59
59
  with:
60
60
  build: false
61
61
  changelog: true
@@ -81,7 +81,7 @@ jobs:
81
81
  - name: Publish package distributions to GitHub Releases
82
82
  if: steps.semantic-release.outputs.released == 'true'
83
83
  id: publish-dist
84
- uses: python-semantic-release/publish-action@v9.15.2
84
+ uses: python-semantic-release/publish-action@v9.16.0
85
85
  with:
86
86
  github_token: ${{ steps.app-token.outputs.token }}
87
87
  tag: ${{ steps.semantic-release.outputs.tag }}
@@ -1,6 +1,61 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v0.7.0 (2025-01-12)
5
+
6
+ ### Chores
7
+
8
+ - **deps**: Update python-semantic-release/publish-action action to v9.16.0
9
+ ([#38](https://github.com/watermarkhu/mkdocstrings-matlab/pull/38),
10
+ [`fc404c4`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/fc404c46af2830eaba288beb8635092174a21b3b))
11
+
12
+ Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
13
+
14
+ - **deps**: Update python-semantic-release/python-semantic-release action to v9.16.0
15
+ ([#39](https://github.com/watermarkhu/mkdocstrings-matlab/pull/39),
16
+ [`56e8f87`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/56e8f877d357deeaee3eb6cf31bee2b064ee2438))
17
+
18
+ Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
19
+
20
+ Co-authored-by: Mark Shui Hu <watermarkhu@gmail.com>
21
+
22
+ ### Features
23
+
24
+ - Folder modules ([#37](https://github.com/watermarkhu/mkdocstrings-matlab/pull/37),
25
+ [`81b551d`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/81b551d794804212c18645926d58121cf556c79d))
26
+
27
+ * remove redundant root object
28
+
29
+ * feat: document folders
30
+
31
+ * uv format
32
+
33
+ * docs: update readme
34
+
35
+
36
+ ## v0.6.0 (2025-01-04)
37
+
38
+ ### Documentation
39
+
40
+ - Add api documentation ([#33](https://github.com/watermarkhu/mkdocstrings-matlab/pull/33),
41
+ [`62632e8`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/62632e8c5447125e5d2bfb58202d0fcd0de51ab9))
42
+
43
+ - Add preview to docs index ([#32](https://github.com/watermarkhu/mkdocstrings-matlab/pull/32),
44
+ [`9289b11`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/9289b118c7ca78bd3372a9559d140fa76ca89977))
45
+
46
+ - Better docs ([#34](https://github.com/watermarkhu/mkdocstrings-matlab/pull/34),
47
+ [`bf97320`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/bf973203343098a139afe571d37daa35b3b6359c))
48
+
49
+ ### Features
50
+
51
+ - Show subnamespaces ([#36](https://github.com/watermarkhu/mkdocstrings-matlab/pull/36),
52
+ [`509e793`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/509e7930f52f5656c9de1089daa4c0354ea170be))
53
+
54
+ * add option show_subnamespaces
55
+
56
+ * forward config
57
+
58
+
4
59
  ## v0.5.0 (2025-01-03)
5
60
 
6
61
  ### Features
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-matlab
3
- Version: 0.5.0
3
+ Version: 0.7.0
4
4
  Summary: A MATLAB handler for mkdocstrings
5
5
  Author-email: Mark Hu <watermarkhu@gmail.com>
6
- License: ISC
6
+ License: MIT
7
7
  License-File: LICENSE
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Intended Audience :: Developers
@@ -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>
@@ -38,9 +40,8 @@ Description-Content-Type: text/markdown
38
40
  [![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://watermarkhu.nl/mkdocstrings-matlab)
39
41
  [![pypi version](https://img.shields.io/pypi/v/mkdocstrings-matlab.svg)](https://pypi.org/project/mkdocstrings-matlab/)
40
42
 
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/).
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. The AST information 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
@@ -60,10 +64,10 @@ dependencies = [
60
64
 
61
65
  - **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
66
  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.
67
+ It is even able to automatically add cross-references to other objects from your API.
64
68
 
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.
69
+ - **Recursive documentation of MATLAB [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html) and folders:**
70
+ just add `+` to the identifer for namespaces or the relative path for folder, and you get documentation for the entire directory. You don't need to inject documentation for each class, function, and script. Additionaly, the directory documentation will be either extracted from the `Contents.m` or the `readme.md` file at the root of the namespace or folder.
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] -->
@@ -1,3 +1,5 @@
1
+ <!-- --8<-- [start:header] -->
2
+
1
3
  <h1 align="center">mkdocstrings-matlab</h1>
2
4
 
3
5
  <p align="center">A MATLAB handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>
@@ -8,9 +10,8 @@
8
10
  [![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://watermarkhu.nl/mkdocstrings-matlab)
9
11
  [![pypi version](https://img.shields.io/pypi/v/mkdocstrings-matlab.svg)](https://pypi.org/project/mkdocstrings-matlab/)
10
12
 
11
- 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/).
13
+ 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. The AST information are imported as custom [Griffe](https://mkdocstrings.github.io/griffe/) objects and mocked for the [python handler](https://mkdocstrings.github.io/python/).
12
14
 
13
- ## Installation
14
15
 
15
16
  You can install this handler by specifying it as a dependency:
16
17
 
@@ -23,6 +24,9 @@ dependencies = [
23
24
  ]
24
25
  ```
25
26
 
27
+ <!-- --8<-- [end:header] -->
28
+ <!-- --8<-- [start:footer] -->
29
+
26
30
  ## Features
27
31
 
28
32
  - **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
@@ -30,10 +34,10 @@ dependencies = [
30
34
 
31
35
  - **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)
32
36
  blocks to display input and output argument types and default values.
33
- It is even able to automatically add cross-references o other objects from your API.
37
+ It is even able to automatically add cross-references to other objects from your API.
34
38
 
35
- - **Recursive documentation of MATLAB [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html):**
36
- 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.
39
+ - **Recursive documentation of MATLAB [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html) and folders:**
40
+ just add `+` to the identifer for namespaces or the relative path for folder, and you get documentation for the entire directory. You don't need to inject documentation for each class, function, and script. Additionaly, the directory documentation will be either extracted from the `Contents.m` or the `readme.md` file at the root of the namespace or folder.
37
41
 
38
42
  - **Support for documented properties:** properties definitions followed by a docstring will be recognized in classes.
39
43
 
@@ -49,4 +53,6 @@ dependencies = [
49
53
  you can reference other objects within your docstrings, with the classic Markdown syntax:
50
54
  `[this object][namespace.subnamespace.object]` or directly with `[namespace.subnamespace.object][]`
51
55
 
52
- - **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
56
+ - **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code of the MATLAB object.
57
+
58
+ <!-- --8<-- [end:footer] -->
@@ -0,0 +1,16 @@
1
+
2
+ !!! note
3
+
4
+ Due to that for the documentation of mkdocstrings-matlab both the MATLAB and the Python handler are loaded, the symbols shown for Python objects will be incorrect (see [Configuration](usage/index.md#configuration)).
5
+
6
+ ::: mkdocstrings_handlers.matlab
7
+ handler: python
8
+ options:
9
+ show_root_toc_entry: true
10
+ show_submodules: true
11
+ heading_level: 1
12
+ members:
13
+ - handler
14
+ - collect
15
+ - models
16
+ - treesitter
@@ -0,0 +1,32 @@
1
+ ---
2
+ hide:
3
+ - feedback
4
+ ---
5
+
6
+ --8<-- "README.md:header"
7
+
8
+ ## Preview
9
+
10
+ Let's us quickly see how auto-documentation works with mkdocstrings-matlab:
11
+
12
+ ```matlab title="Function making use of Argument Validation in namespace +mynamespace"
13
+ --8<-- "docs/snippets/+mynamespace/typed_function.m"
14
+ ```
15
+
16
+ <div class="result" markdown>
17
+
18
+ ![Image title](img/preview_dark.png#only-dark){ align=left width=400 }
19
+
20
+ ![Image title](img/preview_light.png#only-light){ align=left width=400 }
21
+
22
+ Given the function above, the rendered documentation here is created from the following markdown document file,
23
+
24
+ ```markdown title="docs/api.md"
25
+ ::: mynamespace.typed_function
26
+ options:
27
+ parse_arguments: true
28
+ ```
29
+
30
+ </div>
31
+
32
+ --8<-- "README.md:footer"
@@ -0,0 +1,8 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block outdated %}
4
+ You're not viewing the latest version.
5
+ <a href="{{ '../' ~ base_url }}">
6
+ <strong>Click here to go to latest.</strong>
7
+ </a>
8
+ {% endblock %}
@@ -0,0 +1,20 @@
1
+ <li class="md-nav__item">
2
+ <a href="{{ toc_item.url }}" class="md-nav__link">
3
+ <span class="md-ellipsis">
4
+ {{ toc_item.title }}
5
+ </span>
6
+ </a>
7
+
8
+ <!-- Table of contents list -->
9
+ {% if toc_item.children %}
10
+ <nav class="md-nav" aria-label="{{ toc_item.title | striptags }}">
11
+ <ul class="md-nav__list">
12
+ {% for toc_item in toc_item.children %}
13
+ {% if not page.meta.toc_depth or toc_item.level <= page.meta.toc_depth %}
14
+ {% include "partials/toc-item.html" %}
15
+ {% endif %}
16
+ {% endfor %}
17
+ </ul>
18
+ </nav>
19
+ {% endif %}
20
+ </li>
@@ -3,6 +3,11 @@
3
3
  --md-primary-fg-color--dark: #002f5b;
4
4
  }
5
5
 
6
+ [data-md-color-scheme="matlab"] img[src$="#only-dark"],
7
+ [data-md-color-scheme="matlab"] img[src$="#gh-dark-mode-only"] {
8
+ display: none; /* Hide dark images in light mode */
9
+ }
10
+
6
11
  /* Custom admonition: preview */
7
12
  :root {
8
13
  --md-admonition-icon--preview: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 12a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"/><path d="M12 3.5c3.432 0 6.124 1.534 8.054 3.241 1.926 1.703 3.132 3.61 3.616 4.46a1.6 1.6 0 0 1 0 1.598c-.484.85-1.69 2.757-3.616 4.461-1.929 1.706-4.622 3.24-8.054 3.24-3.432 0-6.124-1.534-8.054-3.24C2.02 15.558.814 13.65.33 12.8a1.6 1.6 0 0 1 0-1.598c.484-.85 1.69-2.757 3.616-4.462C5.875 5.034 8.568 3.5 12 3.5ZM1.633 11.945a.115.115 0 0 0-.017.055c.001.02.006.039.017.056.441.774 1.551 2.527 3.307 4.08C6.691 17.685 9.045 19 12 19c2.955 0 5.31-1.315 7.06-2.864 1.756-1.553 2.866-3.306 3.307-4.08a.111.111 0 0 0 .017-.056.111.111 0 0 0-.017-.056c-.441-.773-1.551-2.527-3.307-4.08C17.309 6.315 14.955 5 12 5 9.045 5 6.69 6.314 4.94 7.865c-1.756 1.552-2.866 3.306-3.307 4.08Z"/></svg>');
@@ -1,3 +1,7 @@
1
+ ---
2
+ toc_depth: 2
3
+ ---
4
+
1
5
  # Docstrings options
2
6
 
3
7
  ## `docstring_style`
@@ -607,12 +611,6 @@ plugins:
607
611
  show_docstring_namespaces: false
608
612
  ```
609
613
 
610
- ```tree
611
- module/
612
- __init__.py
613
- submodule.py
614
- ```
615
-
616
614
  --8<-- "docs/snippets/+module/module.md"
617
615
 
618
616
  ???+ preview
@@ -1,3 +1,7 @@
1
+ ---
2
+ toc_depth: 2
3
+ ---
4
+
1
5
  # General options
2
6
 
3
7
  ## `show_bases`
@@ -1,3 +1,7 @@
1
+ ---
2
+ toc_depth: 2
3
+ ---
4
+
1
5
  # Headings options
2
6
 
3
7
  ## `heading_level`
@@ -1,3 +1,7 @@
1
+ ---
2
+ toc_depth: 2
3
+ ---
4
+
1
5
  # Members options
2
6
 
3
7
  ## `members`
@@ -545,12 +549,69 @@ plugins:
545
549
  ```markdown
546
550
  ::: +mymembers
547
551
  options:
548
- group_by_category: False
552
+ group_by_category: false
549
553
  ```
550
554
 
551
555
  ::: +mymembers
552
556
  options:
553
- group_by_category: False
557
+ group_by_category: false
558
+
559
+ ## `show_subnamespaces`
560
+
561
+ - **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }**
562
+
563
+ When rendering a namespace, show its subnamespaces recursively.
564
+
565
+ This is false by default, because most of the time we render only one namespace per page, and when rendering a full package (a tree of namespaces and their members) on a single page, we quickly run out of [heading levels][heading_level].
566
+
567
+ ```yaml title="in mkdocs.yml (global configuration)"
568
+ plugins:
569
+ - mkdocstrings:
570
+ handlers:
571
+ matlab:
572
+ options:
573
+ show_subnamespaces: true
574
+ ```
575
+
576
+ ```md title="or in docs/some_page.md (local configuration)"
577
+ ::: +matlab_namespace
578
+ options:
579
+ show_subnamespaces: false
580
+ ```
581
+
582
+ --8<-- "docs/snippets/+module/module.md"
583
+
584
+ ???+ preview
585
+
586
+ === "With show subnamespaces"
587
+
588
+ ```markdown
589
+ ::: +module
590
+ options:
591
+ show_subnamespaces: true
592
+ ```
593
+
594
+ ::: +module
595
+ options:
596
+ show_subnamespaces: true
597
+ show_docstring_namespaces: false
598
+ show_docstring_classes: false
599
+ show_docstring_functions: false
600
+
601
+ === "Without show subnamespaces"
602
+
603
+ ```markdown
604
+ ::: +module
605
+ options:
606
+ show_subnamespaces: false
607
+ ```
608
+
609
+ ::: +module
610
+ options:
611
+ show_subnamespaces: false
612
+ show_docstring_namespaces: false
613
+ show_docstring_classes: false
614
+ show_docstring_functions: false
554
615
 
555
616
  ## `summary`
556
617
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ toc_depth: 2
3
+ ---
4
+
1
5
  # Signatures options
2
6
 
3
7
  ## `show_signature`
@@ -9,10 +9,12 @@ You can install this handler by specifying it as a dependency:
9
9
  # adapt to your dependencies manager
10
10
  [project]
11
11
  dependencies = [
12
- "mkdocstrings-matlab>=0.3",
12
+ "mkdocstrings-matlab>=0.X.Y",
13
13
  ]
14
14
  ```
15
15
 
16
+ ## Configuration
17
+
16
18
  For *mkdocstrings* the default will be the Python handler. You can change the default handler,
17
19
  or explicitely set the MATLAB handler as default by defining the `default_handler`
18
20
  configuration option of `mkdocstrings` in `mkdocs.yml`:
@@ -21,8 +23,25 @@ configuration option of `mkdocstrings` in `mkdocs.yml`:
21
23
  plugins:
22
24
  - mkdocstrings:
23
25
  default_handler: matlab
26
+ matlab:
27
+ ... # the MATLAB handler configuration
24
28
  ```
25
29
 
30
+ When using the [material](https://squidfunk.github.io/mkdocs-material) theme, it is best to also configure the `mkdocs_material_matlab` plugin. This additional plugin, which is installed together with mkdocstrings-matlab, will overrule the symbols shown with [`show_symbol_type_heading`][] and [`show_symbol_type_toc`][] to show the correct symbols as per MATLAB nomenclature.
31
+
32
+ ```yaml title="mkdocs.yml"
33
+ plugins:
34
+ - mkdocs_material_matlab
35
+ - mkdocstrings:
36
+ default_handler: matlab
37
+ matlab:
38
+ ... # the MATLAB handler configuration
39
+ ```
40
+
41
+ ??? warning "I want to document both MATLAB and Python"
42
+
43
+ The `mkdocs_material_matlab` plugin will also change the symbols for the Python handler. This means that Python modules will not be tagged with symbol `mod` but `name` (namespace), and attributes are not tagged with symbol `attr` but `prop` (property).
44
+
26
45
  ## Injecting documentation
27
46
 
28
47
  With the MATLAB handler installed and configured as default handler, you can inject documentation for a module, class, function, or any other MATLAB object with *mkdocstrings*' [autodoc syntax], in your Markdown pages:
@@ -37,16 +56,17 @@ If another handler was defined as default handler, you can explicitely ask for t
37
56
  ::: path.to.object
38
57
  handler: matlab
39
58
  ```
59
+ ### Namespaces
40
60
 
41
61
  Entire [namespaces](https://mathworks.com/help/matlab/matlab_oop/namespaces.html) can be fully documented by prefixing the `+` character to the namespace that is to be documented. E.g. the following namespace
42
62
 
43
- ```
63
+ ```tree
44
64
  +mynamespace
45
- |- Contents.m
46
- |- readme.md
47
- |- myclass.m
48
- |- +subnamespace
49
- | |- mfunction.m
65
+ Contents.m
66
+ readme.md
67
+ myclass.m
68
+ +subnamespace
69
+ mfunction.m
50
70
  ```
51
71
 
52
72
  is documented with:
@@ -55,8 +75,7 @@ is documented with:
55
75
  ::: +mynamespace
56
76
  ```
57
77
 
58
- The docstring of the namespace is taken from either the [`Contents.m`](https://mathworks.com/help/matlab/matlab_prog/create-a-help-summary-contents-m.html) or a `readme.md` that resides at the root level of the namespace, with `Contents.m` taking precedence over `readme.md`.
59
-
78
+ The docstring of the namespace is taken from either the [`Contents.m`](https://mathworks.com/help/matlab/matlab_prog/create-a-help-summary-contents-m.html) or a `readme.md` that resides at the root level of the namespace, with `Contents.m` taking precedence over `readme.md`.
60
79
 
61
80
  Documenting a nested namespace requires only a single prefixed `+` at the start of the fully resolved path, e.g.
62
81
 
@@ -64,18 +83,50 @@ Documenting a nested namespace requires only a single prefixed `+` at the start
64
83
  ::: +mynamespace.subnamespace
65
84
  ```
66
85
 
67
- ## Configuration
86
+ ### Folders
87
+
88
+ Similarly to namepaces, all contents of a folder can be fully documented by specifying the relative path of a folder with respect to the `mkdocs.yml` config file. E.g. the following repository
89
+
90
+ ```tree
91
+ src
92
+ module
93
+ myfunction.m
94
+ myClass.m
95
+ submodule
96
+ myfunction.m
97
+ +mynamespace
98
+ namespacefunction.m
99
+ docs
100
+ index.md
101
+ mkdocs.yml
102
+ ```
68
103
 
69
- When installed, the MATLAB handler becomes the default *mkdocstrings* handler. You can configure it in `mkdocs.yml`:
104
+ is documented with:
70
105
 
71
- ```yaml title="mkdocs.yml"
72
- plugins:
73
- - mkdocstrings:
74
- handlers:
75
- matlab:
76
- ... # the MATLAB handler configuration
106
+ ```markdown
107
+ ::: src/module
77
108
  ```
78
109
 
110
+ In the case above the function `module/submodule/myfunction.m` overshadows the function `module/myfunction.m` on the MATLAB path. This means that in the global namespace myfunction will always call `module/submodule/myfunction.m`, which is the function to be documented by `::: myfunction`.
111
+
112
+ While this kind of behavior is strictly recommended against, mkdocstrings-matlab does support documenting the shadowed function by using its path. The file extension is now stricty required.
113
+
114
+ ```markdown
115
+ ::: src/module/myfunction.m
116
+ ```
117
+
118
+ !!! tip
119
+
120
+ A folder identifier must strictly contain the `/` character. For a folder `foo` that is in the same directory with `mkdocs.yml`, use `::: ./foo`.
121
+
122
+ !!! tip
123
+
124
+ If the `mkdocs.yml` lives inside of a subdirectly that does not contain source code, use relative paths e.g. `../src/module`.
125
+
126
+ !!! tip
127
+
128
+ Sub-selecting folder members are possible with the [members](./configuration/members.md) options.
129
+
79
130
  ### Global-only options
80
131
 
81
132
  Some options are **global only**, and go directly under the handler's name.
@@ -1,9 +1,8 @@
1
1
  site_name: "mkdocstrings-matlab"
2
2
  site_description: "A MATLAB handler for mkdocstrings."
3
- # site_url: "https://mkdocstrings.github.io/python"
3
+ site_url: "https://watermarkhu.nl/mkdocstrings-matlab"
4
4
  repo_url: "https://github.com/watermarkhu/mkdocstrings-matlab"
5
- repo_name: "watermarkhu/mkdocstrings-matlabn"
6
- site_dir: "site"
5
+ repo_name: "watermarkhu/mkdocstrings-matlab"
7
6
  watch: [mkdocs.yml, README.md, src/mkdocstrings_handlers]
8
7
  copyright: Copyright &copy; 2024 Mark Shui Hu
9
8
  edit_uri: edit/main/docs/
@@ -32,8 +31,9 @@ nav:
32
31
  - Numpy: usage/docstrings/numpy.md
33
32
  - Sphinx: usage/docstrings/sphinx.md
34
33
  # # defer to gen-files + literate-nav
35
- # - API reference:
36
- # - mkdocstrings-python: reference/
34
+ - API reference:
35
+ - mkdocstrings_handlers:
36
+ - matlab: api.md
37
37
  # - Development:
38
38
  # - Contributing: contributing.md
39
39
  # - Code of Conduct: code_of_conduct.md
@@ -48,6 +48,7 @@ nav:
48
48
  theme:
49
49
  name: material
50
50
  logo: logo.svg
51
+ custom_dir: docs/overrides
51
52
  features:
52
53
  - announce.dismiss
53
54
  - content.action.edit
@@ -123,17 +124,13 @@ markdown_extensions:
123
124
  custom_checkbox: true
124
125
  - toc:
125
126
  permalink: "¤"
126
- toc_depth: 2
127
+ toc_depth: 3
128
+
127
129
  plugins:
128
130
  - autorefs
129
131
  - search
130
132
  - markdown-exec
131
133
  - callouts
132
- # - gen-files:
133
- # scripts:
134
- # - scripts/gen_ref_nav.py
135
- # - literate-nav:
136
- # nav_file: SUMMARY.md
137
134
  - mkdocs-material-matlab
138
135
  - mkdocstrings:
139
136
  default_handler: matlab
@@ -177,13 +174,9 @@ plugins:
177
174
  show_signature_annotations: false
178
175
  separate_signature: false
179
176
  python:
180
- paths: [src, docs/snippets]
177
+ paths: [src]
181
178
  import:
182
179
  - https://docs.python.org/3/objects.inv
183
- - https://mkdocstrings.github.io/objects.inv
184
- - https://mkdocstrings.github.io/autorefs/objects.inv
185
- - https://mkdocstrings.github.io/griffe/objects.inv
186
- - https://python-markdown.github.io/objects.inv
187
180
  options:
188
181
  docstring_options:
189
182
  ignore_init_summary: true
@@ -193,7 +186,6 @@ plugins:
193
186
  inherited_members: true
194
187
  merge_init_into_class: true
195
188
  parameter_headings: true
196
- preload_modules: [mkdocstrings]
197
189
  relative_crossrefs: true
198
190
  scoped_crossrefs: true
199
191
  separate_signature: true
@@ -220,3 +212,7 @@ plugins:
220
212
  plugins:
221
213
  - typeset
222
214
 
215
+ extra:
216
+ version:
217
+ provider: mike
218
+ alias: true
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "mkdocstrings-matlab"
3
- version = "0.5.0"
3
+ version = "0.7.0"
4
4
  description = "A MATLAB handler for mkdocstrings"
5
5
  authors = [
6
6
  { name = "Mark Hu", email = "watermarkhu@gmail.com" }
7
7
  ]
8
- license = { text = "ISC" }
8
+ license = { text = "MIT" }
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  dependencies = [