mkdocstrings-matlab 1.0.6__py3-none-any.whl → 1.0.8__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.
@@ -358,10 +358,10 @@ class MatlabInputOptions:
358
358
  ] = "table"
359
359
 
360
360
  docstring_style: Annotated[
361
- Literal["auto", "google", "numpy", "sphinx"] | None,
361
+ Literal["google", "numpy", "sphinx"] | None,
362
362
  Field(
363
363
  group="docstrings",
364
- description="The docstring style to use: `auto`, `google`, `numpy`, `sphinx`, or `None`.",
364
+ description="The docstring style to use: `google`, `numpy`, `sphinx`, or `None`.",
365
365
  ),
366
366
  ] = "google"
367
367
 
@@ -132,6 +132,9 @@ class MatlabHandler(BaseHandler):
132
132
  template_name = rendering.do_get_template(data)
133
133
  template = self.env.get_template(template_name)
134
134
 
135
+ if hasattr(data, "docstring") and data.docstring is not None:
136
+ data.docstring.parse()
137
+
135
138
  heading_level = options.heading_level
136
139
 
137
140
  html = template.render(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-matlab
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: A MATLAB handler for mkdocstrings
5
5
  Author-email: Mark Hu <watermarkhu@gmail.com>
6
6
  License: MIT
@@ -21,8 +21,8 @@ Classifier: Topic :: Utilities
21
21
  Classifier: Typing :: Typed
22
22
  Requires-Python: <3.14,>=3.10
23
23
  Requires-Dist: charset-normalizer~=3.4
24
- Requires-Dist: griffe~=1.13.0
25
- Requires-Dist: maxx~=0.3.0
24
+ Requires-Dist: griffe~=1.14.0
25
+ Requires-Dist: maxx~=0.4.2
26
26
  Requires-Dist: mkdocs-autorefs~=1.4
27
27
  Requires-Dist: mkdocstrings~=0.29
28
28
  Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
@@ -1,7 +1,6 @@
1
1
  mkdocstrings_handlers/matlab/__init__.py,sha256=zLE8MANvIbg-pEVFc9bGhhIUvqAjnSANBGqek-dm3LM,1721
2
- mkdocstrings_handlers/matlab/config.py,sha256=yuoB62JOm4vW5uJYd9mqvwIhtfmgSD34CMccc-9aEEc,26724
3
- mkdocstrings_handlers/matlab/handler.py,sha256=gD0ogRqzOlZAn_iv1E0xFflFj_tUmQcWUeWLPlp1RxI,9803
4
- mkdocstrings_handlers/matlab/logger.py,sha256=96hRpwOVyvEF0e9f8rvXnNBSBAuHEvM5a6bJNN8hjRo,3298
2
+ mkdocstrings_handlers/matlab/config.py,sha256=LEv-tDlJrpKDz_g5cNKieCp3vlY1ZWTbWj2Y8RY0m8g,26708
3
+ mkdocstrings_handlers/matlab/handler.py,sha256=ejp0w6ZplsdivdwbtiuTpt4nl58v0-ivn-bmH2UBDFc,9909
5
4
  mkdocstrings_handlers/matlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
5
  mkdocstrings_handlers/matlab/rendering.py,sha256=yhxpyAcEkCCC6of84ENip5QhEheVNl16E5jNjB53iZs,25726
7
6
  mkdocstrings_handlers/matlab/templates/material/attributes.html.jinja,sha256=3Wv9tRkBASmxW3NGdAw9V8mc7G6hc1pDIKmVQztlFJk,818
@@ -35,7 +34,7 @@ mkdocstrings_handlers/matlab/templates/material/summary/classes.html.jinja,sha25
35
34
  mkdocstrings_handlers/matlab/templates/material/summary/functions.html.jinja,sha256=f19-RvEkHZO4VegiQApq71nAEA27RKwQW3S2NMmKrW4,860
36
35
  mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja,sha256=J0aPYlktc5RY3Gax6GCZDxT5qgFDB5b3eqZZXfZOHxU,845
37
36
  mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja,sha256=0wQeDtZzfLSZPHJzLG_MVzre1NSyoSHowTwYzk0JX1c,857
38
- mkdocstrings_matlab-1.0.6.dist-info/METADATA,sha256=-pjAkLo_oWBuC8lX_JaRiHnm4I_GeyNMvYs0EV13oV8,4616
39
- mkdocstrings_matlab-1.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
- mkdocstrings_matlab-1.0.6.dist-info/licenses/LICENSE,sha256=TZQpwBuA3KLH56--XDAY2Qwo9gGdxeTITYhMOylmYhg,743
41
- mkdocstrings_matlab-1.0.6.dist-info/RECORD,,
37
+ mkdocstrings_matlab-1.0.8.dist-info/METADATA,sha256=20c9N9u40rHEqCtm7j-qNsk0yr2XdERHLhJBOnQ4xgo,4616
38
+ mkdocstrings_matlab-1.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ mkdocstrings_matlab-1.0.8.dist-info/licenses/LICENSE,sha256=TZQpwBuA3KLH56--XDAY2Qwo9gGdxeTITYhMOylmYhg,743
40
+ mkdocstrings_matlab-1.0.8.dist-info/RECORD,,
@@ -1,111 +0,0 @@
1
- # This module contains the logger used throughout Griffe.
2
- # The logger is actually a wrapper around the standard Python logger.
3
- # We wrap it so that it is easier for other downstream libraries to patch it.
4
- # For example, mkdocstrings-python patches the logger to relocate it as a child
5
- # of `mkdocs.plugins` so that it fits in the MkDocs logging configuration.
6
- #
7
- # We use a single, global logger because our public API is exposed in a single module, `griffe`.
8
- # Extensions however should use their own logger, which is why we provide the `get_logger` function.
9
-
10
- from __future__ import annotations
11
-
12
- import logging
13
- from contextlib import contextmanager
14
- from typing import TYPE_CHECKING, Any, Callable, ClassVar
15
-
16
- if TYPE_CHECKING:
17
- from collections.abc import Iterator
18
-
19
-
20
- class Logger:
21
- _default_logger: Any = logging.getLogger
22
- _instances: ClassVar[dict[str, Logger]] = {}
23
-
24
- def __init__(self, name: str) -> None:
25
- # Default logger that can be patched by third-party.
26
- self._logger = self.__class__._default_logger(name)
27
-
28
- def __getattr__(self, name: str) -> Any:
29
- # Forward everything to the logger.
30
- return getattr(self._logger, name)
31
-
32
- @contextmanager
33
- def disable(self) -> Iterator[None]:
34
- """Temporarily disable logging."""
35
- old_level = self._logger.level
36
- self._logger.setLevel(100)
37
- try:
38
- yield
39
- finally:
40
- self._logger.setLevel(old_level)
41
-
42
- @classmethod
43
- def _get(cls, name: str = "griffe") -> Logger:
44
- if name not in cls._instances:
45
- cls._instances[name] = cls(name)
46
- return cls._instances[name]
47
-
48
- @classmethod
49
- def _patch_loggers(cls, get_logger_func: Callable) -> None:
50
- # Patch current instances.
51
- for name, instance in cls._instances.items():
52
- instance._logger = get_logger_func(name)
53
-
54
- # Future instances will be patched as well.
55
- cls._default_logger = get_logger_func
56
-
57
-
58
- logger: Logger = Logger._get()
59
- """Our global logger, used throughout the library.
60
-
61
- Griffe's output and error messages are logging messages.
62
-
63
- Griffe provides the [`patch_loggers`][griffe.patch_loggers]
64
- function so dependent libraries can patch Griffe loggers as they see fit.
65
-
66
- For example, to fit in the MkDocs logging configuration
67
- and prefix each log message with the module name:
68
-
69
- ```python
70
- import logging
71
- from griffe import patch_loggers
72
-
73
-
74
- class LoggerAdapter(logging.LoggerAdapter):
75
- def __init__(self, prefix, logger):
76
- super().__init__(logger, {})
77
- self.prefix = prefix
78
-
79
- def process(self, msg, kwargs):
80
- return f"{self.prefix}: {msg}", kwargs
81
-
82
-
83
- def get_logger(name):
84
- logger = logging.getLogger(f"mkdocs.plugins.{name}")
85
- return LoggerAdapter(name, logger)
86
-
87
-
88
- patch_loggers(get_logger)
89
- ```
90
- """
91
-
92
-
93
- def get_logger(name: str = "griffe") -> Logger:
94
- """Create and return a new logger instance.
95
-
96
- Parameters:
97
- name: The logger name.
98
-
99
- Returns:
100
- The logger.
101
- """
102
- return Logger._get(name)
103
-
104
-
105
- def patch_loggers(get_logger_func: Callable[[str], Any]) -> None:
106
- """Patch Griffe logger and Griffe extensions' loggers.
107
-
108
- Parameters:
109
- get_logger_func: A function accepting a name as parameter and returning a logger.
110
- """
111
- Logger._patch_loggers(get_logger_func)