
    ri                    ,   d Z ddlmZ dZddlZddlZddlZddlZddlZddl	m
Z
mZmZmZmZmZmZmZ ddlmZ ddlmZ dZerdd	lmZ dd
lmZ  G d d      ZdZdZddddddddddddeefdZ	 	 	 	 	 	 	 d'dZ	 	 	 	 	 	 	 d(dZ dejB                  ddddddddddddfdZ"dejB                  dddddddddfdZ#	 	 	 	 	 d)dZ$ddddddddddddeedejJ                  fdZ&d*dZ'd Z(d+d*dZ)d*dZ*d*dZ+d*dZ,d*d Z-d*d!Z.d*d"Z/d*d#Z0d*d$Z1d*d%Z2d*d&Z3y),a  
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior.  For custom behavior (setting component options), create
custom component objects first, and pass *them* to
``publish_*``/`Publisher`.  See `The Docutils Publisher`_.

.. _The Docutils Publisher:
    https://docutils.sourceforge.io/docs/api/publisher.html
    )annotationsreStructuredTextN)__version____version_details__SettingsSpecioutilsreadersparserswriters)OptionParser)doctreeF)TextIO)StrPathc                     e Zd ZdZddddej
                  dej                  df	 ddZdddZddZ	ddZ
	 	 ddZ	 	 ddZ	 	 dd	Z	 	 d	 dd
ZdddZ	 	 d	 	 	 	 	 ddZ	 	 d	 	 	 	 	 ddZddZ	 	 	 ddZddZddZddZddZddZy)	PublisherzK
    A facade encapsulating the high-level logic of a Docutils system.
    Nc	                L   t        |t              r t        j                  |      |      }t        |t              r^t        |t        j                        r*|j
                  |j                  |       |j
                  }n t        j                  |             }t        |t              r t        j                  |             }d| _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 t'        j(                         | _        y)z
        Initial setup.

        The components `reader`, `parser`, or `writer` should all be
        specified, either as instances or via their names.
        N)
isinstancestrr
   get_reader_classReaderparser
set_parserr   get_parser_classr   get_writer_classdocumentreaderwritersourcesource_classdestinationdestination_classsettingsr   ErrorOutput_stderr)	selfr   r   r   r   r    r!   r"   r#   s	            I/mnt/e/genesis-system/.venv/lib/python3.12/site-packages/docutils/core.py__init__zPublisher.__init__+   s    fc"5W--f5f=Ffc"&'..1==(%%f-911&9;fc"5W--f57F;333G(?&	 "3D 	J ~~'    c                    t        j                  |      } |||      | _        | j                  j                  | j                  j                  | _        y| j                  | j                  | j                  _        yy)zSet `self.reader` by name.

        The "paser_name" argument is deprecated,
        use "parser" with parser name or instance.
        N)r
   r   r   r   )r&   r   r   parser_namereader_classs        r'   
set_readerzPublisher.set_readera   sb     //7"6;7;;)++,,DK[[$!%DKK %r)   c                F    t        j                  |      } |       | _        y)zSet `self.writer` by name.N)r   r   r   )r&   writer_namewriter_classs      r'   
set_writerzPublisher.set_writern   s    //<"nr)   c                z   t        j                  dt        d       | j                  | j	                  || j
                  |       | j
                  L| j                  j
                  | j                  j                  |       | j                  j
                  | _        | j                  | j                  |       y y )Nzh`Publisher.set_components()` will be removed in Docutils 2.0.  Specify component names at instantiation.   
stacklevel)	warningswarnPendingDeprecationWarningr   r-   r   r   r   r1   )r&   reader_namer+   r/   s       r'   set_componentszPublisher.set_componentss   s     * 0A	? ;;OOKkB;;{{!!)&&{3++,,DK;;OOK( r)   c                v   t        j                         5  t        j                  dt               |rA|s
t	               }||_        |j                         }t        |      dkD  r|d   dk(  rdg|_        t        | j                  | j                  | j                  |f|d||      cd d d        S # 1 sw Y   y xY w)	Nignore)category   applicationapplicationsT)
componentsdefaultsread_config_filesusagedescription)r6   catch_warningsfilterwarningsDeprecationWarningr   config_sectionsplitlenconfig_section_dependenciesr   r   r   r   )r&   rE   rF   settings_specrJ   rC   partss          r'   _setup_settings_parserz Publisher._setup_settings_parser   s     $$& 	6##H7IJ$$0NM/=,&,,.u:>eBi=&@AO@PM= KKdkk)+!T	6	6 	6 	6s   BB//B8c                p     | j                   ||||fi |}|j                         | _        | j                  S )a  
        Return settings from components and config files.

        Please set components first (`self.set_reader` & `self.set_writer`).
        Use keyword arguments to override component defaults
        (before updating from configuration files).

        Calling this function also sets `self.settings` which makes
        `self.publish()` skip parsing command line options.
        )rP   get_default_valuesr#   )r&   rE   rF   rN   rJ   rC   option_parsers          r'   get_settingszPublisher.get_settings   sC     433;~KAIK%88:}}r)   c                    | j                   <|r|j                         ni }|j                  dd        | j                  d||d| y y )N	tracebackT)rN   rJ    )r#   copy
setdefaultrT   )r&   rN   settings_overridesrJ   rC   s        r'   process_programmatic_settingsz'Publisher.process_programmatic_settings   sX     == 4F)..0BHT2D *M-;* (*	 !r)   c                     | j                   ||||fi |}|t        j                  dd }|j                  |      | _        y)z
        Parse command line arguments and set ``self.settings``.

        Pass an empty sequence to `argv` to avoid reading `sys.argv`
        (the default behaviour).

        Set components first (`self.set_reader` & `self.set_writer`).
        Nr>   )rP   sysargv
parse_argsr#   )r&   r^   rE   rF   rN   rJ   rC   rS   s           r'   process_command_linezPublisher.process_command_line   sO     433;~KAIK<88AB<D%006r)   c                ~    | j                   | j                  |       | j                  | j                  |       y y )N)source_path)destination_path)r   
set_sourcer!   set_destination)r&   rb   rc   s      r'   set_iozPublisher.set_io   s=    ;;OOO4#  2B C $r)   c                   || j                   j                  }n&t        j                  |      }|| j                   _        | j	                  ||| j                   j
                  | j                   j                        | _        y )N)r   rb   encodingerror_handler)r#   _sourceosfspathr    input_encodinginput_encoding_error_handlerr   )r&   r   rb   s      r'   rd   zPublisher.set_source   sj     --//K))K0K$/DMM!''{]]11--DD ( Fr)   c                   |&t        j                  |      | j                  _        nt	        | j                  dd       r;| j                  j                  s%| j                  j
                  | j                  _        | j                  j                  rN| j                  j                  r8| j                  j                  | j                  j                  k7  rt        d      | j                  j                  %| j                  j                  | j                  _        | j                  j                  dk(  rd | j                  _        | j                  j                  x| j                  _        | j                  _        | j                  || j                  j                  | j                  j                  | j                  j                        | _        y )NoutputznThe --output-path option obsoletes the second positional argument (DESTINATION). You cannot use them together.-)r!   rc   rh   ri   )rk   rl   r#   output_pathgetattrrp   _destination
SystemExitr"   output_encodingoutput_encoding_error_handlerr!   )r&   r!   rc   s      r'   re   zPublisher.set_destination   sP    '(*		2B(CDMM% t}}h !%!:!:,0MM,@,@)))dmm.H.HMM--1K1KK  "A B B }}((0,0MM,F,F)}}((C/,0)mm''	("T]]%9  11#!]]66]]22--EE	 2 Gr)   c                   | j                   j                  j                  | j                  | j                  | j                  j
                  | j                  | j                  f       | j                   j                  j                          y )N)	r   transformerpopulate_from_componentsr   r   r   r   r!   apply_transforms)r&   s    r'   r{   zPublisher.apply_transforms   s_    !!::[[$++t{{'9'94;;	  	!!224r)   c                   d}	 | j                    | j                  |||||fi |xs i  | j                          | j                          | j                  j                  | j                  | j                  | j                         | _        | j                          | j                  j                  | j                  | j                        }	| j                  j                          | j%                          |r{| j                  ro| j                  j(                  j*                  | j                   j,                  k\  r8t/        j0                  | j                  j(                  j*                  dz          	S |rt/        j0                         	S # t        $ r}
d}|
j                  }Y d}
~
d}
~
wt         $ rT}
| j                   s | j                   j"                  r| j%                           | j'                  |
       d}d}Y d}
~
d}
~
ww xY w)z
        Process command line options and arguments (if `self.settings` not
        already set), run `self.reader` and then `self.writer`.  Return
        `self.writer`'s output.
        NTr>   
   )r#   r`   rf   promptr   readr   r   r   r{   r   writer!   assemble_partsru   code	ExceptionrV   debugging_dumpsreport_Exceptionreporter	max_levelexit_status_levelr]   exit)r&   r^   rE   rF   rN   rZ   rJ   enable_exit_statusexit_rp   errorexit_statuss               r'   publishzPublisher.publish   s    	}}$)))%m^2)/R2 KKMKKM KK,,T[[$++-1]]<DM!!#[[&&t}}d6F6FGFKK&&( 	4==''11MM334HHT]]++55:;  HH[!'  	%E**K 	==}}&&$$&!!%(EK	s%   C!F 	HF''H3A	HHc                R   | j                   sy | j                  j                  rUt        d| j                         t        t        j                  | j                  j                        | j                         | j                  j                  rUt        d| j                         t        t        j                  | j                   j                        | j                         | j                  j                  rt        d| j                         t        d| j                         t        t        j                  | j                   j                  j                  D cg c]4  \  }}}}||j                  d|j                  |xr |j                  |f6 c}}}}      | j                         | j                  j                  rVt        d| j                         t        | j                   j                         j!                  d      | j                         y y c c}}}}w )	Nz
::: Runtime settings:filez
::: Document internals:z
::: Transforms applied:z@ (priority, transform class, pending node details, keyword args).z
::: Pseudo-XML:raw_unicode_escape)r   r#   dump_settingsprintr%   pprintpformat__dict__dump_internalsdump_transformsry   applied
__module____name__detailsdump_pseudo_xmlencode)r&   priorityxclasspendingkwargss        r'   r   zPublisher.debugging_dumps'  s   }}==&&+$,,?&..!7!78t||L==''-DLLA&..!7!78t||L==((-DLLA "(,6&.. MM--557 76Xvw v'8'8&//J-goov7 78 ?Cll	L
 ==((%DLL9$--'')00$&,0LL: )	7s   !9H!c                   	 | j                   j                         r| j                  j                         sy	 t        j
                  dk(  rdnd}d}d}	 | j                  j                  d   }| j                  j                  d   }t        dt         d	| d
| d| d	| j                         y# t        $ r Y yw xY w# t        t        f$ r Y Iw xY w)z=Print info and prompt when waiting for input from a terminal.NntzCtrl+ZzCtrl+D zuseful formatsr   z	Docutils z/ <https://docutils.sourceforge.io>
converting "z" into "zT".
Call with option "--help" for more info.
.. Waiting for source text (finish with z on an empty line):r   )r   isattyr%   AttributeErrorrk   namer   	supportedr   
IndexErrorr   r   )r&   eot_key	in_format
out_formats       r'   r~   zPublisher.prompt>  s    	KK&&(T\\-@-@-B .C !ggo(8	%
	--a0I..q1J 		+ '&Kx
| <99@	 B##
 <<	!  		 
+ 		s#   4B/ 2B> /	B;:B;>CCc                   t        |t        j                        r| j                  |       y t        |t              r| j                  |       y t        |t        j                        r2| j                  j                  dt        j                  |      z         y t        |t        j                        r2| j                  j                  dt        j                  |      z         y t        dt        j                  |      z  | j                         t        dt         t        r
dt         dnd d	t        j                   j#                         d
    d| j                         y )Nz-Unable to open source file for reading:
  %s
z2Unable to open destination file for writing:
  %s
z%sr   zExiting due to error.  Use "--traceback" to diagnose.
Please report errors to <docutils-users@lists.sourceforge.net>.
Include "--traceback" output, Docutils version (z []r   ),
Python version (r   z5), your OS type & version, and the command line used.)r   r	   SystemMessagereport_SystemMessageUnicodeEncodeErrorreport_UnicodeErrorr   
InputErrorr%   r   error_stringOutputErrorr   r   r   r]   versionrK   r&   r   s     r'   r   zPublisher.report_ExceptionT  s   eU001%%e,12$$U+r}}-LL  (*,//%*@ A Br~~.LL??5123 $//dllC 1 2= 32! < =""$Q'( ) %)LL2r)   c                    t        d|j                  dt        j                  j                  |j                     d| j
                         y )NzExiting due to level-z (z) system message.r   )r   levelr	   Reporterlevelsr%   r   s     r'   r   zPublisher.report_SystemMessagej  s3    ++u~~44U[[AC<<	!r)   c                   |j                   |j                  |j                   }| j                  j	                  t        j                  |      d| j                  j                  d|j                  dd      d|j                  dd      d| j                  j                  dt        d	t        j                  j                         d
   d       y )Nz!

The specified output encoding (z) cannot
handle all of the output.
Try setting "--output-encoding-error-handler" to

* "xmlcharrefreplace" (for HTML & XML output);
  the output will contain "asciixmlcharrefreplacezU" and should be usable.
* "backslashreplace" (for other output formats);
  look for "backslashreplacezr" in the output.
* "replace"; look for "?" in the output.

"--output-encoding-error-handler" is currently set to "z".

Exiting due to error.  Use "--traceback" to diagnose.
If the advice above doesn't eliminate the error,
please report it to <docutils-users@lists.sourceforge.net>.
Include "--traceback" output, Docutils version (r   r   z6), your OS type & version, and the
command line used.
)objectstartendr%   r   r   r   r#   rv   r   rw   r   r]   r   rK   )r&   r   datas      r'   r   zPublisher.report_UnicodeErroro  s    ||EKK		2* u%}},,{{7$78{{7$67}}::CKK--/234	5r)   returnNone)NN)NNNN)NNNNN)r   z
str | Nonerb   StrPath | Noner   r   )r!   zTextIO | Nonerc   r   r   r   )NNNNNNF)r   r   __qualname____doc__r   	FileInput
FileOutputr(   r-   r1   r:   rP   rT   r[   r`   rf   rd   re   r{   r   r   r~   r   r   r   rW   r)   r'   r   r   %   s    #42<<!R]]4( $(4(l-%
) >BBF6, 488<"	*9=	* GK@D7,07"D )-15F%F .F F 6:;?G%2G*8G "G>5 :>7;8=(T:.!,2,!
5r)   r   z*%prog [options] [<source> [<destination>]]zReads from <source> (default is stdin) and writes to <destination> (default is stdout).  See https://docutils.sourceforge.io/docs/user/config.html for a detailed settings reference.Tc           	         t        |||       | xs |xs d} |xs |xs d}|xs |xs d}t        | |||      }|j                  ||||||	|
      }|S )aT  
    Set up & run a `Publisher` for command-line-based file I/O (input and
    output file paths taken automatically from the command line).
    Also return the output as `str` or `bytes` (for binary output document
    formats).

    Parameters: see `publish_programmatically()` for the remainder.

    - `argv`: Command-line argument list to use instead of ``sys.argv[1:]``.
    - `usage`: Usage string, output if there's a problem parsing the command
      line.
    - `description`: Program description, output for the "--help" option
      (along with command-line option descriptions).
    
standalonerestructuredtext	pseudoxml)r#   rJ   r   )_name_arg_warningr   r   )r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   r^   rE   rF   	publisherrp   s                   r'   publish_cmdliner     s}    , k;<2{2lF8{8&8F1{1kF&&&8DIe[-1C%:L  NF Mr)   c                    t        |||	       t        di dt        j                  d| d|dt        j                  d|d|d|d|d	|d
|d|d|	d|
d|d|d|d|\  }}|S )z
    Set up & run a `Publisher` for programmatic use with file-like I/O.
    Also return the output as `str` or `bytes` (for binary output document
    formats).

    Parameters: see `publish_programmatically()`.
    r    r   rb   r"   r!   rc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   rW   )r   publish_programmaticallyr   r   r   )r   rb   r!   rc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   rp   
_publishers                    r'   publish_filer     s     k;<1 
/\\
/*0
/>I
/--
/  
/ 3C
/ 	
/ $/	
/
 
/
 $/
/ 
/ $/
/ 
/ *7
/ .
/ &
/ .
/FJ Mr)   c                    t        |||       t        di dt        j                  d| d|dt        j                  ddd|d|d	|d
|d|d|d|d|	d|
d|d|d|\  }}|S )u  
    Set up & run a `Publisher` for programmatic use with string I/O.

    Accepts a `bytes` or `str` instance as `source`.

    The output is encoded according to the `output_encoding`_ setting;
    the return value is a `bytes` instance (unless `output_encoding`_ is
    "unicode", cf. `docutils.io.StringOutput.write()`).

    Parameters: see `publish_programmatically()` or
    https://docutils.sourceforge.io/docs/api/publisher.html#publish-string

    This function is provisional because in Python 3 name and behaviour
    no longer match.

    .. _output_encoding:
        https://docutils.sourceforge.io/docs/user/config.html#output-encoding
    r    r   rb   r"   r!   Nrc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   rW   )r   r   r   StringInputStringOutput)r   rb   rc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   rp   r   s                   r'   publish_stringr     s    4 k;<1 
/^^
/,2
/@K
///
/ 
/ ,<
/ 	
/ $/	
/
 
/
 $/
/ 
/ $/
/ 
/ *7
/ .
/ &
/ .
/FJ Mr)   c                    t        |||	       t        di d| d|d|dt        j                  ddd|d|d	|d
|d|d|d|	d|
d|d|d|d|\  }}|j                  j
                  S )a  
    Set up & run a `Publisher`, and return a dictionary of document parts.

    Dictionary keys are the names of parts.
    Dictionary values are `str` instances; encoding is up to the client,
    e.g.::

       parts = publish_parts(...)
       body = parts['body'].encode(parts['encoding'], parts['errors'])

    See the `API documentation`__ for details on the provided parts.

    Parameters: see `publish_programmatically()`.

    __ https://docutils.sourceforge.io/docs/api/publisher.html#publish-parts
    r   rb   r    r"   r!   Nrc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   rW   )r   r   r   r   r   rO   )r   rb   r    rc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   _outputr   s                    r'   publish_partsr   	  s    2 k;<1 
/
/#.
/=I
///
/ 
/ ,<
/ 	
/ $/	
/
 
/
 $/
/ 
/ $/
/ 
/ *7
/ .
/ &
/ .
/GY !!!r)   c                    t        ||d       t        di d| d|d|dddddt        j                  d|d	|d
|d|ddddd|d|d|	d|
d|\  }}|j                  S )z
    Set up & run a `Publisher` for programmatic use. Return a document tree.

    Parameters: see `publish_programmatically()`.
    Nr   rb   r    r!   rc   r"   r   r9   r   r+   r   nullr/   r#   rN   rZ   rJ   r   rW   )r   r   r   
NullOutputr   )r   rb   r    r   r9   r   r+   r#   rN   rZ   rJ   r   r   r   s                 r'   publish_doctreer   2  s     k;51 
/
/#.
/!
/ 
/ ,0
/ --	
/
 
/
 $/
/ 
/ $/
/ 
/ $(
/ 
/ *7
/ .
/ ?M
/ .
/GY r)   c	                    t        dd|       t        t        j                         |xs |xs dt	        j
                  |       t        j                  |      }	|	j                  |||       |	j                  d|       |	j                  |      S )u  
    Set up & run a `Publisher` to render from an existing document tree
    data structure. For programmatic use with string output
    (`bytes` or `str`, cf. `publish_string()`).

    Note that ``document.settings`` is overridden; if you want to use the
    settings of the original `document`, pass ``settings=document.settings``.

    Also, new `document.transformer` and `document.reporter` objects are
    generated.

    Parameters: `document` is a `docutils.nodes.document` object, an existing
    document tree.

    Other parameters: see `publish_programmatically()`.

    This function is provisional because in Python 3 name and behaviour
    of the `io.StringOutput` class no longer match.
    Nr   )r   r   r   r"   r#   r   )
r   r   r   r   r   DocTreeInputr   r[   re   r   )
r   rc   r   r/   r#   rN   rZ   rJ   r   r   s
             r'   publish_from_doctreer   O  s    2 dD+.!1!'!E;!E+!#!:,.OO#+	-I
 ++)>;d$450BCCr)   r   r   r   c           	         t        j                  dt        d       t        | ||||      }|j	                  |||       |j                  ||||||	|
      }|S )u
  
    Set up & run a `Publisher` for command-line-based file I/O (input and
    output file paths taken automatically from the command line).
    Also return the output as `bytes`.

    This is just like publish_cmdline, except that it uses
    io.BinaryFileOutput instead of io.FileOutput.

    Parameters: see `publish_programmatically()` for the remainder.

    - `argv`: Command-line argument list to use instead of ``sys.argv[1:]``.
    - `usage`: Usage string, output if there's a problem parsing the command
      line.
    - `description`: Program description, output for the "--help" option
      (along with command-line option descriptions).

    Deprecated. Use `publish_cmdline()` (works with `bytes` since
    Docutils 0.20). Will be removed in Docutils 0.24.
    zg"publish_cmdline_to_binary()" is obsoleted by "publish_cmdline()" and will be removed in Docutils 0.24.r3   r4   )r#   r"   r   )r6   r7   rI   r   r:   r   )r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   r^   rE   rF   r!   r"   r   rp   s                     r'   publish_cmdline_to_binaryr   t  st    @ MM '(:qJ &&&8,=?I[+{Ce[-1C%:L  NF Mr)   c            
     ~    t        d|       D ].  \  }}|	t        j                  d| d| d| dt        d       0 y )N)r   r   r   z
Argument "z1_name" will be removed in Docutils 2.0.  Specify z name in the "z" argument.   r4   )zipr6   r7   r8   )	name_args	componentname_args      r'   r   r     s[    "#A9M C	8MMJyk 244=; ?%%.K{< 4CCr)   c                    |xs |xs d}|xs |	xs d}|
xs |xs d}
t        |||
|| |      }|j                  |||       |j                  ||       |j                  ||       |j	                  |      }||fS )aO  
    Set up & run a `Publisher` for custom programmatic use.

    Return the output (as `str` or `bytes`, depending on `destination_class`,
    writer, and the "output_encoding" setting) and the Publisher object.

    Internal:
    Applications should not call this function directly.  If it does
    seem to be necessary to call this function directly, please write to the
    Docutils-develop mailing list
    <https://docutils.sourceforge.io/docs/user/mailing-lists.html#docutils-develop>.

    Parameters:

    * `source_class` **required**: The class for dynamically created source
      objects.  Typically `io.FileInput` or `io.StringInput`.

    * `source`: Type depends on `source_class`:

      - If `source_class` is `io.FileInput`: Either a file-like object
        (must have 'read' and 'close' methods), or ``None``
        (`source_path` is opened).  If neither `source` nor
        `source_path` are supplied, `sys.stdin` is used.

      - If `source_class` is `io.StringInput` **required**:
        The input as either a `bytes` object (ensure the 'input_encoding'
        setting matches its encoding) or a `str` object.

    * `source_path`: Type depends on `source_class`:

      - `io.FileInput`: Path to the input file, opened if no `source`
        supplied.

      - `io.StringInput`: Optional.  Path to the file or description of the
        object that produced `source`.  Only used for diagnostic output.

    * `destination_class` **required**: The class for dynamically created
      destination objects.  Typically `io.FileOutput` or `io.StringOutput`.

    * `destination`: Type depends on `destination_class`:

      - `io.FileOutput`: Either a file-like object (must have 'write' and
        'close' methods), or ``None`` (`destination_path` is opened).  If
        neither `destination` nor `destination_path` are supplied,
        `sys.stdout` is used.

      - `io.StringOutput`: Not used; pass ``None``.

    * `destination_path`: Type depends on `destination_class`:

      - `io.FileOutput`: Path to the output file.  Opened if no `destination`
        supplied.

      - `io.StringOutput`: Path to the file or object which will receive the
        output; optional.  Used for determining relative paths (stylesheets,
        source links, etc.).

    * `reader`: A `docutils.readers.Reader` instance, name, or alias.
      Default: "standalone".

    * `reader_name`: Deprecated. Use `reader`.

    * `parser`: A `docutils.parsers.Parser` instance, name, or alias.
      Default: "restructuredtext".

    * `parser_name`: Deprecated. Use `parser`.

    * `writer`: A `docutils.writers.Writer` instance, name, or alias.
      Default: "pseudoxml".

    * `writer_name`: Deprecated. Use `writer`.

    * `settings`: A runtime settings (`docutils.frontend.Values`) object, for
      dotted-attribute access to runtime settings.  It's the end result of the
      `SettingsSpec`, config file, and option processing.  If `settings` is
      passed, it's assumed to be complete and no further setting/config/option
      processing is done.

    * `settings_spec`: A `docutils.SettingsSpec` subclass or object.  Provides
      extra application-specific settings definitions independently of
      components.  In other words, the application becomes a component, and
      its settings data is processed along with that of the other components.
      Used only if no `settings` specified.

    * `settings_overrides`: A dictionary containing application-specific
      settings defaults that override the defaults of other components.
      Used only if no `settings` specified.

    * `config_section`: A string, the name of the configuration file section
      for this application.  Overrides the ``config_section`` attribute
      defined by `settings_spec`.  Used only if no `settings` specified.

    * `enable_exit_status`: Boolean; enable exit status at end of processing?
    r   r   r   )r#   r    r"   r   )r   r[   rd   re   r   )r    r   rb   r"   r!   rc   r   r9   r   r+   r   r/   r#   rN   rZ   rJ   r   r   rp   s                      r'   r   r     s    L 2{2lF8{8&8F1{1kF&&&8'3,=?I ++)>;-k+;<2DEF9r)   c                   d| d| dt         z   }	 t        j                  t        j                  d       t        | |       y # t        j                  $ r-}t
        j                  j                  d| d       Y d }~Id }~ww xY w)Nz	Generate zZ documents from standalone reStructuredText sources <https://docutils.sourceforge.io/docs/z>.  r   z(WARNING: Cannot set the default locale: z.
)r   rF   )	default_descriptionlocale	setlocaleLC_ALLErrorr]   stderrr   r   )r   documenttypedoc_pathrF   es        r'   rst2somethingr   !  s     L> "119
$	@ 	 
L+ 6{; << L

CA3cJKKLs   $A B#A??Bc                     t        ddd       y )NhtmlHTMLzuser/html.html#htmlr   rW   r)   r'   rst2htmlr  2  s    &&"78r)   c                     t        ddd       y )Nhtml4z	XHTML 1.1zuser/html.html#html4css1r  rW   r)   r'   	rst2html4r  6  s    ';(BCr)   c                     t        ddd       y )Nhtml5HTML5zuser/html.html#html5-polyglotr  rW   r)   r'   	rst2html5r
  :  s    '7$CDr)   c                     t        ddd       y )NlatexLaTeXuser/latex.htmlr  rW   r)   r'   	rst2latexr  >  s    '7$56r)   c                     t        ddd       y )NmanpagezUnix manual (troff)zuser/manpage.htmlr  rW   r)   r'   rst2manr  B  s    )24GHr)   c                     t        ddd       y )NodtzOpenDocument text (ODT)zuser/odt.htmlr  rW   r)   r'   rst2odtr  F  s    %2ODr)   c                     t        ddd       y )Nr   zpseudo-XML (test)ref/doctree.htmlr  rW   r)   r'   rst2pseudoxmlr  J  s    +24FGr)   c                     t        ddd       y )Ns5zS5 HTML slideshowzuser/slide-shows.htmlr  rW   r)   r'   rst2s5r  N  s    $+-DEr)   c                     t        ddd       y )NxetexzLaTeX (XeLaTeX/LuaLaTeX)r  r  rW   r)   r'   	rst2xetexr  R  s    '57HIr)   c                     t        ddd       y )NxmlzDocutils-native XMLr  r  rW   r)   r'   rst2xmlr!  V  s    %.0BCr)   )NNNNNNNNNNNNNNF)NNNNNNNNNNNNF)NNNNNNNFr   )r   )4r   
__future__r   __docformat__r   r   rk   r]   r6   docutilsr   r   r   r   r	   r
   r   r   docutils.frontendr   docutils.readersr   TYPE_CHECKINGtypingr   docutils.nodesr   r   default_usager   r   r   r   r   r   r   r   BinaryFileOutputr   r   r   r   r  r  r
  r  r  r  r  r  r  r!  rW   r)   r'   <module>r,     s  
	 #"   	 
 < < < * $&f5 f5R =)   TTT!'+D'+$'5HD +/48*.*.*.GK9>> ?C,0,0,004;?&+'T '+#'444t%)$%*&"R )-!#TT!'+D',: 59266:AE,1	"DJ &*|%)7I%){'+,015-115#'$1*=*.020C0C)XCrp<"9DE7IEHFJDr)   