Thanks to visit codestin.com
Credit goes to github.com

Skip to content

markdown: add more stubs #4574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions third_party/2and3/markdown/__meta__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

__version_info__: Any
18 changes: 18 additions & 0 deletions third_party/2and3/markdown/blockparser.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Any

class State(list):
def set(self, state) -> None: ...
def reset(self) -> None: ...
def isstate(self, state): ...

class BlockParser:
blockprocessors: Any
state: Any
md: Any
def __init__(self, md) -> None: ...
@property
def markdown(self): ...
root: Any
def parseDocument(self, lines): ...
def parseChunk(self, parent, text) -> None: ...
def parseBlocks(self, parent, blocks) -> None: ...
78 changes: 78 additions & 0 deletions third_party/2and3/markdown/blockprocessors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from typing import Any, Pattern

logger: Any

def build_block_parser(md, **kwargs): ...

class BlockProcessor:
parser: Any
tab_length: Any
def __init__(self, parser) -> None: ...
def lastChild(self, parent): ...
def detab(self, text): ...
def looseDetab(self, text, level: int = ...): ...
def test(self, parent, block) -> None: ...
def run(self, parent, blocks) -> None: ...

class ListIndentProcessor(BlockProcessor):
ITEM_TYPES: Any
LIST_TYPES: Any
INDENT_RE: Pattern
def __init__(self, *args) -> None: ...
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def create_item(self, parent, block) -> None: ...
def get_level(self, parent, block): ...

class CodeBlockProcessor(BlockProcessor):
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class BlockQuoteProcessor(BlockProcessor):
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def clean(self, line): ...

class OListProcessor(BlockProcessor):
TAG: str = ...
STARTSWITH: str = ...
LAZY_OL: bool = ...
SIBLING_TAGS: Any
RE: Pattern
CHILD_RE: Pattern
INDENT_RE: Pattern
def __init__(self, parser) -> None: ...
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def get_items(self, block): ...

class UListProcessor(OListProcessor):
TAG: str = ...
RE: Pattern
def __init__(self, parser) -> None: ...

class HashHeaderProcessor(BlockProcessor):
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class SetextHeaderProcessor(BlockProcessor):
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class HRProcessor(BlockProcessor):
RE: str = ...
SEARCH_RE: Pattern
match: Any
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class EmptyBlockProcessor(BlockProcessor):
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class ParagraphProcessor(BlockProcessor):
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
2 changes: 1 addition & 1 deletion third_party/2and3/markdown/extensions/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Mapping, Sequence

from ..core import Markdown
from markdown.core import Markdown

class Extension:
config: Mapping[str, str] = ...
Expand Down
20 changes: 20 additions & 0 deletions third_party/2and3/markdown/extensions/abbr.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor
from markdown.preprocessors import Preprocessor

ABBR_REF_RE: Pattern

class AbbrExtension(Extension):
def extendMarkdown(self, md) -> None: ...

class AbbrPreprocessor(Preprocessor):
def run(self, lines): ...

class AbbrInlineProcessor(InlineProcessor):
title: Any
def __init__(self, pattern, title) -> None: ...
def handleMatch(self, m, data): ... # type: ignore

def makeExtension(**kwargs): ...
18 changes: 18 additions & 0 deletions third_party/2and3/markdown/extensions/admonition.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Any, Pattern

from markdown.blockprocessors import BlockProcessor
from markdown.extensions import Extension

class AdmonitionExtension(Extension):
def extendMarkdown(self, md) -> None: ...

class AdmonitionProcessor(BlockProcessor):
CLASSNAME: str = ...
CLASSNAME_TITLE: str = ...
RE: Pattern
RE_SPACES: Any
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def get_class_and_title(self, match): ...

def makeExtension(**kwargs): ...
22 changes: 22 additions & 0 deletions third_party/2and3/markdown/extensions/attr_list.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

def get_attrs(str): ...
def isheader(elem): ...

class AttrListTreeprocessor(Treeprocessor):
BASE_RE: str = ...
HEADER_RE: Pattern
BLOCK_RE: Pattern
INLINE_RE: Pattern
NAME_RE: Pattern
def run(self, doc) -> None: ...
def assign_attrs(self, elem, attrs) -> None: ...
def sanitize_name(self, name): ...

class AttrListExtension(Extension):
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
45 changes: 45 additions & 0 deletions third_party/2and3/markdown/extensions/codehilite.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from typing import Any, Optional

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

pygments: bool

def parse_hl_lines(expr): ...

class CodeHilite:
src: Any
lang: Any
linenums: Any
guess_lang: Any
css_class: Any
style: Any
noclasses: Any
tab_length: Any
hl_lines: Any
use_pygments: Any
def __init__(
self,
src: Optional[Any] = ...,
linenums: Optional[Any] = ...,
guess_lang: bool = ...,
css_class: str = ...,
lang: Optional[Any] = ...,
style: str = ...,
noclasses: bool = ...,
tab_length: int = ...,
hl_lines: Optional[Any] = ...,
use_pygments: bool = ...,
) -> None: ...
def hilite(self): ...

class HiliteTreeprocessor(Treeprocessor):
def code_unescape(self, text): ...
def run(self, root) -> None: ...

class CodeHiliteExtension(Extension):
config: Any
def __init__(self, **kwargs) -> None: ...
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
20 changes: 20 additions & 0 deletions third_party/2and3/markdown/extensions/def_list.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Any, Pattern

from markdown.blockprocessors import BlockProcessor, ListIndentProcessor
from markdown.extensions import Extension

class DefListProcessor(BlockProcessor):
RE: Pattern
NO_INDENT_RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks): ...

class DefListIndentProcessor(ListIndentProcessor):
ITEM_TYPES: Any
LIST_TYPES: Any
def create_item(self, parent, block) -> None: ...

class DefListExtension(Extension):
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
12 changes: 12 additions & 0 deletions third_party/2and3/markdown/extensions/extra.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import Any

from markdown.extensions import Extension

extensions: Any

class ExtraExtension(Extension):
config: Any
def __init__(self, **kwargs) -> None: ...
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
18 changes: 18 additions & 0 deletions third_party/2and3/markdown/extensions/fenced_code.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor

class FencedCodeExtension(Extension):
def extendMarkdown(self, md) -> None: ...

class FencedBlockPreprocessor(Preprocessor):
FENCED_BLOCK_RE: Pattern
CODE_WRAP: str = ...
LANG_TAG: str = ...
checked_for_codehilite: bool = ...
codehilite_conf: Any
def __init__(self, md) -> None: ...
def run(self, lines): ...

def makeExtension(**kwargs): ...
64 changes: 64 additions & 0 deletions third_party/2and3/markdown/extensions/footnotes.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor
from markdown.postprocessors import Postprocessor
from markdown.preprocessors import Preprocessor
from markdown.treeprocessors import Treeprocessor

FN_BACKLINK_TEXT: Any
NBSP_PLACEHOLDER: Any
DEF_RE: Pattern
TABBED_RE: Pattern
RE_REF_ID: Any

class FootnoteExtension(Extension):
config: Any
unique_prefix: int = ...
found_refs: Any
used_refs: Any
def __init__(self, **kwargs) -> None: ...
parser: Any
md: Any
def extendMarkdown(self, md) -> None: ...
footnotes: Any
def reset(self) -> None: ...
def unique_ref(self, reference, found: bool = ...): ...
def findFootnotesPlaceholder(self, root): ...
def setFootnote(self, id, text) -> None: ...
def get_separator(self): ...
def makeFootnoteId(self, id): ...
def makeFootnoteRefId(self, id, found: bool = ...): ...
def makeFootnotesDiv(self, root): ...

class FootnotePreprocessor(Preprocessor):
footnotes: Any
def __init__(self, footnotes) -> None: ...
def run(self, lines): ...
def detectTabbed(self, lines): ...

class FootnoteInlineProcessor(InlineProcessor):
footnotes: Any
def __init__(self, pattern, footnotes) -> None: ...
def handleMatch(self, m, data): ... # type: ignore

class FootnotePostTreeprocessor(Treeprocessor):
footnotes: Any
def __init__(self, footnotes) -> None: ...
def add_duplicates(self, li, duplicates) -> None: ...
def get_num_duplicates(self, li): ...
def handle_duplicates(self, parent) -> None: ...
offset: int = ...
def run(self, root) -> None: ...

class FootnoteTreeprocessor(Treeprocessor):
footnotes: Any
def __init__(self, footnotes) -> None: ...
def run(self, root) -> None: ...

class FootnotePostprocessor(Postprocessor):
footnotes: Any
def __init__(self, footnotes) -> None: ...
def run(self, text): ...

def makeExtension(**kwargs): ...
15 changes: 15 additions & 0 deletions third_party/2and3/markdown/extensions/legacy_attrs.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

ATTR_RE: Pattern

class LegacyAttrs(Treeprocessor):
def run(self, doc) -> None: ...
def handleAttributes(self, el, txt): ...

class LegacyAttrExtension(Extension):
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
16 changes: 16 additions & 0 deletions third_party/2and3/markdown/extensions/legacy_em.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Any

from markdown.extensions import Extension
from markdown.inlinepatterns import UnderscoreProcessor

EMPHASIS_RE: str
STRONG_RE: str
STRONG_EM_RE: str

class LegacyUnderscoreProcessor(UnderscoreProcessor):
PATTERNS: Any

class LegacyEmExtension(Extension):
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
13 changes: 13 additions & 0 deletions third_party/2and3/markdown/extensions/md_in_html.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from typing import Any, Optional

from markdown.blockprocessors import BlockProcessor
from markdown.extensions import Extension

class MarkdownInHtmlProcessor(BlockProcessor):
def test(self, parent, block): ...
def run(self, parent, blocks, tail: Optional[Any] = ..., nest: bool = ...) -> None: ...

class MarkdownInHtmlExtension(Extension):
def extendMarkdown(self, md) -> None: ...

def makeExtension(**kwargs): ...
Loading