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
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from typing import Any
2+
3+
__version_info__: Any
Lines changed: 18 additions & 0 deletions
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: ...
Lines changed: 78 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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] = ...
Lines changed: 20 additions & 0 deletions
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): ...
Lines changed: 18 additions & 0 deletions
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): ...
Lines changed: 22 additions & 0 deletions
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): ...
Lines changed: 45 additions & 0 deletions
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): ...
Lines changed: 20 additions & 0 deletions
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): ...
Lines changed: 12 additions & 0 deletions
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): ...

0 commit comments

Comments
 (0)