Skip to content

markdown

This module defines functions and classes to parse docstrings into structured data.

Markdown (Parser) ¤

A Markdown docstrings parser.

Source code in pytkdocs/parsers/docstrings/markdown.py
class Markdown(Parser):
    """A Markdown docstrings parser."""

    def parse_sections(self, docstring: str) -> List[Section]:  # noqa: D102
        return [Section(Section.Type.MARKDOWN, docstring)]

parse_sections(self, docstring) ¤

Parse a docstring as a list of sections.

Parameters:

Name Type Description Default
docstring str

The docstring to parse.

required

Returns:

Type Description
List[pytkdocs.parsers.docstrings.base.Section]

A list of Sections.

Source code in pytkdocs/parsers/docstrings/markdown.py
def parse_sections(self, docstring: str) -> List[Section]:  # noqa: D102
    return [Section(Section.Type.MARKDOWN, docstring)]
Back to top