o
    i                     @  s   d Z ddlmZ dZddlZddlmZmZmZ dZ	e	r.ddl
mZ ddlmZ dd	lmZ G d
d deZdddddddddddddZdddZdS )z0
This package contains Docutils parser modules.
    )annotationsreStructuredTextN)	Componentfrontend
transformsF)Final)nodes)	Transformc                      s   e Zd ZU ddddgdddejdfd	d
gddifddgdddejdfddgddifddgdddejdfddgdejdfddgdddfffZdZd ed!< d"Z	d ed#< d3 fd&d'Z
d4d-d.Zd4d/d0Zd5d1d2Z  ZS )6ParserzGeneric Parser OptionsNzjDisable directives that insert the contents of an external file; replaced with a "warning" system message.z--no-file-insertionstore_falseTfile_insertion_enabled)actiondefaultdest	validatorzIEnable directives that insert the contents of an external file. (default)z--file-insertion-enabledr   
store_truezFDisable the "raw" directive; replaced with a "warning" system message.z--no-rawraw_enabledz%Enable the "raw" directive. (default)z--raw-enabledz>Maximal number of characters in an input line. Default 10 000.z--line-length-limitz<length>int'  )metavartyper   r   z)Validate the document tree after parsing.z
--validate)r   r   z,Do not validate the document tree. (default)z--no-validationvalidate)r   r   parserr   component_typeparsersconfig_sectionreturnlist[type[Transform]]c                   s   t   tjjg S )N)superget_transformsr   	universalValidateself	__class__ _/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/docutils/parsers/__init__.pyr   ?   s   zParser.get_transformsinputstringstrdocumentnodes.documentNonec                 C  s   t d)z>Override to parse `inputstring` into document tree `document`.z"subclass must override this method)NotImplementedErrorr#   r(   r*   r&   r&   r'   parseB   s   zParser.parsec                 C  sH   || _ |jdd |jdd |jdd || _|j|j dS )z6Initial parse setup.  Call at start of `self.parse()`.r   Fr   line_length_limitr   N)r(   settings
setdefaultr*   reporterattach_observernote_parse_messager.   r&   r&   r'   setup_parseF   s   zParser.setup_parsec                 C  s   | j j| j j dS )z7Finalize parse details.  Call at end of `self.parse()`.N)r*   r3   detach_observerr5   r"   r&   r&   r'   finish_parseP   s   zParser.finish_parse)r   r   )r(   r)   r*   r+   r   r,   )r   r,   )__name__
__module____qualname__r   validate_booleanvalidate_nonnegative_intsettings_specr   __annotations__r   r   r/   r6   r8   __classcell__r&   r&   r$   r'   r
      s`   
 "


r
   zdocutils.parsers.nullzdocutils.parsers.rstzdocutils.parsers.docutils_xmlz%docutils.parsers.recommonmark_wrapperzmyst_parser.docutils_z#docutils.parsers.commonmark_wrapper)nullrstrestructuredtextrestrestxrtxtdocutils_xmlxmlrecommonmarkmyst
commonmarkmarkdownparser_namer)   r   type[Parser]c              
   C  sR   |   }ztt||}W |jS  ty( } ztd|  d| |d}~ww )z6Return the Parser class from the `parser_name` module.zParser "z" not found. N)lower	importlibimport_modulePARSER_ALIASESgetImportErrorr
   )rM   namemoduleerrr&   r&   r'   get_parser_classk   s   rX   )rM   r)   r   rN   )__doc__
__future__r   __docformat__rP   docutilsr   r   r   TYPE_CHECKINGtypingr   r   docutils.transformsr	   r
   rR   rX   r&   r&   r&   r'   <module>   s2   >