Skip to content

Commit cb6549f

Browse files
authored
markdown: add more stubs (#4574)
Co-authored-by: hauntsaninja <>
1 parent 675ab77 commit cb6549f

29 files changed

+820
-1
lines changed
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from typing import Any
2+
3+
__version_info__: Any
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Any
2+
3+
class State(list):
4+
def set(self, state) -> None: ...
5+
def reset(self) -> None: ...
6+
def isstate(self, state): ...
7+
8+
class BlockParser:
9+
blockprocessors: Any
10+
state: Any
11+
md: Any
12+
def __init__(self, md) -> None: ...
13+
@property
14+
def markdown(self): ...
15+
root: Any
16+
def parseDocument(self, lines): ...
17+
def parseChunk(self, parent, text) -> None: ...
18+
def parseBlocks(self, parent, blocks) -> None: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
from typing import Any, Pattern
2+
3+
logger: Any
4+
5+
def build_block_parser(md, **kwargs): ...
6+
7+
class BlockProcessor:
8+
parser: Any
9+
tab_length: Any
10+
def __init__(self, parser) -> None: ...
11+
def lastChild(self, parent): ...
12+
def detab(self, text): ...
13+
def looseDetab(self, text, level: int = ...): ...
14+
def test(self, parent, block) -> None: ...
15+
def run(self, parent, blocks) -> None: ...
16+
17+
class ListIndentProcessor(BlockProcessor):
18+
ITEM_TYPES: Any
19+
LIST_TYPES: Any
20+
INDENT_RE: Pattern
21+
def __init__(self, *args) -> None: ...
22+
def test(self, parent, block): ...
23+
def run(self, parent, blocks) -> None: ...
24+
def create_item(self, parent, block) -> None: ...
25+
def get_level(self, parent, block): ...
26+
27+
class CodeBlockProcessor(BlockProcessor):
28+
def test(self, parent, block): ...
29+
def run(self, parent, blocks) -> None: ...
30+
31+
class BlockQuoteProcessor(BlockProcessor):
32+
RE: Pattern
33+
def test(self, parent, block): ...
34+
def run(self, parent, blocks) -> None: ...
35+
def clean(self, line): ...
36+
37+
class OListProcessor(BlockProcessor):
38+
TAG: str = ...
39+
STARTSWITH: str = ...
40+
LAZY_OL: bool = ...
41+
SIBLING_TAGS: Any
42+
RE: Pattern
43+
CHILD_RE: Pattern
44+
INDENT_RE: Pattern
45+
def __init__(self, parser) -> None: ...
46+
def test(self, parent, block): ...
47+
def run(self, parent, blocks) -> None: ...
48+
def get_items(self, block): ...
49+
50+
class UListProcessor(OListProcessor):
51+
TAG: str = ...
52+
RE: Pattern
53+
def __init__(self, parser) -> None: ...
54+
55+
class HashHeaderProcessor(BlockProcessor):
56+
RE: Pattern
57+
def test(self, parent, block): ...
58+
def run(self, parent, blocks) -> None: ...
59+
60+
class SetextHeaderProcessor(BlockProcessor):
61+
RE: Pattern
62+
def test(self, parent, block): ...
63+
def run(self, parent, blocks) -> None: ...
64+
65+
class HRProcessor(BlockProcessor):
66+
RE: str = ...
67+
SEARCH_RE: Pattern
68+
match: Any
69+
def test(self, parent, block): ...
70+
def run(self, parent, blocks) -> None: ...
71+
72+
class EmptyBlockProcessor(BlockProcessor):
73+
def test(self, parent, block): ...
74+
def run(self, parent, blocks) -> None: ...
75+
76+
class ParagraphProcessor(BlockProcessor):
77+
def test(self, parent, block): ...
78+
def run(self, parent, blocks) -> None: ...

third_party/2and3/markdown/extensions/__init__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Mapping, Sequence
22

3-
from ..core import Markdown
3+
from markdown.core import Markdown
44

55
class Extension:
66
config: Mapping[str, str] = ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.extensions import Extension
4+
from markdown.inlinepatterns import InlineProcessor
5+
from markdown.preprocessors import Preprocessor
6+
7+
ABBR_REF_RE: Pattern
8+
9+
class AbbrExtension(Extension):
10+
def extendMarkdown(self, md) -> None: ...
11+
12+
class AbbrPreprocessor(Preprocessor):
13+
def run(self, lines): ...
14+
15+
class AbbrInlineProcessor(InlineProcessor):
16+
title: Any
17+
def __init__(self, pattern, title) -> None: ...
18+
def handleMatch(self, m, data): ... # type: ignore
19+
20+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.blockprocessors import BlockProcessor
4+
from markdown.extensions import Extension
5+
6+
class AdmonitionExtension(Extension):
7+
def extendMarkdown(self, md) -> None: ...
8+
9+
class AdmonitionProcessor(BlockProcessor):
10+
CLASSNAME: str = ...
11+
CLASSNAME_TITLE: str = ...
12+
RE: Pattern
13+
RE_SPACES: Any
14+
def test(self, parent, block): ...
15+
def run(self, parent, blocks) -> None: ...
16+
def get_class_and_title(self, match): ...
17+
18+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.extensions import Extension
4+
from markdown.treeprocessors import Treeprocessor
5+
6+
def get_attrs(str): ...
7+
def isheader(elem): ...
8+
9+
class AttrListTreeprocessor(Treeprocessor):
10+
BASE_RE: str = ...
11+
HEADER_RE: Pattern
12+
BLOCK_RE: Pattern
13+
INLINE_RE: Pattern
14+
NAME_RE: Pattern
15+
def run(self, doc) -> None: ...
16+
def assign_attrs(self, elem, attrs) -> None: ...
17+
def sanitize_name(self, name): ...
18+
19+
class AttrListExtension(Extension):
20+
def extendMarkdown(self, md) -> None: ...
21+
22+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from typing import Any, Optional
2+
3+
from markdown.extensions import Extension
4+
from markdown.treeprocessors import Treeprocessor
5+
6+
pygments: bool
7+
8+
def parse_hl_lines(expr): ...
9+
10+
class CodeHilite:
11+
src: Any
12+
lang: Any
13+
linenums: Any
14+
guess_lang: Any
15+
css_class: Any
16+
style: Any
17+
noclasses: Any
18+
tab_length: Any
19+
hl_lines: Any
20+
use_pygments: Any
21+
def __init__(
22+
self,
23+
src: Optional[Any] = ...,
24+
linenums: Optional[Any] = ...,
25+
guess_lang: bool = ...,
26+
css_class: str = ...,
27+
lang: Optional[Any] = ...,
28+
style: str = ...,
29+
noclasses: bool = ...,
30+
tab_length: int = ...,
31+
hl_lines: Optional[Any] = ...,
32+
use_pygments: bool = ...,
33+
) -> None: ...
34+
def hilite(self): ...
35+
36+
class HiliteTreeprocessor(Treeprocessor):
37+
def code_unescape(self, text): ...
38+
def run(self, root) -> None: ...
39+
40+
class CodeHiliteExtension(Extension):
41+
config: Any
42+
def __init__(self, **kwargs) -> None: ...
43+
def extendMarkdown(self, md) -> None: ...
44+
45+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.blockprocessors import BlockProcessor, ListIndentProcessor
4+
from markdown.extensions import Extension
5+
6+
class DefListProcessor(BlockProcessor):
7+
RE: Pattern
8+
NO_INDENT_RE: Pattern
9+
def test(self, parent, block): ...
10+
def run(self, parent, blocks): ...
11+
12+
class DefListIndentProcessor(ListIndentProcessor):
13+
ITEM_TYPES: Any
14+
LIST_TYPES: Any
15+
def create_item(self, parent, block) -> None: ...
16+
17+
class DefListExtension(Extension):
18+
def extendMarkdown(self, md) -> None: ...
19+
20+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from typing import Any
2+
3+
from markdown.extensions import Extension
4+
5+
extensions: Any
6+
7+
class ExtraExtension(Extension):
8+
config: Any
9+
def __init__(self, **kwargs) -> None: ...
10+
def extendMarkdown(self, md) -> None: ...
11+
12+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.extensions import Extension
4+
from markdown.preprocessors import Preprocessor
5+
6+
class FencedCodeExtension(Extension):
7+
def extendMarkdown(self, md) -> None: ...
8+
9+
class FencedBlockPreprocessor(Preprocessor):
10+
FENCED_BLOCK_RE: Pattern
11+
CODE_WRAP: str = ...
12+
LANG_TAG: str = ...
13+
checked_for_codehilite: bool = ...
14+
codehilite_conf: Any
15+
def __init__(self, md) -> None: ...
16+
def run(self, lines): ...
17+
18+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.extensions import Extension
4+
from markdown.inlinepatterns import InlineProcessor
5+
from markdown.postprocessors import Postprocessor
6+
from markdown.preprocessors import Preprocessor
7+
from markdown.treeprocessors import Treeprocessor
8+
9+
FN_BACKLINK_TEXT: Any
10+
NBSP_PLACEHOLDER: Any
11+
DEF_RE: Pattern
12+
TABBED_RE: Pattern
13+
RE_REF_ID: Any
14+
15+
class FootnoteExtension(Extension):
16+
config: Any
17+
unique_prefix: int = ...
18+
found_refs: Any
19+
used_refs: Any
20+
def __init__(self, **kwargs) -> None: ...
21+
parser: Any
22+
md: Any
23+
def extendMarkdown(self, md) -> None: ...
24+
footnotes: Any
25+
def reset(self) -> None: ...
26+
def unique_ref(self, reference, found: bool = ...): ...
27+
def findFootnotesPlaceholder(self, root): ...
28+
def setFootnote(self, id, text) -> None: ...
29+
def get_separator(self): ...
30+
def makeFootnoteId(self, id): ...
31+
def makeFootnoteRefId(self, id, found: bool = ...): ...
32+
def makeFootnotesDiv(self, root): ...
33+
34+
class FootnotePreprocessor(Preprocessor):
35+
footnotes: Any
36+
def __init__(self, footnotes) -> None: ...
37+
def run(self, lines): ...
38+
def detectTabbed(self, lines): ...
39+
40+
class FootnoteInlineProcessor(InlineProcessor):
41+
footnotes: Any
42+
def __init__(self, pattern, footnotes) -> None: ...
43+
def handleMatch(self, m, data): ... # type: ignore
44+
45+
class FootnotePostTreeprocessor(Treeprocessor):
46+
footnotes: Any
47+
def __init__(self, footnotes) -> None: ...
48+
def add_duplicates(self, li, duplicates) -> None: ...
49+
def get_num_duplicates(self, li): ...
50+
def handle_duplicates(self, parent) -> None: ...
51+
offset: int = ...
52+
def run(self, root) -> None: ...
53+
54+
class FootnoteTreeprocessor(Treeprocessor):
55+
footnotes: Any
56+
def __init__(self, footnotes) -> None: ...
57+
def run(self, root) -> None: ...
58+
59+
class FootnotePostprocessor(Postprocessor):
60+
footnotes: Any
61+
def __init__(self, footnotes) -> None: ...
62+
def run(self, text): ...
63+
64+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import Any, Pattern
2+
3+
from markdown.extensions import Extension
4+
from markdown.treeprocessors import Treeprocessor
5+
6+
ATTR_RE: Pattern
7+
8+
class LegacyAttrs(Treeprocessor):
9+
def run(self, doc) -> None: ...
10+
def handleAttributes(self, el, txt): ...
11+
12+
class LegacyAttrExtension(Extension):
13+
def extendMarkdown(self, md) -> None: ...
14+
15+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from typing import Any
2+
3+
from markdown.extensions import Extension
4+
from markdown.inlinepatterns import UnderscoreProcessor
5+
6+
EMPHASIS_RE: str
7+
STRONG_RE: str
8+
STRONG_EM_RE: str
9+
10+
class LegacyUnderscoreProcessor(UnderscoreProcessor):
11+
PATTERNS: Any
12+
13+
class LegacyEmExtension(Extension):
14+
def extendMarkdown(self, md) -> None: ...
15+
16+
def makeExtension(**kwargs): ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing import Any, Optional
2+
3+
from markdown.blockprocessors import BlockProcessor
4+
from markdown.extensions import Extension
5+
6+
class MarkdownInHtmlProcessor(BlockProcessor):
7+
def test(self, parent, block): ...
8+
def run(self, parent, blocks, tail: Optional[Any] = ..., nest: bool = ...) -> None: ...
9+
10+
class MarkdownInHtmlExtension(Extension):
11+
def extendMarkdown(self, md) -> None: ...
12+
13+
def makeExtension(**kwargs): ...

0 commit comments

Comments
 (0)