mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Contributed stubs for markdown package (#4426)
Co-authored-by: Eric Traut <erictr@microsoft.com> Co-authored-by: hauntsaninja <>
This commit is contained in:
1
third_party/2and3/markdown/__init__.pyi
vendored
Normal file
1
third_party/2and3/markdown/__init__.pyi
vendored
Normal file
@@ -0,0 +1 @@
|
||||
from .core import Markdown as Markdown, markdown as markdown, markdownFromFile as markdownFromFile
|
||||
49
third_party/2and3/markdown/core.pyi
vendored
Normal file
49
third_party/2and3/markdown/core.pyi
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
from typing import BinaryIO, Mapping, Optional, Sequence, Text, TextIO, Union
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .extensions import Extension
|
||||
|
||||
class Markdown:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, str]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
def build_parser(self) -> Markdown: ...
|
||||
def registerExtensions(
|
||||
self, extensions: Sequence[Union[Extension, str]], configs: Mapping[str, Mapping[str, str]]
|
||||
) -> Markdown: ...
|
||||
def build_extension(self, ext_name: Text, configs: Mapping[str, str]) -> Extension: ...
|
||||
def registerExtension(self, extension: Extension) -> Markdown: ...
|
||||
def reset(self: Markdown) -> Markdown: ...
|
||||
def set_output_format(self, format: Literal["xhtml", "html"]) -> Markdown: ...
|
||||
def is_block_level(self, tag: str) -> bool: ...
|
||||
def convert(self, source: Text) -> Text: ...
|
||||
def convertFile(
|
||||
self,
|
||||
input: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
output: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
) -> Markdown: ...
|
||||
|
||||
def markdown(
|
||||
text: Text,
|
||||
*,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, str]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
) -> Text: ...
|
||||
def markdownFromFile(
|
||||
*,
|
||||
input: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
output: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, str]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
13
third_party/2and3/markdown/extensions/__init__.pyi
vendored
Normal file
13
third_party/2and3/markdown/extensions/__init__.pyi
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Mapping, Sequence
|
||||
|
||||
from ..core import Markdown
|
||||
|
||||
class Extension:
|
||||
config: Mapping[str, str] = ...
|
||||
def __init__(self, **kwargs: Mapping[str, str]) -> None: ...
|
||||
def getConfig(self, key: str, default: str = ...) -> str: ...
|
||||
def getConfigs(self) -> Mapping[str, str]: ...
|
||||
def getConfigInfo(self) -> Sequence[Mapping[str, str]]: ...
|
||||
def setConfig(self, key: str, value: str) -> None: ...
|
||||
def setConfigs(self, items: Mapping[str, str]) -> None: ...
|
||||
def extendMarkdown(self, md: Markdown) -> None: ...
|
||||
Reference in New Issue
Block a user