Skip to content
1 change: 1 addition & 0 deletions stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ docutils.nodes.GenericNodeVisitor.__getattr__
# these methods take a rawsource parameter that has been deprecated and is completely ignored, so we omit it from the stub
docutils.nodes.Text.__new__
docutils.parsers.recommonmark_wrapper
docutils.parsers.rst.directives.misc.MetaBody.__getattr__
docutils.transforms.Transform.__getattr__
docutils.transforms.Transformer.__getattr__
docutils.TransformSpec.unknown_reference_resolvers
35 changes: 34 additions & 1 deletion stubs/docutils/docutils/parsers/rst/directives/misc.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
from _typeshed import Incomplete
from pathlib import Path
from re import Pattern
from typing import ClassVar

def __getattr__(name: str) -> Incomplete: ...
from docutils.parsers.rst import Directive
from docutils.parsers.rst.states import SpecializedBody

__docformat__: str

class Include(Directive):
standard_include_path: Path

class Raw(Directive): ...
class Replace(Directive): ...

class Unicode(Directive):
comment_pattern: Pattern[str]

class Class(Directive): ...

class Role(Directive):
argument_pattern: Pattern[str]

class DefaultRole(Directive): ...
class Title(Directive): ...

# SpecializedBody has not yet been stubbed
class MetaBody(SpecializedBody): # pyright: ignore[reportUntypedBaseClass]
def __getattr__(self, name: str) -> Incomplete: ...

class Meta(Directive):
SMkwargs: ClassVar[dict[str, tuple[MetaBody]]]

class Date(Directive): ...
class TestDirective(Directive): ...