Remove stub commonmark (#13736)

This commit is contained in:
Avasam
2025-03-29 08:29:07 -04:00
committed by GitHub
parent 8c9451154e
commit 4bed4432f9
16 changed files with 0 additions and 438 deletions
@@ -1,2 +0,0 @@
# Testing modules are not included in type stubs
commonmark.tests.*
-6
View File
@@ -1,6 +0,0 @@
version = "0.9.*"
upstream_repository = "https://github.com/rtfd/commonmark.py"
no_longer_updated = true
extra_description = """\
`commonmark` is deprecated in favor of [markdown-it-py](https://pypi.org/project/markdown-it-py/).
See [this issue](https://github.com/readthedocs/commonmark.py/issues/308) for background and discussion."""
-5
View File
@@ -1,5 +0,0 @@
from commonmark.blocks import Parser as Parser
from commonmark.dump import dumpAST as dumpAST, dumpJSON as dumpJSON
from commonmark.main import commonmark as commonmark
from commonmark.render.html import HtmlRenderer as HtmlRenderer
from commonmark.render.rst import ReStructuredTextRenderer as ReStructuredTextRenderer
-171
View File
@@ -1,171 +0,0 @@
import re
from typing import Any, Final, Literal
from .inlines import InlineParser
from .node import Node
CODE_INDENT: Final[int]
reHtmlBlockOpen: Final[list[re.Pattern[str]]]
reHtmlBlockClose: Final[list[re.Pattern[str]]]
reThematicBreak: Final[re.Pattern[str]]
reMaybeSpecial: Final[re.Pattern[str]]
reNonSpace: Final[re.Pattern[str]]
reBulletListMarker: Final[re.Pattern[str]]
reOrderedListMarker: Final[re.Pattern[str]]
reATXHeadingMarker: Final[re.Pattern[str]]
reCodeFence: Final[re.Pattern[str]]
reClosingCodeFence: Final[re.Pattern[str]]
reSetextHeadingLine: Final[re.Pattern[str]]
reLineEnding: Final[re.Pattern[str]]
def is_blank(s: str) -> bool: ...
def is_space_or_tab(s: str) -> bool: ...
def peek(ln: str, pos: int) -> str | None: ...
def ends_with_blank_line(block: Node) -> bool: ...
def parse_list_marker(parser: Parser, container: Node) -> dict[str, Any] | None: ...
def lists_match(list_data: dict[str, Any], item_data: dict[str, Any]) -> bool: ...
class Block:
accepts_lines: bool | None
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> int | None: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> bool | None: ...
class Document(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> bool: ...
class List(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> bool: ...
class BlockQuote(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> bool: ...
class Item(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> bool: ...
class Heading(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> Literal[False]: ...
class ThematicBreak(Block):
accepts_lines: Literal[False]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> Literal[False]: ...
class CodeBlock(Block):
accepts_lines: Literal[True]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0, 1, 2]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> Literal[False]: ...
class HtmlBlock(Block):
accepts_lines: Literal[True]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> Literal[False]: ...
class Paragraph(Block):
accepts_lines: Literal[True]
@staticmethod
def continue_(parser: Parser | None = None, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def finalize(parser: Parser | None = None, block: Node | None = None) -> None: ...
@staticmethod
def can_contain(t: str) -> Literal[False]: ...
class BlockStarts:
METHODS: list[str]
@staticmethod
def block_quote(parser: Parser, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def atx_heading(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
@staticmethod
def fenced_code_block(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
@staticmethod
def html_block(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
@staticmethod
def setext_heading(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
@staticmethod
def thematic_break(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
@staticmethod
def list_item(parser: Parser, container: Node | None = None) -> Literal[0, 1]: ...
@staticmethod
def indented_code_block(parser: Parser, container: Node | None = None) -> Literal[0, 2]: ...
class Parser:
doc: Node
block_starts: BlockStarts
tip: Node
oldtip: Node
current_line: str
line_number: int
offset: int
column: int
next_nonspace: int
next_nonspace_column: int
indent: int
indented: bool
blank: bool
partially_consumed_tab: bool
all_closed: bool
last_matched_container: Node
refmap: dict[str, Any]
last_line_length: int
inline_parser: InlineParser
options: dict[str, Any]
blocks: dict[str, Block]
def __init__(self, options: dict[str, Any] = {}) -> None: ...
def add_line(self) -> None: ...
def add_child(self, tag: str, offset: int) -> Node: ...
def close_unmatched_blocks(self) -> None: ...
def find_next_nonspace(self) -> None: ...
def advance_next_nonspace(self) -> None: ...
def advance_offset(self, count: int, columns: bool) -> None: ...
def incorporate_line(self, ln: str) -> None: ...
def finalize(self, block: Node, line_number: int) -> None: ...
def process_inlines(self, block: Node) -> None: ...
def parse(self, my_input: str) -> Node: ...
CAMEL_RE: Final[re.Pattern[str]]
-1
View File
@@ -1 +0,0 @@
def main() -> None: ...
-39
View File
@@ -1,39 +0,0 @@
import html
import re
from typing import AnyStr, Final, Literal, overload
HTMLunescape = html.unescape
ENTITY: Final[str]
TAGNAME: Final[str]
ATTRIBUTENAME: Final[str]
UNQUOTEDVALUE: Final[str]
SINGLEQUOTEDVALUE: Final[str]
DOUBLEQUOTEDVALUE: Final[str]
ATTRIBUTEVALUE: Final[str]
ATTRIBUTEVALUESPEC: Final[str]
ATTRIBUTE: Final[str]
OPENTAG: Final[str]
CLOSETAG: Final[str]
HTMLCOMMENT: Final[str]
PROCESSINGINSTRUCTION: Final[str]
DECLARATION: Final[str]
CDATA: Final[str]
HTMLTAG: Final[str]
reHtmlTag: Final[re.Pattern[str]]
reBackslashOrAmp: Final[re.Pattern[str]]
ESCAPABLE: Final[str]
reEntityOrEscapedChar: Final[re.Pattern[str]]
XMLSPECIAL: Final[str]
reXmlSpecial: Final[re.Pattern[str]]
def unescape_char(s: AnyStr) -> AnyStr: ...
def unescape_string(s: str) -> str: ...
def normalize_uri(uri: str) -> str: ...
UNSAFE_MAP: Final[dict[str, str]]
def replace_unsafe_char(s: str) -> str: ...
@overload
def escape_xml(s: None) -> Literal[""]: ...
@overload
def escape_xml(s: str) -> str: ...
-7
View File
@@ -1,7 +0,0 @@
from typing import Any
from .node import Node
def prepare(obj: Node, topnode: bool = ...) -> list[dict[str, Any]]: ...
def dumpJSON(obj: Node) -> str: ...
def dumpAST(obj: Node, ind: int = ..., topnode: bool = ...) -> None: ...
@@ -1,3 +0,0 @@
def _unescape(s: str) -> str: ...
__all__ = ["_unescape"]
-68
View File
@@ -1,68 +0,0 @@
import html
import re
from typing import Any, Final, Literal
from .node import Node
HTMLunescape = html.unescape
ESCAPED_CHAR: Final[str]
rePunctuation: Final[re.Pattern[str]]
reLinkTitle: Final[re.Pattern[str]]
reLinkDestinationBraces: Final[re.Pattern[str]]
reEscapable: Final[re.Pattern[str]]
reEntityHere: Final[re.Pattern[str]]
reTicks: Final[re.Pattern[str]]
reTicksHere: Final[re.Pattern[str]]
reEllipses: Final[re.Pattern[str]]
reDash: Final[re.Pattern[str]]
reEmailAutolink: Final[re.Pattern[str]]
reAutolink: Final[re.Pattern[str]]
reSpnl: Final[re.Pattern[str]]
reWhitespaceChar: Final[re.Pattern[str]]
reWhitespace: Final[re.Pattern[str]]
reUnicodeWhitespaceChar: Final[re.Pattern[str]]
reFinalSpace: Final[re.Pattern[str]]
reInitialSpace: Final[re.Pattern[str]]
reSpaceAtEndOfLine: Final[re.Pattern[str]]
reLinkLabel: Final[re.Pattern[str]]
reMain: Final[re.Pattern[str]]
def text(s: str) -> Node: ...
def smart_dashes(chars: str) -> str: ...
class InlineParser:
subject: str
brackets: dict[str, Any] | None
pos: int
refmap: dict[str, Any]
options: dict[str, Any]
def __init__(self, options: dict[str, Any] = {}) -> None: ...
def match(self, regexString: str | re.Pattern[str]) -> str | None: ...
def peek(self) -> str | None: ...
def spnl(self) -> Literal[True]: ...
def parseBackticks(self, block: Node) -> bool: ...
def parseBackslash(self, block: Node) -> Literal[True]: ...
def parseAutolink(self, block: Node) -> bool: ...
def parseHtmlTag(self, block: Node) -> bool: ...
def scanDelims(self, c: str) -> dict[str, Any] | None: ...
delimiters: dict[str, Any]
def handleDelim(self, cc: str, block: Node) -> bool: ...
def removeDelimiter(self, delim: dict[str, Any]) -> None: ...
@staticmethod
def removeDelimitersBetween(bottom: dict[str, Any], top: dict[str, Any]) -> None: ...
def processEmphasis(self, stack_bottom: dict[str, Any]) -> None: ...
def parseLinkTitle(self) -> str | None: ...
def parseLinkDestination(self) -> str | None: ...
def parseLinkLabel(self) -> int: ...
def parseOpenBracket(self, block: Node) -> Literal[True]: ...
def parseBang(self, block: Node) -> Literal[True]: ...
def parseCloseBracket(self, block: Node) -> Literal[True]: ...
def addBracket(self, node: Node, index: int, image: bool | None) -> None: ...
def removeBracket(self) -> None: ...
def parseEntity(self, block: Node) -> bool: ...
def parseString(self, block: Node) -> bool: ...
def parseNewline(self, block: Node) -> Literal[True]: ...
def parseReference(self, s: str, refmap: dict[str, Any]) -> int: ...
def parseInline(self, block: Node) -> bool: ...
def parseInlines(self, block: Node) -> None: ...
parse = parseInlines
-3
View File
@@ -1,3 +0,0 @@
from typing import Literal
def commonmark(text: str, format: Literal["html", "json", "ast", "rst"] = "html") -> str: ...
-53
View File
@@ -1,53 +0,0 @@
import re
from typing import Final
from typing_extensions import Self
reContainer: Final[re.Pattern[str]]
def is_container(node: Node) -> bool: ...
class NodeWalker:
current: Node | None
root: Node
entering: bool
def __init__(self, root: Node) -> None: ...
def __next__(self) -> tuple[Node, bool]: ...
next = __next__
def __iter__(self) -> Self: ...
def nxt(self) -> dict[str, Node | bool] | None: ...
def resume_at(self, node: Node, entering: bool) -> None: ...
class Node:
t: str
parent: Node | None
first_child: Node | None
last_child: Node | None
prv: Node | None
nxt: Node | None
sourcepos: list[list[int]] | None
last_line_blank: bool
last_line_checked: bool
is_open: bool
string_content: str
literal: str | None
list_data: dict[str, str | int | bool | None]
info: str | None
destination: str | None
title: str | None
is_fenced: bool
fence_char: str | None
fence_length: int
fence_offset: int | None
level: int | None
on_enter: str | None
on_exit: str | None
def __init__(self, node_type: str, sourcepos: list[list[int]] | None) -> None: ...
def pretty(self) -> None: ...
def normalize(self) -> None: ...
def is_container(self) -> bool: ...
def append_child(self, child: Node) -> None: ...
def prepend_child(self, child: Node) -> None: ...
def unlink(self) -> None: ...
def insert_after(self, sibling: Node) -> None: ...
def insert_before(self, sibling: Node) -> None: ...
def walker(self) -> NodeWalker: ...
@@ -1,3 +0,0 @@
def normalize_reference(string: str) -> str: ...
__all__ = ["normalize_reference"]
@@ -1,43 +0,0 @@
import re
from builtins import list as _list # conflicts with a method named "list"
from typing import Any, Final, Literal, overload
from commonmark.node import Node
from commonmark.render.renderer import Renderer
reUnsafeProtocol: Final[re.Pattern[str]]
reSafeDataProtocol: Final[re.Pattern[str]]
def potentially_unsafe(url: str) -> bool | None: ...
class HtmlRenderer(Renderer):
disable_tags: int
last_out: str
options: dict[str, Any]
def __init__(self, options: dict[str, Any] = {}) -> None: ...
@overload
def escape(self, text: None) -> Literal[""]: ...
@overload
def escape(self, text: str) -> str: ...
def tag(self, name: str, attrs: _list[_list[str]] | None = None, selfclosing: bool | None = None) -> None: ...
def text(self, node: Node, entering: bool | None = None) -> None: ...
def softbreak(self, node: Node | None = None, entering: bool | None = None) -> None: ...
def linebreak(self, node: Node | None = None, entering: bool | None = None) -> None: ...
def link(self, node: Node, entering: bool | None) -> None: ...
def image(self, node: Node, entering: bool | None) -> None: ...
def emph(self, node: Node, entering: bool | None) -> None: ...
def strong(self, node: Node, entering: bool | None) -> None: ...
def paragraph(self, node: Node, entering: bool | None) -> None: ...
def heading(self, node: Node, entering: bool | None) -> None: ...
def code(self, node: Node, entering: bool | None) -> None: ...
def code_block(self, node: Node, entering: bool | None) -> None: ...
def thematic_break(self, node: Node, entering: bool | None) -> None: ...
def block_quote(self, node: Node, entering: bool | None) -> None: ...
def list(self, node: Node, entering: bool | None) -> None: ...
def item(self, node: Node, entering: bool | None) -> None: ...
def html_inline(self, node: Node, entering: bool | None) -> None: ...
def html_block(self, node: Node, entering: bool | None) -> None: ...
def custom_inline(self, node: Node, entering: bool | None) -> None: ...
def custom_block(self, node: Node, entering: bool | None) -> None: ...
def out(self, s: str | None) -> None: ...
def attrs(self, node: Node) -> _list[_list[str]]: ...
@@ -1,9 +0,0 @@
from commonmark.node import Node
class Renderer:
buf: str
last_out: str
def render(self, ast: Node) -> str: ...
def lit(self, s: str) -> None: ...
def cr(self) -> None: ...
def out(self, s: str) -> None: ...
@@ -1,25 +0,0 @@
from commonmark.node import Node
from commonmark.render.renderer import Renderer
class ReStructuredTextRenderer(Renderer):
indent_char: str
indent_length: int
def __init__(self, indent_char: str = " ") -> None: ...
def lit(self, s: str) -> None: ...
def cr(self) -> None: ...
def indent_lines(self, literal: str, indent_length: int = 4) -> str: ...
def document(self, node: Node | None, entering: bool | None) -> None: ...
def softbreak(self, node: Node | None, entering: bool | None) -> None: ...
def linebreak(self, node: Node | None, entering: bool | None) -> None: ...
def text(self, node: Node, entering: bool | None) -> None: ...
def emph(self, node: Node | None, entering: bool | None) -> None: ...
def strong(self, node: Node | None, entering: bool | None) -> None: ...
def paragraph(self, node: Node, entering: bool | None) -> None: ...
def link(self, node: Node | None, entering: bool | None) -> None: ...
def image(self, node: Node, entering: bool | None) -> None: ...
def code(self, node: Node, entering: bool | None) -> None: ...
def code_block(self, node: Node, entering: bool | None) -> None: ...
def list(self, node: Node | None, entering: bool | None) -> None: ...
def item(self, node: Node, entering: bool | None) -> None: ...
def block_quote(self, node: Node | None, entering: bool | None) -> None: ...
def heading(self, node: Node, entering: bool | None) -> None: ...