You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow directive source extraction without defining a docutils directive #1232
Source-analysis tools need to split MyST directive options from the body and use body_offset, without rendering a directive or validating against an installed extension.
Currently parse_directive_text() requires type[Directive]. Accepting arbitrary string options therefore requires a placeholder directive subclass and custom truthy option_spec mapping, even though no directive instance is ever needed. The placeholder also inherits docutils' abstract run() contract. Separately, DirectiveParsingResult.options is annotated as a bare dict, exposing unknown key/value types to strict downstream checkers.
Proposed fix: allow directive_class=None to parse arbitrary options as strings using the normal option tokenizer and offset handling. Preserve syntax warnings, colon/YAML option blocks, empty flags and additional_options precedence. Existing calls with a directive class should retain their current behavior, including option conversion. Make the result generic so schema-free parsing exposes dict[str, str] to type checkers while directive converters and full-YAML mode can still return arbitrary values.
Activity