U
    ZSh                     @   sZ   d Z dZddlmZ ddlmZmZ G dd deZddddddd	d
ddd
Zdd Z	dS )z0
This package contains Docutils parser modules.
reStructuredText    )import_module)	Componentfrontendc                   @   s   e Zd Z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ffZdZdZdd Z	dd Z
dd ZdS ) ParserzGeneric Parser OptionsNzjDisable directives that insert the contents of an external file; replaced with a "warning" system message.z--no-file-insertionstore_false   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   parserparsersc                 C   s   t ddS )z>Override to parse `inputstring` into document tree `document`.z"subclass must override this methodN)NotImplementedErrorselfinputstringdocument r   L/root/rtd-docs/venv/lib/python3.8/site-packages/docutils/parsers/__init__.pyparse/   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   Zline_length_limitr   N)r   settings
setdefaultr   reporterZattach_observernote_parse_messager   r   r   r   setup_parse3   s    zParser.setup_parsec                 C   s   | j j| j j dS )z7Finalize parse details.  Call at end of `self.parse()`.N)r   r    Zdetach_observerr!   )r   r   r   r   finish_parse=   s    zParser.finish_parse)__name__
__module____qualname__r   Zvalidate_booleanZvalidate_nonnegative_intZsettings_specZcomponent_typeZconfig_sectionr   r"   r#   r   r   r   r   r      sH   
r   zdocutils.parsers.nullzdocutils.parsers.rstz%docutils.parsers.recommonmark_wrapperzmyst_parser.docutils_z#docutils.parsers.commonmark_wrapper)
nullrstrestructuredtextrestZrestxZrtxtZrecommonmarkZmystZ
commonmarkmarkdownc              
   C   sZ   |   }ztt||}W n6 tk
rR } ztd|  d| W 5 d}~X Y nX |jS )z6Return the Parser class from the `parser_name` module.zParser "z" not found. N)lowerr   _parser_aliasesgetImportErrorr   )parser_namenamemoduleerrr   r   r   get_parser_classU   s    &r4   N)
__doc____docformat__	importlibr   Zdocutilsr   r   r   r-   r4   r   r   r   r   <module>   s    4