Skip to content
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

add 'paragraph' node to docutils #10102

Merged
merged 5 commits into from
May 3, 2023
Merged
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
12 changes: 11 additions & 1 deletion stubs/docutils/docutils/nodes.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import sys
import xml.dom.minidom
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from typing import Any, ClassVar, Protocol, TypeVar, overload
from typing_extensions import Literal, Self
from typing_extensions import Literal, Self, SupportsIndex

from docutils.transforms import Transformer

Expand Down Expand Up @@ -79,6 +80,7 @@ class Node:

class Element(Node):
children: list[Node]
rawsource: str
def __init__(self, rawsource: str = "", *children: Node, **attributes): ...
def __len__(self) -> int: ...
def __contains__(self, key: str | Node) -> bool: ...
Expand All @@ -105,8 +107,14 @@ class Element(Node):
def deepcopy(self) -> Self: ...
def pformat(self, indent: str = " ", level: int = 0) -> str: ...
def astext(self) -> str: ...
def index(self, item: Node, start: int = 0, stop: int = sys.maxsize) -> int: ...
def remove(self, item: Node) -> None: ...
def insert(self, index: SupportsIndex, item: Node | Iterable[Node] | None) -> None: ...
def __getattr__(self, __name: str) -> Incomplete: ...

class TextElement(Element):
def __init__(self, rawsource: str = "", text: str = "", *children: Node, **attributes) -> None: ...

class Text(Node, str):
tagname: ClassVar[str]
children: tuple[()]
Expand Down Expand Up @@ -135,6 +143,8 @@ class document(Root, Structural, Element):
def astext(self) -> str: ...
def __getattr__(self, __name: str) -> Incomplete: ...

class paragraph(General, TextElement): ...

class NodeVisitor:
def __init__(self, document: document): ...
def __getattr__(self, __name: str) -> Incomplete: ...
Expand Down