mkdocstrings-matlab 0.7.0__tar.gz → 0.8.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.github/workflows/qualify.yaml +14 -5
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.github/workflows/release.yaml +42 -3
- mkdocstrings_matlab-0.8.1/.github/workflows/update-templates.yaml +48 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.gitignore +1 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/CHANGELOG.md +17 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/PKG-INFO +4 -4
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/api.md +0 -4
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/headings.md +21 -10
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/members.md +0 -5
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/index.md +0 -7
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/mkdocs.yml +4 -8
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/pyproject.toml +6 -12
- mkdocstrings_matlab-0.8.1/scripts/copy_and_update_python_templates.py +126 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/collect.py +1 -1
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/handler.py +29 -7
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/models.py +34 -4
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/children.html.jinja +172 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/docstring/namespaces.html.jinja +86 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/docstring/properties.html.jinja +109 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/folder.html.jinja +121 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/namespace.html.jinja +121 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/property.html.jinja +120 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/style.css +26 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja +21 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja +21 -0
- mkdocstrings_matlab-0.8.1/src/mkdocstrings_handlers/matlab/templates/material/summary.html.jinja +26 -0
- mkdocstrings_matlab-0.7.0/src/mkdocs_material_matlab/__init__.py +0 -4
- mkdocstrings_matlab-0.7.0/src/mkdocs_material_matlab/css/style.css +0 -7
- mkdocstrings_matlab-0.7.0/src/mkdocs_material_matlab/mkdocs_material_matlab.py +0 -20
- mkdocstrings_matlab-0.7.0/uv.lock +0 -2015
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.github/CODEOWNERS +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.github/workflows/docs.yaml +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.python-version +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.vscode/launch.json +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/.vscode/settings.json +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/LICENSE +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/README.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/changelog.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/credits.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/debug.py +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/img/preview_dark.png +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/img/preview_light.png +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/index.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/license.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/logo.png +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/logo.svg +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/overrides/main.html +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/overrides/partials/toc-item.html +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/+submodule/Contents.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/+submodule/subfunction.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/aClass.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/do_something.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/module.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+module/readme.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mymembers/BaseClass.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mymembers/Contents.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mymembers/ThisClass.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mymembers/mymembers.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mymembers/this_function.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mynamespace/classA.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mynamespace/classB.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mynamespace/mynamespace.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mynamespace/readme.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+mynamespace/typed_function.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+undocumented/ClassWithoutDocstring.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+undocumented/function_with_docstring.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+undocumented/function_without_docstring.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/+undocumented/undocumented.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/Class.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/OtherClass.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/Thing.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/do_output.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/do_something.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/do_varargin.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/myClass.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/myParent.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/myfunction.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/snippets/print_hello.m +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/stylesheets/extra.css +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/docstrings.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/general.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/signatures.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/docstrings/google.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/docstrings/numpy.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/docstrings/sphinx.md +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/logo.svg +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/renovate.json +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/requirements.lock +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/__init__.py +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/enums.py +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
- {mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/treesitter.py +0 -0
@@ -10,6 +10,7 @@ on:
|
|
10
10
|
- synchronize
|
11
11
|
- labeled
|
12
12
|
- unlabeled
|
13
|
+
- edited
|
13
14
|
branches:
|
14
15
|
- main
|
15
16
|
|
@@ -22,12 +23,15 @@ jobs:
|
|
22
23
|
if: github.event.pull_request.draft == false
|
23
24
|
name: Test deploy documentation
|
24
25
|
uses: ./.github/workflows/docs.yaml
|
26
|
+
concurrency:
|
27
|
+
group: gh-pages
|
28
|
+
cancel-in-progress: false
|
25
29
|
secrets: inherit
|
26
30
|
with:
|
27
|
-
version:
|
31
|
+
version: ${{ format('pr-{0}', github.head_ref) || 'test' }}
|
28
32
|
alias: ""
|
29
33
|
set-default: false
|
30
|
-
push:
|
34
|
+
push: true
|
31
35
|
|
32
36
|
check-semantic-version:
|
33
37
|
name: Check semantic version
|
@@ -38,11 +42,16 @@ jobs:
|
|
38
42
|
uses: actions/checkout@v4
|
39
43
|
with:
|
40
44
|
fetch-depth: 0
|
41
|
-
ref:
|
45
|
+
ref: main
|
42
46
|
|
43
|
-
- name:
|
47
|
+
- name: Create fake commit with PR title
|
44
48
|
run: |
|
45
|
-
git
|
49
|
+
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
|
50
|
+
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
|
51
|
+
git switch -c temp-${{ github.run_id }}
|
52
|
+
touch temp.txt
|
53
|
+
git add temp.txt
|
54
|
+
git commit -m "${{ github.event.pull_request.title }}"
|
46
55
|
|
47
56
|
- name: Install the latest version of uv
|
48
57
|
uses: astral-sh/setup-uv@v5
|
@@ -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.16.
|
58
|
+
uses: python-semantic-release/python-semantic-release@v9.16.1
|
59
59
|
with:
|
60
60
|
build: false
|
61
61
|
changelog: true
|
@@ -81,14 +81,53 @@ 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.16.
|
84
|
+
uses: python-semantic-release/publish-action@v9.16.1
|
85
85
|
with:
|
86
86
|
github_token: ${{ steps.app-token.outputs.token }}
|
87
87
|
tag: ${{ steps.semantic-release.outputs.tag }}
|
88
88
|
|
89
|
+
delete-test-document:
|
90
|
+
name: Delete test documentation
|
91
|
+
needs: publish
|
92
|
+
runs-on: ubuntu-latest
|
93
|
+
concurrency:
|
94
|
+
group: gh-pages
|
95
|
+
cancel-in-progress: false
|
96
|
+
|
97
|
+
steps:
|
98
|
+
- name: checkout repository
|
99
|
+
uses: actions/checkout@v4
|
100
|
+
with:
|
101
|
+
fetch-depth: 0 # Required to push to the documentation branch
|
102
|
+
|
103
|
+
- name: Install the latest version of uv
|
104
|
+
uses: astral-sh/setup-uv@v5
|
105
|
+
with:
|
106
|
+
version: "latest"
|
107
|
+
|
108
|
+
- name: Sync dependencies
|
109
|
+
run: |
|
110
|
+
uv sync --no-dev --group docs
|
111
|
+
|
112
|
+
- name: Configure Git Credentials
|
113
|
+
run: |
|
114
|
+
git config --global user.name github-actions[bot]
|
115
|
+
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
116
|
+
|
117
|
+
- name: delete testing documentation
|
118
|
+
continue-on-error: true
|
119
|
+
env:
|
120
|
+
VERSION: ${{ format('pr-{0}', github.head_ref) || 'test' }}
|
121
|
+
run: >
|
122
|
+
uv run mike delete
|
123
|
+
--push --ignore-remote-status
|
124
|
+
--config-file mkdocs.yml
|
125
|
+
--branch gh-pages
|
126
|
+
$VERSION
|
127
|
+
|
89
128
|
mkdocs:
|
90
129
|
name: Deploy documentation
|
91
|
-
needs: [publish]
|
130
|
+
needs: [publish, delete-test-document]
|
92
131
|
uses: ./.github/workflows/docs.yaml
|
93
132
|
secrets: inherit
|
94
133
|
with:
|
@@ -0,0 +1,48 @@
|
|
1
|
+
name: Update template copies
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types:
|
6
|
+
- opened
|
7
|
+
- synchronize
|
8
|
+
- reopened
|
9
|
+
- edited
|
10
|
+
|
11
|
+
permissions:
|
12
|
+
contents: write
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
update-templates:
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
if: contains(github.event.pull_request.title, 'mkdocstrings-python')
|
18
|
+
|
19
|
+
steps:
|
20
|
+
|
21
|
+
- name: Checkout repository
|
22
|
+
uses: actions/checkout@v4
|
23
|
+
with:
|
24
|
+
fetch-depth: 0
|
25
|
+
ref: ${{ github.sha }}
|
26
|
+
|
27
|
+
- name: Force correct release branch on workflow sha
|
28
|
+
run: |
|
29
|
+
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
|
30
|
+
|
31
|
+
- name: Install the latest version of uv
|
32
|
+
uses: astral-sh/setup-uv@v5
|
33
|
+
with:
|
34
|
+
version: "latest"
|
35
|
+
|
36
|
+
- name: Run script
|
37
|
+
run: |
|
38
|
+
uv sync
|
39
|
+
uv run python scripts/copy_and_update_python_templates.py
|
40
|
+
|
41
|
+
- name: Commit changes
|
42
|
+
continue-on-error: true # Ignore if there are no changes
|
43
|
+
run: |
|
44
|
+
git config --global user.name 'github-actions[bot]'
|
45
|
+
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
46
|
+
git add .
|
47
|
+
git commit -m "Update templates"
|
48
|
+
git push origin ${{ github.ref_name }}
|
@@ -1,6 +1,23 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
|
4
|
+
## v0.8.1 (2025-01-14)
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
- Names of folder and namespace entities
|
9
|
+
([#49](https://github.com/watermarkhu/mkdocstrings-matlab/pull/49),
|
10
|
+
[`248d389`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/248d3893b9fad1b1e9818c7b48959ca01c6f9cdf))
|
11
|
+
|
12
|
+
|
13
|
+
## v0.8.0 (2025-01-13)
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
- Update dependencies ([#46](https://github.com/watermarkhu/mkdocstrings-matlab/pull/46),
|
18
|
+
[`03229a2`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/03229a2e7ef8ee46dc680b676a796ae38c6617b7))
|
19
|
+
|
20
|
+
|
4
21
|
## v0.7.0 (2025-01-12)
|
5
22
|
|
6
23
|
### Chores
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mkdocstrings-matlab
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.8.1
|
4
4
|
Summary: A MATLAB handler for mkdocstrings
|
5
5
|
Author-email: Mark Hu <watermarkhu@gmail.com>
|
6
6
|
License: MIT
|
@@ -21,11 +21,11 @@ Classifier: Topic :: Software Development :: Documentation
|
|
21
21
|
Classifier: Topic :: Utilities
|
22
22
|
Classifier: Typing :: Typed
|
23
23
|
Requires-Python: >=3.10
|
24
|
-
Requires-Dist: charset-normalizer
|
24
|
+
Requires-Dist: charset-normalizer==3.4.1
|
25
25
|
Requires-Dist: mkdocstrings-python==1.13.0
|
26
26
|
Requires-Dist: mkdocstrings==0.27.0
|
27
|
-
Requires-Dist: tree-sitter-matlab
|
28
|
-
Requires-Dist: tree-sitter
|
27
|
+
Requires-Dist: tree-sitter-matlab==1.0.3
|
28
|
+
Requires-Dist: tree-sitter==0.23.2
|
29
29
|
Description-Content-Type: text/markdown
|
30
30
|
|
31
31
|
<!-- --8<-- [start:header] -->
|
@@ -1,8 +1,4 @@
|
|
1
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
2
|
::: mkdocstrings_handlers.matlab
|
7
3
|
handler: python
|
8
4
|
options:
|
{mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/docs/usage/configuration/headings.md
RENAMED
@@ -553,13 +553,17 @@ plugins:
|
|
553
553
|
=== "With symbol type in headings"
|
554
554
|
|
555
555
|
```markdown
|
556
|
-
:::
|
556
|
+
::: docs/snippets
|
557
557
|
options:
|
558
|
+
members:
|
559
|
+
- mynamespace
|
558
560
|
show_symbol_type_heading: true
|
559
561
|
```
|
560
562
|
|
561
|
-
:::
|
563
|
+
::: docs/snippets
|
562
564
|
options:
|
565
|
+
members:
|
566
|
+
- mynamespace
|
563
567
|
show_symbol_type_heading: true
|
564
568
|
show_docstring_input_arguments: false
|
565
569
|
show_docstring_output_arguments: false
|
@@ -567,13 +571,17 @@ plugins:
|
|
567
571
|
=== "Without symbol type in headings"
|
568
572
|
|
569
573
|
```markdown
|
570
|
-
:::
|
574
|
+
::: docs/snippets
|
571
575
|
options:
|
576
|
+
members:
|
577
|
+
- mynamespace
|
572
578
|
show_symbol_type_heading: false
|
573
579
|
```
|
574
580
|
|
575
|
-
:::
|
581
|
+
::: docs/snippets
|
576
582
|
options:
|
583
|
+
members:
|
584
|
+
- mynamespace
|
577
585
|
show_symbol_type_heading: false
|
578
586
|
show_docstring_input_arguments: false
|
579
587
|
show_docstring_output_arguments: false
|
@@ -586,11 +594,12 @@ plugins:
|
|
586
594
|
Show the symbol type in the Table of Contents.
|
587
595
|
|
588
596
|
This option will prefix items in the ToC with
|
589
|
-
<code class="doc-symbol doc-symbol-
|
597
|
+
<code class="doc-symbol doc-symbol-property"></code>,
|
590
598
|
<code class="doc-symbol doc-symbol-function"></code>,
|
591
599
|
<code class="doc-symbol doc-symbol-method"></code>,
|
592
|
-
<code class="doc-symbol doc-symbol-class"></code
|
593
|
-
<code class="doc-symbol doc-symbol-
|
600
|
+
<code class="doc-symbol doc-symbol-class"></code>,
|
601
|
+
<code class="doc-symbol doc-symbol-namespace"></code> or.
|
602
|
+
<code class="doc-symbol doc-symbol-folder"></code> types.
|
594
603
|
See also [`show_symbol_type_heading`][show_symbol_type_heading].
|
595
604
|
|
596
605
|
```yaml title="in mkdocs.yml (global configuration)"
|
@@ -603,7 +612,7 @@ plugins:
|
|
603
612
|
show_symbol_type_toc: true
|
604
613
|
```
|
605
614
|
|
606
|
-
1. :warning: When using material theme, make sure to also enable the plugin `mkdocs-material-matlab` such that the right heading types are displayed.
|
615
|
+
1. :warning: When using material theme, make sure to also enable the plugin `mkdocs-material-matlab` such that the right heading types are displayed.
|
607
616
|
|
608
617
|
|
609
618
|
```md title="or in docs/some_page.md (local configuration)"
|
@@ -617,12 +626,13 @@ plugins:
|
|
617
626
|
=== "With symbol type in ToC"
|
618
627
|
|
619
628
|
<ul style="list-style: none;">
|
620
|
-
<li><code class="doc-symbol doc-symbol-
|
629
|
+
<li><code class="doc-symbol doc-symbol-folder"></code> folder</li>
|
630
|
+
<li><code class="doc-symbol doc-symbol-namespace"></code> namespace</li>
|
621
631
|
<li><code class="doc-symbol doc-symbol-function"></code> function</li>
|
622
632
|
<li><code class="doc-symbol doc-symbol-class"></code> Class
|
623
633
|
<ul style="list-style: none;">
|
624
634
|
<li><code class="doc-symbol doc-symbol-method"></code> method</li>
|
625
|
-
<li><code class="doc-symbol doc-symbol-
|
635
|
+
<li><code class="doc-symbol doc-symbol-property"></code> property</li>
|
626
636
|
</ul>
|
627
637
|
</li>
|
628
638
|
</ul>
|
@@ -630,6 +640,7 @@ plugins:
|
|
630
640
|
=== "Without symbol type in ToC"
|
631
641
|
|
632
642
|
<ul style="list-style: none;">
|
643
|
+
<li>folder</li>
|
633
644
|
<li>namespace</li>
|
634
645
|
<li>function</li>
|
635
646
|
<li>Class
|
@@ -700,11 +700,6 @@ plugins:
|
|
700
700
|
summary:
|
701
701
|
functions: true
|
702
702
|
|
703
|
-
!!! warning
|
704
|
-
|
705
|
-
In the summary, the title of the properties summary will be *attributes*, and the title of the namespaces summary will be *modules*. This is due to mkdocstrings-matlab's dependency on mkdocstrings-python. For now, mkdocstrings-matlab does not implement its own Jinja templates for rendering, leading to these summary titles.
|
706
|
-
|
707
|
-
|
708
703
|
## `show_labels`
|
709
704
|
|
710
705
|
- **:octicons-package-24: Type [`bool`][] :material-equal: `True`{ title="default value" }**
|
@@ -27,21 +27,14 @@ plugins:
|
|
27
27
|
... # the MATLAB handler configuration
|
28
28
|
```
|
29
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
30
|
```yaml title="mkdocs.yml"
|
33
31
|
plugins:
|
34
|
-
- mkdocs_material_matlab
|
35
32
|
- mkdocstrings:
|
36
33
|
default_handler: matlab
|
37
34
|
matlab:
|
38
35
|
... # the MATLAB handler configuration
|
39
36
|
```
|
40
37
|
|
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
|
-
|
45
38
|
## Injecting documentation
|
46
39
|
|
47
40
|
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:
|
@@ -127,11 +127,10 @@ markdown_extensions:
|
|
127
127
|
toc_depth: 3
|
128
128
|
|
129
129
|
plugins:
|
130
|
+
- callouts
|
130
131
|
- autorefs
|
131
132
|
- search
|
132
133
|
- markdown-exec
|
133
|
-
- callouts
|
134
|
-
- mkdocs-material-matlab
|
135
134
|
- mkdocstrings:
|
136
135
|
default_handler: matlab
|
137
136
|
handlers:
|
@@ -201,16 +200,13 @@ plugins:
|
|
201
200
|
summary: true
|
202
201
|
unwrap_annotated: true
|
203
202
|
|
203
|
+
- minify:
|
204
|
+
minify_html: !ENV [DEPLOY, false]
|
205
|
+
|
204
206
|
- git-revision-date-localized:
|
205
207
|
enabled: !ENV [DEPLOY, false]
|
206
208
|
enable_creation_date: true
|
207
209
|
type: timeago
|
208
|
-
- minify:
|
209
|
-
minify_html: !ENV [DEPLOY, false]
|
210
|
-
- group:
|
211
|
-
enabled: !ENV [MATERIAL_INSIDERS, false]
|
212
|
-
plugins:
|
213
|
-
- typeset
|
214
210
|
|
215
211
|
extra:
|
216
212
|
version:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "mkdocstrings-matlab"
|
3
|
-
version = "0.
|
3
|
+
version = "0.8.1"
|
4
4
|
description = "A MATLAB handler for mkdocstrings"
|
5
5
|
authors = [
|
6
6
|
{ name = "Mark Hu", email = "watermarkhu@gmail.com" }
|
@@ -10,10 +10,10 @@ readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
11
11
|
dependencies = [
|
12
12
|
"mkdocstrings==0.27.0",
|
13
|
-
"mkdocstrings-python==1.13.0",
|
14
|
-
"charset-normalizer
|
15
|
-
"tree-sitter
|
16
|
-
"tree-sitter-matlab
|
13
|
+
"mkdocstrings-python==1.13.0",
|
14
|
+
"charset-normalizer==3.4.1",
|
15
|
+
"tree-sitter==0.23.2",
|
16
|
+
"tree-sitter-matlab==1.0.3",
|
17
17
|
]
|
18
18
|
classifiers = [
|
19
19
|
"Development Status :: 4 - Beta",
|
@@ -44,19 +44,13 @@ managed = true
|
|
44
44
|
allow-direct-references = true
|
45
45
|
|
46
46
|
[tool.hatch.build.targets.wheel]
|
47
|
-
packages = ["src/mkdocstrings_handlers"
|
48
|
-
|
49
|
-
[project.entry-points."mkdocs.plugins"]
|
50
|
-
mkdocs-material-matlab = "mkdocs_material_matlab:MkdocsMaterialMatlabPlugin"
|
47
|
+
packages = ["src/mkdocstrings_handlers"]
|
51
48
|
|
52
49
|
[dependency-groups]
|
53
50
|
docs = [
|
54
51
|
"mkdocs-material>=9.5.33",
|
55
52
|
"markdown-exec>=1.10.0",
|
56
53
|
"mkdocs-callouts>=1.15.0",
|
57
|
-
"mkdocs-with-pdf>=0.9.3",
|
58
|
-
"mkdocs-gen-files>=0.5.0",
|
59
|
-
"mkdocs-literate-nav>=0.6.1",
|
60
54
|
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
|
61
55
|
"mkdocs-minify-plugin>=0.8.0",
|
62
56
|
"mike>=2.1.3",
|
@@ -0,0 +1,126 @@
|
|
1
|
+
"""A script to copy the modules and attributes templates from
|
2
|
+
the python handler to the matlab handler and update the names"""
|
3
|
+
|
4
|
+
from mkdocstrings_handlers.python.handler import PythonHandler
|
5
|
+
from pathlib import Path
|
6
|
+
import re
|
7
|
+
|
8
|
+
# Get the templates directory of the python handler
|
9
|
+
pythonHandler = PythonHandler("python", "material")
|
10
|
+
templatesDir = pythonHandler.get_templates_dir()
|
11
|
+
targetDir = (
|
12
|
+
Path(__file__).parent.parent
|
13
|
+
/ "src"
|
14
|
+
/ "mkdocstrings_handlers"
|
15
|
+
/ "matlab"
|
16
|
+
/ "templates"
|
17
|
+
)
|
18
|
+
|
19
|
+
|
20
|
+
def copy_template(
|
21
|
+
sourcePath: str,
|
22
|
+
targetPath: str,
|
23
|
+
mapping: dict[str, str] = {},
|
24
|
+
theme: str = "material",
|
25
|
+
):
|
26
|
+
sourceFile = templatesDir / theme / sourcePath
|
27
|
+
targetFile = targetDir / theme / targetPath
|
28
|
+
content = sourceFile.read_text()
|
29
|
+
pattern = re.compile(
|
30
|
+
"|".join([re.escape(k) for k in sorted(mapping, key=len, reverse=True)]),
|
31
|
+
flags=re.DOTALL,
|
32
|
+
)
|
33
|
+
content = pattern.sub(lambda x: mapping[x.group(0)], content)
|
34
|
+
targetFile.write_text(content)
|
35
|
+
|
36
|
+
return (targetFile, content)
|
37
|
+
|
38
|
+
|
39
|
+
# Copy the namespace and module templates
|
40
|
+
copy_template(
|
41
|
+
"_base/module.html.jinja",
|
42
|
+
"folder.html.jinja",
|
43
|
+
{
|
44
|
+
"doc-symbol-module": "doc-symbol-folder",
|
45
|
+
},
|
46
|
+
)
|
47
|
+
copy_template(
|
48
|
+
"_base/module.html.jinja",
|
49
|
+
"namespace.html.jinja",
|
50
|
+
{
|
51
|
+
"doc-symbol-module": "doc-symbol-namespace",
|
52
|
+
"{% set module_name = module.path if show_full_path else module.name %}": '{% set module_name = module.path + ".*" if show_full_path else module.name + ".*" %}',
|
53
|
+
},
|
54
|
+
)
|
55
|
+
|
56
|
+
# Copy the property template
|
57
|
+
copy_template(
|
58
|
+
"_base/attribute.html.jinja",
|
59
|
+
"property.html.jinja",
|
60
|
+
{"doc-symbol-attribute": "doc-symbol-property"},
|
61
|
+
)
|
62
|
+
|
63
|
+
# Copy the summary modules template
|
64
|
+
copy_template(
|
65
|
+
"_base/summary.html.jinja",
|
66
|
+
"summary.html.jinja",
|
67
|
+
{
|
68
|
+
"summary/modules": "summary/namespaces",
|
69
|
+
"summary/attributes": "summary/properties",
|
70
|
+
},
|
71
|
+
)
|
72
|
+
|
73
|
+
|
74
|
+
## Copy the summary properties template
|
75
|
+
copy_template(
|
76
|
+
"_base/summary/attributes.html.jinja",
|
77
|
+
"summary/properties.html.jinja",
|
78
|
+
{
|
79
|
+
"docstring/attributes": "docstring/properties",
|
80
|
+
"Summary of attributes": "Summary of properties",
|
81
|
+
},
|
82
|
+
)
|
83
|
+
copy_template(
|
84
|
+
"_base/docstring/attributes.html.jinja",
|
85
|
+
"docstring/properties.html.jinja",
|
86
|
+
{
|
87
|
+
'lang.t("Attributes:")': '"Properties:"',
|
88
|
+
'lang.t("ATTRIBUTE")': '"PROPERTY:"',
|
89
|
+
" attributes ": " properties ",
|
90
|
+
'"Attributes"': '"Properties"',
|
91
|
+
},
|
92
|
+
)
|
93
|
+
|
94
|
+
## Copy the summary namespaces template
|
95
|
+
copy_template(
|
96
|
+
"_base/summary/modules.html.jinja",
|
97
|
+
"summary/namespaces.html.jinja",
|
98
|
+
{
|
99
|
+
"docstring/modules": "docstring/namespaces",
|
100
|
+
"Summary of modules": "Summary of namespaces",
|
101
|
+
},
|
102
|
+
)
|
103
|
+
copy_template(
|
104
|
+
"_base/docstring/modules.html.jinja",
|
105
|
+
"docstring/namespaces.html.jinja",
|
106
|
+
{
|
107
|
+
'lang.t("Modules:")': '"Namespaces:"',
|
108
|
+
'lang.t("MODULE")': '"NAMESPACE:"',
|
109
|
+
" modules ": " namespaces ",
|
110
|
+
'"Modules"': '"Namespaces"',
|
111
|
+
},
|
112
|
+
)
|
113
|
+
|
114
|
+
## Copy children template
|
115
|
+
copy_template(
|
116
|
+
"_base/children.html.jinja",
|
117
|
+
"children.html.jinja",
|
118
|
+
{
|
119
|
+
"-attributes": "-properties",
|
120
|
+
"Attributes": "Properties",
|
121
|
+
"-modules": "-namespaces",
|
122
|
+
"Modules": "Modules",
|
123
|
+
"{% if config.show_submodules %}": "{% if config.show_subnamespaces or obj.is_folder %}",
|
124
|
+
"{% elif child.is_module and config.show_submodules %}": "{% elif (child.is_namespace and config.show_subnamespaces) or obj.is_folder %}",
|
125
|
+
},
|
126
|
+
)
|
{mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/collect.py
RENAMED
@@ -771,7 +771,7 @@ class LazyModel:
|
|
771
771
|
|
772
772
|
def _collect_folder(self, path: Path) -> Folder:
|
773
773
|
name = path.stem
|
774
|
-
model = Folder(name, filepath=path, path_collection=self._path_collection)
|
774
|
+
model = Folder("/" + name, filepath=path, path_collection=self._path_collection)
|
775
775
|
return self._collect_directory(path, model)
|
776
776
|
|
777
777
|
def _collect_readme_md(self, path, parent: PathMixin) -> Docstring | None:
|
{mkdocstrings_matlab-0.7.0 → mkdocstrings_matlab-0.8.1}/src/mkdocstrings_handlers/matlab/handler.py
RENAMED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
from pathlib import Path
|
4
4
|
from collections import ChainMap
|
5
|
+
from jinja2.loaders import FileSystemLoader
|
5
6
|
from markdown import Markdown
|
6
|
-
from
|
7
|
+
from mkdocs.exceptions import PluginError
|
7
8
|
from mkdocstrings.handlers.base import BaseHandler, CollectorItem, CollectionError
|
8
9
|
from mkdocstrings_handlers.python import rendering
|
9
10
|
from typing import Any, ClassVar, Mapping
|
@@ -152,7 +153,9 @@ class MatlabHandler(BaseHandler):
|
|
152
153
|
|
153
154
|
def __init__(
|
154
155
|
self,
|
155
|
-
|
156
|
+
handler: str,
|
157
|
+
theme: str,
|
158
|
+
custom_templates: str | None = None,
|
156
159
|
config_file_path: str | None = None,
|
157
160
|
paths: list[str] | None = None,
|
158
161
|
paths_recursive: bool = False,
|
@@ -163,7 +166,9 @@ class MatlabHandler(BaseHandler):
|
|
163
166
|
Initialize the handler with the given configuration.
|
164
167
|
|
165
168
|
Args:
|
166
|
-
|
169
|
+
handler: The name of the handler.
|
170
|
+
theme: The name of theme to use.
|
171
|
+
custom_templates: Directory containing custom templates.
|
167
172
|
config_file_path (str | None, optional): Path to the configuration file. Defaults to None.
|
168
173
|
paths (list[str] | None, optional): List of paths to include. Defaults to None.
|
169
174
|
paths_recursive (bool, optional): Whether to include paths recursively. Defaults to False.
|
@@ -173,7 +178,16 @@ class MatlabHandler(BaseHandler):
|
|
173
178
|
Returns:
|
174
179
|
None
|
175
180
|
"""
|
176
|
-
|
181
|
+
|
182
|
+
super().__init__(handler, theme, custom_templates=custom_templates)
|
183
|
+
|
184
|
+
theme_path = Path(__file__).resolve().parent / "templates" / theme
|
185
|
+
if theme_path.exists() and isinstance(self.env.loader, FileSystemLoader):
|
186
|
+
# Insert our templates directory at the beginning of the search path to overload the Python templates
|
187
|
+
self.env.loader.searchpath.insert(0, str(theme_path))
|
188
|
+
css_path = theme_path / "style.css"
|
189
|
+
if css_path.exists():
|
190
|
+
self.extra_css += "\n" + css_path.read_text(encoding="utf-8")
|
177
191
|
|
178
192
|
if paths is None or config_file_path is None:
|
179
193
|
config_path = None
|
@@ -182,13 +196,19 @@ class MatlabHandler(BaseHandler):
|
|
182
196
|
config_path = Path(config_file_path).parent
|
183
197
|
full_paths = [(config_path / path).resolve() for path in paths]
|
184
198
|
|
199
|
+
if pathIds := [str(path) for path in full_paths if not path.is_dir()]:
|
200
|
+
raise PluginError(
|
201
|
+
"The following paths do not exist or are not directories: "
|
202
|
+
+ ", ".join(pathIds)
|
203
|
+
)
|
204
|
+
|
185
205
|
self.paths: PathCollection = PathCollection(
|
186
206
|
full_paths, recursive=paths_recursive, config_path=config_path
|
187
207
|
)
|
188
208
|
self.lines: LinesCollection = self.paths.lines_collection
|
189
209
|
self._locale: str = locale
|
190
210
|
|
191
|
-
def get_templates_dir(self,
|
211
|
+
def get_templates_dir(self, *args, **kwargs) -> Path:
|
192
212
|
# use the python handler templates
|
193
213
|
# (it assumes the python handler is installed)
|
194
214
|
return super().get_templates_dir("python")
|
@@ -254,7 +274,6 @@ class MatlabHandler(BaseHandler):
|
|
254
274
|
}
|
255
275
|
|
256
276
|
# Map docstring options
|
257
|
-
final_config["show_submodules"] = config.get("show_subnamespaces", False)
|
258
277
|
final_config["show_docstring_attributes"] = config.get(
|
259
278
|
"show_docstring_properties", True
|
260
279
|
)
|
@@ -339,7 +358,10 @@ class MatlabHandler(BaseHandler):
|
|
339
358
|
raise CollectionError("Empty identifier")
|
340
359
|
|
341
360
|
final_config = ChainMap(config, self.default_config) # type: ignore[arg-type]
|
342
|
-
|
361
|
+
model = self.paths.resolve(identifier, config=final_config)
|
362
|
+
if model is None:
|
363
|
+
raise CollectionError(f"Identifier '{identifier}' not found")
|
364
|
+
return model
|
343
365
|
|
344
366
|
|
345
367
|
def get_handler(
|