Skip to content

docstring

Docstring

Bases: MdObj

Add a docstring to the page.

Source code in mkreports/md/docstring.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@register_md("Docstring")
class Docstring(MdObj):
    """Add a docstring to the page."""

    def __init__(self, obj_name: str) -> None:
        """
        Docstring for the page.

        Args:
            obj_name (str): Name of the object for which a docstring should be added.
        """
        super().__init__()
        self.obj_name = obj_name

        cont_settings = Settings(
            mkdocs={
                "plugins": [
                    "search",
                    "mkdocstrings",
                ]
            }
        )
        self._body = SpacedText(f"::: {self.obj_name}", (2, 2))
        self._back = None
        self._settings = cont_settings

__init__(obj_name)

Docstring for the page.

Parameters:

Name Type Description Default
obj_name str

Name of the object for which a docstring should be added.

required
Source code in mkreports/md/docstring.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def __init__(self, obj_name: str) -> None:
    """
    Docstring for the page.

    Args:
        obj_name (str): Name of the object for which a docstring should be added.
    """
    super().__init__()
    self.obj_name = obj_name

    cont_settings = Settings(
        mkdocs={
            "plugins": [
                "search",
                "mkdocstrings",
            ]
        }
    )
    self._body = SpacedText(f"::: {self.obj_name}", (2, 2))
    self._back = None
    self._settings = cont_settings