mkdocstrings-matlab 0.9.7__py3-none-any.whl → 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. mkdocstrings_handlers/matlab/__init__.py +26 -3
  2. mkdocstrings_handlers/matlab/config.py +885 -0
  3. mkdocstrings_handlers/matlab/handler.py +155 -296
  4. mkdocstrings_handlers/matlab/logger.py +111 -0
  5. mkdocstrings_handlers/matlab/rendering.py +818 -0
  6. mkdocstrings_handlers/matlab/templates/material/attributes.html.jinja +25 -0
  7. mkdocstrings_handlers/matlab/templates/material/backlinks.html.jinja +17 -0
  8. mkdocstrings_handlers/matlab/templates/material/children.html.jinja +70 -62
  9. mkdocstrings_handlers/matlab/templates/material/class.html.jinja +236 -0
  10. mkdocstrings_handlers/matlab/templates/material/docstring/admonition.html.jinja +20 -0
  11. mkdocstrings_handlers/matlab/templates/material/docstring/classes.html.jinja +85 -0
  12. mkdocstrings_handlers/matlab/templates/material/docstring/examples.html.jinja +27 -0
  13. mkdocstrings_handlers/matlab/templates/material/docstring/functions.html.jinja +91 -0
  14. mkdocstrings_handlers/matlab/templates/material/docstring/input_arguments.html.jinja +171 -0
  15. mkdocstrings_handlers/matlab/templates/material/docstring/name_value_arguments.html.jinja +166 -0
  16. mkdocstrings_handlers/matlab/templates/material/docstring/namespaces.html.jinja +5 -6
  17. mkdocstrings_handlers/matlab/templates/material/docstring/output_arguments.html.jinja +152 -0
  18. mkdocstrings_handlers/matlab/templates/material/docstring/properties.html.jinja +25 -26
  19. mkdocstrings_handlers/matlab/templates/material/docstring.html.jinja +53 -0
  20. mkdocstrings_handlers/matlab/templates/material/expression.html.jinja +55 -0
  21. mkdocstrings_handlers/matlab/templates/material/folder.html.jinja +31 -39
  22. mkdocstrings_handlers/matlab/templates/material/function.html.jinja +148 -0
  23. mkdocstrings_handlers/matlab/templates/material/language.html.jinja +18 -0
  24. mkdocstrings_handlers/matlab/templates/material/languages/en.html.jinja +38 -0
  25. mkdocstrings_handlers/matlab/templates/material/languages/ja.html.jinja +38 -0
  26. mkdocstrings_handlers/matlab/templates/material/languages/zh.html.jinja +38 -0
  27. mkdocstrings_handlers/matlab/templates/material/namespace.html.jinja +32 -38
  28. mkdocstrings_handlers/matlab/templates/material/property.html.jinja +39 -35
  29. mkdocstrings_handlers/matlab/templates/material/script.html.jinja +3 -25
  30. mkdocstrings_handlers/matlab/templates/material/signature.html.jinja +105 -0
  31. mkdocstrings_handlers/matlab/templates/material/style.css +179 -4
  32. mkdocstrings_handlers/matlab/templates/material/summary/classes.html.jinja +25 -0
  33. mkdocstrings_handlers/matlab/templates/material/summary/functions.html.jinja +25 -0
  34. mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja +17 -13
  35. mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja +17 -13
  36. mkdocstrings_handlers/matlab/templates/material/summary.html.jinja +6 -6
  37. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/METADATA +17 -21
  38. mkdocstrings_matlab-1.0.1.dist-info/RECORD +41 -0
  39. mkdocstrings_handlers/matlab/collect.py +0 -783
  40. mkdocstrings_handlers/matlab/enums.py +0 -54
  41. mkdocstrings_handlers/matlab/models.py +0 -633
  42. mkdocstrings_handlers/matlab/treesitter.py +0 -707
  43. mkdocstrings_matlab-0.9.7.dist-info/RECORD +0 -22
  44. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/WHEEL +0 -0
  45. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -9,19 +9,18 @@ Context:
9
9
 
10
10
  {% block logs scoped %}
11
11
  {#- Logging block.
12
-
12
+
13
13
  This block can be used to log debug messages, deprecation messages, warnings, etc.
14
14
  -#}
15
15
  {{ log.debug("Rendering properties section") }}
16
16
  {% endblock logs %}
17
-
18
- {% import "language"|get_template as lang with context %}
17
+ {% import "language.html.jinja" as lang with context %}
19
18
  {#- Language module providing the `t` translation method. -#}
20
19
 
21
20
  {% if config.docstring_section_style == "table" %}
22
21
  {% block table_style scoped %}
23
22
  {#- Block for the `table` section style. -#}
24
- <p><span class="doc-section-title">{{ section.title or "Properties:" }}</span></p>
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Properties:") }}</span></p>
25
24
  <table>
26
25
  <thead>
27
26
  <tr>
@@ -31,19 +30,19 @@ Context:
31
30
  </tr>
32
31
  </thead>
33
32
  <tbody>
34
- {% for attribute in section.value %}
33
+ {% for property in section.value %}
35
34
  <tr class="doc-section-item">
36
- <td><code><autoref identifier="{{ obj.path }}.{{ attribute.name }}" optional hover>{{ attribute.name }}</autoref></code></td>
35
+ <td><code><autoref identifier="{{ obj.path }}.{{ property.name }}" optional hover>{{ property.name }}</autoref></code></td>
37
36
  <td>
38
- {% if attribute.annotation %}
39
- {% with expression = attribute.annotation %}
40
- <code>{% include "expression"|get_template with context %}</code>
37
+ {% if property.annotation %}
38
+ {% with expression = property.annotation %}
39
+ <code>{% include "expression.html.jinja" with context %}</code>
41
40
  {% endwith %}
42
41
  {% endif %}
43
42
  </td>
44
43
  <td>
45
44
  <div class="doc-md-description">
46
- {{ attribute.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
45
+ {{ property.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
47
46
  </div>
48
47
  </td>
49
48
  </tr>
@@ -54,19 +53,19 @@ Context:
54
53
  {% elif config.docstring_section_style == "list" %}
55
54
  {% block list_style scoped %}
56
55
  {#- Block for the `list` section style. -#}
57
- <p><span class="doc-section-title">{{ section.title or "Properties:" }}</span></p>
56
+ <p><span class="doc-section-title">{{ section.title or lang.t("Properties:") }}</span></p>
58
57
  <ul>
59
- {% for attribute in section.value %}
58
+ {% for property in section.value %}
60
59
  <li class="doc-section-item field-body">
61
- <b><code><autoref identifier="{{ obj.path }}.{{ attribute.name }}" optional hover>{{ attribute.name }}</autoref></code></b>
62
- {% if attribute.annotation %}
63
- {% with expression = attribute.annotation %}
64
- (<code>{% include "expression"|get_template with context %}</code>)
60
+ <b><code><autoref identifier="{{ obj.path }}.{{ property.name }}" optional hover>{{ property.name }}</autoref></code></b>
61
+ {% if property.annotation %}
62
+ {% with expression = property.annotation %}
63
+ (<code>{% include "expression.html.jinja" with context %}</code>)
65
64
  {% endwith %}
66
65
  {% endif %}
67
66
 
68
67
  <div class="doc-md-description">
69
- {{ attribute.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
68
+ {{ property.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
70
69
  </div>
71
70
  </li>
72
71
  {% endfor %}
@@ -78,24 +77,24 @@ Context:
78
77
  <table>
79
78
  <thead>
80
79
  <tr>
81
- <th><span class="doc-section-title">{{ (section.title or "PROPERTY:").rstrip(":").upper() }}</span></th>
80
+ <th><span class="doc-section-title">{{ (section.title or lang.t("PROPERTY")).rstrip(":").upper() }}</span></th>
82
81
  <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
83
82
  </tr>
84
83
  </thead>
85
84
  <tbody>
86
- {% for attribute in section.value %}
85
+ {% for property in section.value %}
87
86
  <tr class="doc-section-item">
88
- <td><code><autoref identifier="{{ obj.path }}.{{ attribute.name }}" optional hover>{{ attribute.name }}</autoref></code></td>
89
- <td class="doc-attribute-details">
87
+ <td><code><autoref identifier="{{ obj.path }}.{{ property.name }}" optional hover>{{ property.name }}</autoref></code></td>
88
+ <td class="doc-property-details">
90
89
  <div class="doc-md-description">
91
- {{ attribute.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
90
+ {{ property.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
92
91
  </div>
93
92
  <p>
94
- {% if attribute.annotation %}
95
- <span class="doc-attribute-annotation">
93
+ {% if property.annotation %}
94
+ <span class="doc-property-annotation">
96
95
  <b>TYPE:</b>
97
- {% with expression = attribute.annotation %}
98
- <code>{% include "expression"|get_template with context %}</code>
96
+ {% with expression = property.annotation %}
97
+ <code>{% include "expression.html.jinja" with context %}</code>
99
98
  {% endwith %}
100
99
  </span>
101
100
  {% endif %}
@@ -0,0 +1,53 @@
1
+ {#- Template for docstrings.
2
+
3
+ This template renders Python docstrings.
4
+ Griffe parses docstrings into a list of sections, each with a `kind` and a `value`.
5
+ This template can then iterate on these sections and render them according to the configuration.
6
+
7
+ Context:
8
+ docstring_sections (list[griffe.DocstringSection]): The list of docstring sections.
9
+ config (dict): The configuration dictionary.
10
+ heading_level (int): The heading level to use for Markdown conversion.
11
+ html_id (str): The HTML ID to use for Markdown conversion.
12
+ -#}
13
+
14
+ {% if docstring_sections %}
15
+ {% block logs scoped %}
16
+ {#- Logging block.
17
+
18
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
19
+ -#}
20
+ {{ log.debug("Rendering docstring") }}
21
+ {% endblock logs %}
22
+ {% with autoref_hook = AutorefsHook(obj, config) %}
23
+ {% for section in docstring_sections %}
24
+ {% if config.show_docstring_description and section.kind.value == "text" %}
25
+ {{ section.value|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
26
+ {% elif config.show_docstring_properties and section.kind.value == "attributes" %}
27
+ {% include "docstring/properties.html.jinja" with context %}
28
+ {% elif config.show_docstring_functions and section.kind.value == "functions" %}
29
+ {% include "docstring/functions.html.jinja" with context %}
30
+ {% elif config.show_docstring_classes and section.kind.value == "classes" %}
31
+ {% include "docstring/classes.html.jinja" with context %}
32
+ {% elif config.show_docstring_namespaces and section.kind.value == "modules" %}
33
+ {% include "docstring/namespaces.html.jinja" with context %}
34
+ {% elif config.show_docstring_input_arguments and section.kind.value == "parameters" %}
35
+ {% filter format_arguments(section) %}
36
+ {{ section.kind.value }}
37
+ {% endfilter %}
38
+ {% elif config.show_docstring_name_value_arguments and section.kind.value == "other parameters" %}
39
+ {% filter format_arguments(section) %}
40
+ {{ section.kind.value }}
41
+ {% endfilter %}
42
+ {% elif config.show_docstring_output_arguments and section.kind.value == "returns" %}
43
+ {% filter format_arguments(section) %}
44
+ {{ section.kind.value }}
45
+ {% endfilter %}
46
+ {% elif config.show_docstring_examples and section.kind.value == "examples" %}
47
+ {% include "docstring/examples.html.jinja" with context %}
48
+ {% elif config.show_docstring_description and section.kind.value == "admonition" %}
49
+ {% include "docstring/admonition.html.jinja" with context %}
50
+ {% endif %}
51
+ {% endfor %}
52
+ {% endwith %}
53
+ {% endif %}
@@ -0,0 +1,55 @@
1
+ {#- Template for expressions.
2
+
3
+ This template renders a Griffe expression,
4
+ which is a tree-like structure representing a Python expression.
5
+ -#}
6
+
7
+ {% block logs scoped %}
8
+ {#- Logging block.
9
+
10
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
11
+ -#}
12
+ {% endblock logs %}
13
+
14
+ {%- macro render(expression, annotations_path, backlink_type="") -%}
15
+ {#- Render an expression.
16
+
17
+ Parameters:
18
+ expression (griffe.Expr): The expression to render.
19
+ annotations_path (str): Either "brief", "source", or "full".
20
+
21
+ Returns:
22
+ The rendered expression.
23
+ -#}
24
+ {%- if expression is string -%}
25
+ {%- if signature -%}{{ expression|safe }}{%- else -%}{{ expression }}{%- endif -%}
26
+ {%- elif expression.doc != "" -%}
27
+ {%- if config.signature_crossrefs -%}
28
+ {%- filter stash_crossref(length=expression|string|length) -%}
29
+ <a class="autorefs autorefs-external" href="{{ expression.doc }}">{{ expression|string }}</a>
30
+ {%- endfilter -%}
31
+ {%- else -%}
32
+ {{ expression|string }}
33
+ {%- endif -%}
34
+ {%- elif expression|string in paths_collection -%}
35
+ {%- with obj = paths_collection.get_member(expression|string) -%}
36
+ {%- if config.signature_crossrefs -%}
37
+ {%- if signature -%}
38
+ {%- filter stash_crossref(length=expression|string|length) -%}
39
+ <autoref identifier="{{ obj.canonical_path }}" optional hover>{{ expression|string }}</autoref>
40
+ {%- endfilter -%}
41
+ {%- else -%}
42
+ <autoref identifier="{{ obj.canonical_path }}" optional hover>{{ expression|string }}</autoref>
43
+ {%- endif -%}
44
+ {%- else -%}
45
+ {{ expression|string }}
46
+ {%- endif -%}
47
+ {%- endwith -%}
48
+ {%- else -%}
49
+ {%- for element in expression -%}
50
+ {{ render(element, annotations_path) }}
51
+ {%- endfor -%}
52
+ {%- endif -%}
53
+ {%- endmacro -%}
54
+
55
+ {{ render(expression, config.annotations_path, backlink_type|default("")) }}
@@ -1,9 +1,7 @@
1
- {#- Template for Python modules.
2
-
3
- This template renders a Python module.
1
+ {#- Template for folders containing MATLAB source code.
4
2
 
5
3
  Context:
6
- module (griffe.Module): The module to render.
4
+ folder (mkdocstring_handlers.matlab.models.Folder): The folder to render.
7
5
  root (bool): Whether this is the root object, injected with `:::` in a Markdown page.
8
6
  heading_level (int): The HTML heading level to use.
9
7
  config (dict): The configuration options.
@@ -11,14 +9,14 @@ Context:
11
9
 
12
10
  {% block logs scoped %}
13
11
  {#- Logging block.
14
-
12
+
15
13
  This block can be used to log debug messages, deprecation messages, warnings, etc.
16
14
  -#}
17
- {{ log.debug("Rendering " + module.path) }}
15
+ {{ log.debug("Rendering " + folder.path) }}
18
16
  {% endblock logs %}
19
17
 
20
- <div class="doc doc-object doc-module">
21
- {% with obj = module, html_id = module.path %}
18
+ <div class="doc doc-object doc-folder">
19
+ {% with obj = folder, html_id = folder.path %}
22
20
 
23
21
  {% if root %}
24
22
  {% set show_full_path = config.show_root_full_path %}
@@ -30,48 +28,37 @@ Context:
30
28
  {% set show_full_path = config.show_object_full_path %}
31
29
  {% endif %}
32
30
 
33
- {% set module_name = module.path if show_full_path else module.name %}
31
+ {% set folder_name = folder.path if show_full_path else folder.name %}
34
32
 
35
33
  {% if not root or config.show_root_heading %}
36
34
  {% filter heading(
37
35
  heading_level,
38
- role="module",
36
+ role="folder",
39
37
  id=html_id,
40
38
  class="doc doc-heading",
41
- toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-folder"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + module.name,
39
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-folder"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else folder.name),
42
40
  ) %}
43
41
 
44
42
  {% block heading scoped %}
45
43
  {#- Heading block.
46
-
47
- This block renders the heading for the module.
44
+
45
+ This block renders the heading for the folder.
48
46
  -#}
49
47
  {% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-folder"></code>{% endif %}
50
48
  {% if config.separate_signature %}
51
- <span class="doc doc-object-name doc-module-name">{{ module_name }}</span>
49
+ <span class="doc doc-object-name doc-folder-name">{{ config.heading if config.heading and root else folder_name }}</span>
52
50
  {% else %}
53
- <code>{{ module_name }}</code>
51
+ <code>{{ folder_name }}</code>
54
52
  {% endif %}
55
53
  {% endblock heading %}
56
-
57
- {% block labels scoped %}
58
- {#- Labels block.
59
-
60
- This block renders the labels for the module.
61
- -#}
62
- {% with labels = module.labels %}
63
- {% include "labels"|get_template with context %}
64
- {% endwith %}
65
- {% endblock labels %}
66
-
67
54
  {% endfilter %}
68
55
 
69
56
  {% else %}
70
57
  {% if config.show_root_toc_entry %}
71
58
  {% filter heading(heading_level,
72
- role="module",
59
+ role="folder",
73
60
  id=html_id,
74
- toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-folder"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + module.name,
61
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-folder"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else folder.name),
75
62
  hidden=True,
76
63
  ) %}
77
64
  {% endfilter %}
@@ -82,37 +69,42 @@ Context:
82
69
  <div class="doc doc-contents {% if root %}first{% endif %}">
83
70
  {% block contents scoped %}
84
71
  {#- Contents block.
85
-
86
- This block renders the contents of the module.
72
+
73
+ This block renders the contents of the folder.
87
74
  It contains other blocks that users can override.
88
75
  Overriding the contents block allows to rearrange the order of the blocks.
89
76
  -#}
90
77
  {% block docstring scoped %}
91
78
  {#- Docstring block.
92
-
93
- This block renders the docstring for the module.
79
+
80
+ This block renders the docstring for the folder.
94
81
  -#}
95
- {% with docstring_sections = module.docstring.parsed %}
96
- {% include "docstring"|get_template with context %}
82
+ {% with docstring_sections = folder.docstring.parsed %}
83
+ {% include "docstring.html.jinja" with context %}
97
84
  {% endwith %}
98
85
  {% endblock docstring %}
99
86
 
87
+ {% if config.backlinks %}
88
+ <backlinks identifier="{{ html_id }}" handler="python" />
89
+ {% endif %}
90
+
100
91
  {% block summary scoped %}
101
92
  {#- Summary block.
102
-
93
+
103
94
  This block renders auto-summaries for classes, methods, and attributes.
104
95
  -#}
105
- {% include "summary"|get_template with context %}
96
+ {% include "summary.html.jinja" with context %}
106
97
  {% endblock summary %}
107
98
 
108
99
  {% block children scoped %}
109
100
  {#- Children block.
110
-
111
- This block renders the children (members) of the module.
101
+
102
+ This block renders the children (members) of the folder.
112
103
  -#}
113
104
  {% set root = False %}
114
105
  {% set heading_level = heading_level + 1 %}
115
- {% include "children"|get_template with context %}
106
+
107
+ {% include "children.html.jinja" with context %}
116
108
  {% endblock children %}
117
109
  {% endblock contents %}
118
110
  </div>
@@ -0,0 +1,148 @@
1
+ {#- Template for MATLAB functions.
2
+
3
+ This template renders a MATLAB function or method.
4
+
5
+ Context:
6
+ function (mkdocstrings_handlers.matlab.objects.Function): The function to render.
7
+ root (bool): Whether this is the root object, injected with `:::` in a Markdown page.
8
+ heading_level (int): The HTML heading level to use.
9
+ config (dict): The configuration options.
10
+ -#}
11
+
12
+ {% block logs scoped %}
13
+ {#- Logging block.
14
+
15
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
16
+ -#}
17
+ {{ log.debug("Rendering " + function.path) }}
18
+ {% endblock logs %}
19
+
20
+ {% import "language.html.jinja" as lang with context %}
21
+ {#- Language module providing the `t` translation method. -#}
22
+
23
+ <div class="doc doc-object doc-function">
24
+ {% with obj = function, html_id = function.path %}
25
+
26
+ {% if root %}
27
+ {% set show_full_path = config.show_root_full_path %}
28
+ {% set root_members = True %}
29
+ {% elif root_members %}
30
+ {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %}
31
+ {% set root_members = False %}
32
+ {% else %}
33
+ {% set show_full_path = config.show_object_full_path %}
34
+ {% endif %}
35
+
36
+ {% set function_name = function.path if show_full_path else function.name %}
37
+ {#- Brief or full function name depending on configuration. -#}
38
+ {% set symbol_type = "method" if function.parent.is_class else "function" %}
39
+ {#- Symbol type: method when parent is a class, function otherwise. -#}
40
+
41
+ {% if not root or config.show_root_heading %}
42
+ {% filter heading(
43
+ heading_level,
44
+ role="function",
45
+ id=html_id,
46
+ class="doc doc-heading",
47
+ toc_label=(('<code class="doc-symbol doc-symbol-toc doc-symbol-' + symbol_type + '"></code>&nbsp;')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
48
+ ) %}
49
+
50
+ {% block heading scoped %}
51
+ {#- Heading block.
52
+
53
+ This block renders the heading for the function.
54
+ -#}
55
+ {% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-{{ symbol_type }}"></code>{% endif %}
56
+ {% if config.separate_signature %}
57
+ <span class="doc doc-object-name doc-function-name">{{ config.heading if config.heading and root else function_name }}</span>
58
+ {% else %}
59
+ {%+ filter highlight(language="matlab", inline=True) -%}
60
+ {{ function_name }}{% include "signature.html.jinja" with context %}
61
+ {%- endfilter %}
62
+ {% endif %}
63
+ {% endblock heading %}
64
+
65
+ {% block attributes scoped %}
66
+ {#- attributes block.
67
+
68
+ This block renders the attributes for the function.
69
+ -#}
70
+ {% with attributes = function.attributes %}
71
+ {% include "attributes.html.jinja" with context %}
72
+ {% endwith %}
73
+ {% endblock attributes %}
74
+
75
+ {% endfilter %}
76
+
77
+ {% block signature scoped %}
78
+ {#- Signature block.
79
+
80
+ This block renders the signature for the function.
81
+ -#}
82
+ {% if config.separate_signature %}
83
+ {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
84
+ {{ function.name }}
85
+ {% endfilter %}
86
+ {% endif %}
87
+ {% endblock signature %}
88
+
89
+ {% else %}
90
+
91
+ {% if config.show_root_toc_entry %}
92
+ {% filter heading(
93
+ heading_level,
94
+ role="function",
95
+ id=html_id,
96
+ toc_label=(('<code class="doc-symbol doc-symbol-toc doc-symbol-' + symbol_type + '"></code>&nbsp;')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
97
+ hidden=True,
98
+ ) %}
99
+ {% endfilter %}
100
+ {% endif %}
101
+ {% set heading_level = heading_level - 1 %}
102
+ {% endif %}
103
+
104
+ <div class="doc doc-contents {% if root %}first{% endif %}">
105
+ {% block contents scoped %}
106
+ {#- Contents block.
107
+
108
+ This block renders the contents of the function.
109
+ It contains other blocks that users can override.
110
+ Overriding the contents block allows to rearrange the order of the blocks.
111
+ -#}
112
+ {% block docstring scoped %}
113
+ {#- Docstring block.
114
+
115
+ This block renders the docstring for the function.
116
+ -#}
117
+ {% with docstring_sections = function | function_docstring(config.parse_arguments, config.show_docstring_input_arguments, config.show_docstring_name_value_arguments, config.show_docstring_output_arguments) %}
118
+ {% include "docstring.html.jinja" with context %}
119
+ {% endwith %}
120
+ {% endblock docstring %}
121
+
122
+ {% if config.backlinks %}
123
+ <backlinks identifier="{{ html_id }}" handler="matlab" />
124
+ {% endif %}
125
+
126
+ {% block source scoped %}
127
+ {#- Source block.
128
+
129
+ This block renders the source code for the function.
130
+ -#}
131
+ {% if config.show_source and function.source %}
132
+ <details class="quote">
133
+ <summary>{{ lang.t("Source code in") }} <code>
134
+ {%- if function.relative_filepath.is_absolute() -%}
135
+ {{ function.relative_package_filepath }}
136
+ {%- else -%}
137
+ {{ function.relative_filepath }}
138
+ {%- endif -%}
139
+ </code></summary>
140
+ {{ function.source|highlight(language="matlab", linestart=function.lineno or 0, linenums=True) }}
141
+ </details>
142
+ {% endif %}
143
+ {% endblock source %}
144
+ {% endblock contents %}
145
+ </div>
146
+
147
+ {% endwith %}
148
+ </div>
@@ -0,0 +1,18 @@
1
+ {#- Import translation macros for the given language and fallback language. -#}
2
+
3
+ {% block logs scoped %}
4
+ {#- Logging block.
5
+
6
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
7
+ -#}
8
+ {% endblock logs %}
9
+
10
+ {% set lang_pth = "languages/" ~ locale ~ ".html.jinja" %}
11
+ {% if lang_pth is existing_template %}
12
+ {% import lang_pth as lang %}
13
+ {% import "languages/en.html.jinja" as fallback %}
14
+ {% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
15
+ {% else %}
16
+ {% import "languages/en.html.jinja" as lang %}
17
+ {% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
18
+ {% endif %}
@@ -0,0 +1,38 @@
1
+ {#- Macro for English translations. -#}
2
+
3
+ {% block logs scoped %}
4
+ {#- Logging block.
5
+
6
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
7
+ -#}
8
+ {% endblock logs %}
9
+
10
+ {% macro t(key) %}{{ {
11
+ "PROPERTY": "PROPERTY",
12
+ "Properties:": "Properties:",
13
+ "Classes:": "Classes:",
14
+ "CLASS": "CLASS",
15
+ "DEFAULT:": "DEFAULT:",
16
+ "Default": "Default",
17
+ "default:": "default:",
18
+ "DESCRIPTION": "DESCRIPTION",
19
+ "Description": "Description",
20
+ "Examples:": "Examples:",
21
+ "Functions:": "Functions:",
22
+ "FUNCTION": "FUNCTION",
23
+ 'Folder:': 'Folder:',
24
+ "Methods:": "Methods:",
25
+ "METHOD": "METHOD",
26
+ "Namespaces:": "Namespaces:",
27
+ "NAMESPACE": "NAMESPACE",
28
+ "Name": "Name",
29
+ "Name-value arguments:": "Name-value arguments:",
30
+ "INPUT ARGUMENT": "INPUT ARGUMENT",
31
+ "Input arguments:": "Input arguments:",
32
+ "required": "required",
33
+ "OUTPUT ARGUMENT": "OUTPUT ARGUMENT",
34
+ "Output arguments:": "Output arguments:",
35
+ "Source code in": "Source code in",
36
+ "TYPE:": "TYPE:",
37
+ "Type": "Type",
38
+ }[key] }}{% endmacro %}
@@ -0,0 +1,38 @@
1
+ {#- Macro for Japanese translations. -#}
2
+
3
+ {% block logs scoped %}
4
+ {#- Logging block.
5
+
6
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
7
+ -#}
8
+ {% endblock logs %}
9
+
10
+ {% macro t(key) %}{{ {
11
+ "PROPERTY": "属性",
12
+ "Properties:": "属性:",
13
+ "Classes:": "クラス:",
14
+ "CLASS": "クラス",
15
+ "DEFAULT:": "デフォルト:",
16
+ "Default": "デフォルト",
17
+ "default:": "デフォルト:",
18
+ "DESCRIPTION": "デスクリプション",
19
+ "Description": "デスクリプション",
20
+ "Examples:": "例:",
21
+ "Functions:": "関数:",
22
+ "FUNCTION": "関数",
23
+ "Folder:": "フォルダ:",
24
+ "Methods:": "メソッド:",
25
+ "METHOD": "メソッド",
26
+ "Namespaces:": "モジュール:",
27
+ "NAMESPACE": "モジュール",
28
+ "Name": "名前",
29
+ "Name-value arguments:": "名前と値の引数:",
30
+ "INPUT ARGUMENT": "引数",
31
+ "Input arguments:": "引数:",
32
+ "required": "必須",
33
+ "OUTPUT ARGUMENT": "戻り値",
34
+ "Output arguments:": "戻り値:",
35
+ "Source code in": "ソースコード位置:",
36
+ "TYPE:": "タイプ:",
37
+ "Type": "タイプ",
38
+ }[key] }}{% endmacro %}
@@ -0,0 +1,38 @@
1
+ {#- Macro for Chinese translations. -#}
2
+
3
+ {% block logs scoped %}
4
+ {#- Logging block.
5
+
6
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
7
+ -#}
8
+ {% endblock logs %}
9
+
10
+ {% macro t(key) %}{{ {
11
+ "PROPERTY": "属性",
12
+ "Properties:": "属性:",
13
+ "Classes:": "类:",
14
+ "CLASS": "类",
15
+ "DEFAULT:": "默认:",
16
+ "Default": "默认",
17
+ "default:": "默认:",
18
+ "DESCRIPTION": "描述",
19
+ "Description": "描述",
20
+ "Examples:": "示例:",
21
+ "Functions:": "函数:",
22
+ "FUNCTION": "函数",
23
+ "Folder:": "文件夹:",
24
+ "Methods:": "方法:",
25
+ "METHOD": "方法",
26
+ "Namespaces:": "模块:",
27
+ "NAMESPACE": "模块",
28
+ "Name": "名称",
29
+ "Name-value arguments:": "名称-值参量:",
30
+ "INPUT ARGUMENT": "参数",
31
+ "Input arguments:": "参数:",
32
+ "required": "必需",
33
+ "OUTPUT ARGUMENT": "返回",
34
+ "Output arguments:": "返回:",
35
+ "Source code in": "源代码位于:",
36
+ "TYPE:": "类型:",
37
+ "Type": "类型",
38
+ }[key] }}{% endmacro %}