
    k7i                        S r SSKJr  SrSSKrSSKrSSKJrJrJ	r	  SSK
Jr  Sr\(       a  SSKJr  SS	KJr  SS
KJr  SSKJr  SSK
Jr   " S S\	5      r " S S\5      rSS jrg)z0
This package contains Docutils Reader modules.
    )annotationsreStructuredTextN)utilsparsers	Component)	universalF)Final)nodes)Input)Parser)	Transformc                     ^  \ rS rSr% SrSrS\S'   SrS\S'   SU 4S jjr  S     SS	 jjr	SS
 jr
S rSS jrSS jrSrU =r$ )Reader   a!  
Abstract base class for docutils Readers.

Each reader module or package must export a subclass also called 'Reader'.

The two steps of a Reader's responsibility are to read data from the
source Input object and parse the data with the Parser object.
Call `read()` to process a document.
readerr	   component_typereadersconfig_sectionc                   > [         TU ]  5       [        R                  [        R                  [        R
                  /-   $ N)superget_transformsr   DecorationsExposeInternalsStripComments)self	__class__s    S/home/james-whalen/.local/lib/python3.13/site-packages/docutils/readers/__init__.pyr   Reader.get_transforms,   s:    w%'9+@+@+4+D+D+4+B+B+D D 	D    c                    Xl          [        U[        5      (       a  U R                  U5        Ub8  [        R
                  " S[        SS9  U R                   c  U R                  U5        SU l         SU l        g)a  
Initialize the Reader instance.

:parser: A parser instance or name (an instance will be created).
:parser_name: deprecated, use "parser".

Several instance attributes are defined with dummy initial values.
Subclasses may use these attributes as they wish.
NzgArgument "parser_name" will be removed in Docutils 2.0.
  Specify parser name in the "parser" argument.   )
stacklevel)	parser
isinstancestr
set_parserwarningswarnPendingDeprecationWarningsourceinput)r   r$   parser_names      r   __init__Reader.__init__1   sx     &,	E fc""OOF#"MM L 4C {{",$(<!%
	$r    c                H    [         R                  " U5      nU" 5       U l        g)zSet `self.parser` by name.N)r   get_parser_classr$   )r   r-   parser_classs      r   r'   Reader.set_parserT   s    //<"nr    c                    Xl         U R                  (       d  X l        X0l        U R                   R                  5       U l        U R                  5         U R                  $ r   )r+   r$   settingsreadr,   parsedocument)r   r+   r$   r5   s       r   r6   Reader.readY   s?    {{ K [[%%'


}}r    c                    U R                  5       nU R                  R                  U R                  U5        S=Ul        Ul        Xl        g)z(Parse `self.input` into a document tree.N)new_documentr$   r7   r,   current_sourcecurrent_liner8   )r   r8   s     r   r7   Reader.parseb   s=    $$&$**h/:>>("7(0r    c                l    [         R                  " U R                  R                  U R                  5      $ )z8Create and return a new empty document tree (root node).)r   r;   r+   source_pathr5   r   s    r   r;   Reader.new_documenti   s#    !!$++"9"94==IIr    )r8   r,   r$   r5   r+   returnzlist[type[Transform]])NN)r$   zParser | str | Noner-   z
str | NonerD   None)r-   r&   rD   rE   )rD   rE   )rD   znodes.document)__name__
__module____qualname____firstlineno____doc__r   __annotations__r   r   r.   r'   r6   r7   r;   __static_attributes____classcell__)r   s   @r   r   r      sg     %NE$%NE%D 04+/!$,!$(!$ !$F%
1J Jr    r   c                  "    \ rS rSrSrSS jrSrg)ReReadern   z
A reader which rereads an existing document tree (e.g. a
deserializer).

Often used in conjunction with `writers.UnfilteredWriter`.
c                .    [         R                  " U 5      $ r   )r   r   rA   s    r   r   ReReader.get_transformsw   s     ''--r     NrC   )rF   rG   rH   rI   rJ   r   rL   rS   r    r   rO   rO   n   s    .r    rO   c                   U R                  5       n [        R                  " SU-   5      nUR                  $ ! [         aG     [        R                  " U5      n UR                  $ ! [         a  n[        SU  S35      UeSnAff = ff = f)z6Return the Reader class from the `reader_name` module.zdocutils.readers.zReader "z" not found.N)lower	importlibimport_moduleImportErrorr   )reader_namenamemoduleerrs       r   get_reader_classr]   }   s    DM(()<T)AB ==  M	M,,T2F ==  	M\BCL	MMs'   7 
BA%%
B/A??BB)rY   r&   rD   ztype[Reader])rJ   
__future__r   __docformat__rV   r(   docutilsr   r   r   docutils.transformsr   TYPE_CHECKINGtypingr	   r
   docutils.ior   docutils.parsersr   r   r   rO   r]   rS   r    r   <module>rf      s\   
 #"   . . )!'-NJY NJb.v .
r    