Skip to content

Commit 06556e3

Browse files
authored
feat: Add Markdown docstring-style support
PR #121: #121
1 parent 8fb86d6 commit 06556e3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: src/pytkdocs/parsers/docstrings/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from pytkdocs.parsers.docstrings.base import Parser, UnavailableParser
66
from pytkdocs.parsers.docstrings.google import Google
7+
from pytkdocs.parsers.docstrings.markdown import Markdown
78
from pytkdocs.parsers.docstrings.restructured_text import RestructuredText
89

910
try:
@@ -18,4 +19,5 @@
1819
"google": Google,
1920
"restructured-text": RestructuredText,
2021
"numpy": Numpy,
22+
"markdown": Markdown,
2123
}

Diff for: src/pytkdocs/parsers/docstrings/markdown.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""This module defines functions and classes to parse docstrings into structured data."""
2+
3+
from typing import List
4+
5+
from pytkdocs.parsers.docstrings.base import Parser, Section
6+
7+
8+
class Markdown(Parser):
9+
"""A Markdown docstrings parser."""
10+
11+
def parse_sections(self, docstring: str) -> List[Section]: # noqa: D102
12+
return [Section(Section.Type.MARKDOWN, docstring)]

0 commit comments

Comments
 (0)