
    <i                       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j!        ddddddddddddfdZ"dej!        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j%        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)Z3dS )/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dS )&	PublisherzK
    A facade encapsulating the high-level logic of a Docutils system.
    NreturnNonec	                j   t          |t                    r t          j        |          |          }t          |t                    rZt          |t          j                  r$|j        |                    |           |j        }n t          j        |                      }t          |t                    r t          j
        |                      }d| _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 t'          j                    | _        dS )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	            /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/docutils/core.py__init__zPublisher.__init__+   s6    fc"" 	>5W-f55f==Ffc"" 	<&'.11 <=(%%f---91&99;;fc"" 	85W-f5577F;333G(?&	 "3D 	J ~''    c                    t          j        |          } |||          | _        | j        j        | j        j        | _        dS | j        | j        | j        _        dS dS )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   sd     /77"l6;77;)+,DKKK[$!%DK %$r+   c                L    t          j        |          } |            | _        dS )zSet `self.writer` by name.N)r   r   r    )r(   writer_namewriter_classs      r)   
set_writerzPublisher.set_writern   s#    /<<"lnnr+   c                <   t          j        dt          d           | j        |                     || j        |           | j        7| j        j        | j                            |           | j        j        | _        | j        |                     |           d S d S )Nzh`Publisher.set_components()` will be removed in Docutils 2.0.  Specify component names at instantiation.   
stacklevel)	warningswarnPendingDeprecationWarningr   r/   r   r   r    r3   )r(   reader_namer-   r1   s       r)   set_componentszPublisher.set_componentss   s     * 0A	? 	? 	? 	? ;OOKkBBB;{!)&&{333+,DK;OOK((((( r+   c                   t          j                    5  t          j        dt                     |rR|st	                      }||_        |                                }t          |          dk    r|d         dk    rdg|_        t          | j
        | j        | j        |f|d||          cd d d            S # 1 swxY w Y   d S )	Nignore)category   applicationapplicationsT)
componentsdefaultsread_config_filesusagedescription)r8   catch_warningsfilterwarningsDeprecationWarningr   config_sectionsplitlenconfig_section_dependenciesr   r   r   r    )r(   rG   rH   settings_specrL   rE   partss          r)   _setup_settings_parserz Publisher._setup_settings_parser   s    $&& 	6 	6#H7IJJJJ Q$ 3$0NNM/=,&,,..u::>>eBi=&@&@AO@PM= Kdk)+!T	6 6 6	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6s   BB77B;>B;c                d     | j         ||||fi |}|                                | _        | 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.
        )rR   get_default_valuesr%   )r(   rG   rH   rP   rL   rE   option_parsers          r)   get_settingszPublisher.get_settings   sM     43;~K KAIK K%88::}r+   c                    | j         @|r|                                ni }|                    dd            | j        d||d| d S d S )N	tracebackT)rP   rL    )r%   copy
setdefaultrV   )r(   rP   settings_overridesrL   rE   s        r)   process_programmatic_settingsz'Publisher.process_programmatic_settings   s~     = 4FN)..000BHT222D *M-;* * (* * * * *	 ! r+   c                     | j         ||||fi |}|t          j        dd         }|                    |          | _        dS )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@   )rR   sysargv
parse_argsr%   )r(   r`   rG   rH   rP   rL   rE   rU   s           r)   process_command_linezPublisher.process_command_line   s_     43;~K KAIK K<8ABB<D%0066r+   c                ~    | j         |                     |           | j        |                     |           d S d S )N)source_path)destination_path)r!   
set_sourcer#   set_destination)r(   rd   re   s      r)   set_iozPublisher.set_io   sM    ;OOO444#  2B CCCCC $#r+   r!   
str | Nonerd   StrPath | Nonec                    || j         j        }n t          j        |          }|| j         _        |                     ||| j         j        | j         j                  | _        d S )N)r!   rd   encodingerror_handler)r%   _sourceosfspathr"   input_encodinginput_encoding_error_handlerr!   )r(   r!   rd   s      r)   rf   zPublisher.set_source   sf     -/KK)K00K$/DM!''{]1-D ( F Fr+   r#   TextIO | Nonere   c                r   |t          j        |          | j        _        nt	          | j        dd           r"| j        j        s| j        j        | j        _        | j        j        r5| j        j        r)| j        j        | j        j        k    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
                  | _        d S )NoutputznThe --output-path option obsoletes the second positional argument (DESTINATION). You cannot use them together.-)r#   re   rl   rm   )ro   rp   r%   output_pathgetattrru   _destination
SystemExitr$   output_encodingoutput_encoding_error_handlerr#   )r(   r#   re   s      r)   rg   zPublisher.set_destination   s:    '(*	2B(C(CDM%% t}h   A!%!:A,0M,@)) Bdm.H BM-1KKK  "A B B B }(0,0M,F)}(C//,0)m'	("T]%9  11#!]6]2-E	 2 G Gr+   c                    | j         j                            | j        | j        | j        j        | j        | j        f           | j         j                                         d S )N)	r   transformerpopulate_from_componentsr!   r   r   r    r#   apply_transformsr(   s    r)   r   zPublisher.apply_transforms   s]    !::[$+t{'94;	  	  	  	!2244444r+   Fc                r   d}	 | j          | j        |||||fi |pi  |                                  |                                  | j                            | j        | j        | j                   | _        | 	                                 | j
                            | j        | j                  }	| j
                                         nt# t          $ r}
d}|
j        }Y d}
~
n\d}
~
wt           $ rL}
| j         s | j         j        r|                                   |                     |
           d}d}Y d}
~
nd}
~
ww xY w|                                  |rM| j        rF| j        j        j        | j         j        k    r't/          j        | j        j        j        dz              n|rt/          j        |           |	S )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%   rb   rh   promptr   readr!   r   r   r   r    writer#   assemble_partsrz   code	ExceptionrX   debugging_dumpsreport_Exceptionreporter	max_levelexit_status_levelr_   exit)r(   r`   rG   rH   rP   r\   rL   enable_exit_statusexit_ru   errorexit_statuss               r)   publishzPublisher.publish   s    	}$))%m^2 2)/R2 2 2 KKMMMKKMMM K,,T[$+-1]< <DM!!###[&&t}d6FGGFK&&(((( 	% 	% 	%E*KKKKKK 	 	 	= }& $$&&&!!%(((EKKKKKK	 	 	"4= 	"'1M34 4HT]+5:;;;; 	"H[!!!s%   CC
 

D;	C""D;/AD66D;c                "   | j         sd S | j        j        rHt          d| j                   t          t          j        | j        j                  | j                   | j        j        rHt          d| j                   t          t          j        | j         j                  | j                   | j        j	        rmt          d| j                   t          d| j                   t          t          j        d | j         j
        j        D                       | j                   | j        j        rXt          d| j                   t          | j                                                             d          | j                   d S d S )	Nz
::: Runtime settings:filez
::: Document internals:z
::: Transforms applied:z@ (priority, transform class, pending node details, keyword args)c                P    g | ]#\  }}}}||j         d |j        |o|j        |f$S ).)
__module____name__details).0priorityxclasspendingkwargss        r)   
<listcomp>z-Publisher.debugging_dumps.<locals>.<listcomp>5  sU     7 7 76Xvw v'8'8'8&//J-gov7 7 7 7r+   z
::: Pseudo-XML:raw_unicode_escape)r   r%   dump_settingsprintr'   pprintpformat__dict__dump_internalsdump_transformsr~   applieddump_pseudo_xmlencoder   s    r)   r   zPublisher.debugging_dumps'  s   } 	F=& 	M+$,????&.!788t|LLLL=' 	M-DLAAAA&.!788t|LLLL=( 	L-DLAAAA "(,6 6 6 6&.7 7 M-57 7 78 8 ?Cl	L L L L
 =( 	:%DL9999$-''))00$& &,0L: : : : : :	: 	:r+   c                   	 | j                                         r| j                                        sdS n# t          $ r Y dS w xY wt          j        dk    rdnd}d}d}	 | j        j        d         }| j        j        d         }n# t          t          f$ r Y nw xY wt          dt           d	| d
| d| d	| j                   dS )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'   AttributeErrorro   namer   	supportedr    
IndexErrorr   r   )r(   eot_key	in_format
out_formats       r)   r   zPublisher.prompt>  s-   	K&&(( T\-@-@-B-B  	 	 	FF	 goo((8	%
	-a0I.q1JJ
+ 	 	 	D	 #+ # #&# #0:# # :A# # #
 <	! 	! 	! 	! 	! 	!s!   27 
AA!$B BBc                   t          |t          j                  r|                     |           d S t          |t                    r|                     |           d S t          |t          j                  r1| j        	                    dt          j
        |          z             d S t          |t          j                  r1| j        	                    dt          j
        |          z             d S t          dt          j
        |          z  | j                   t          dt           t          rdt           dnd d	t          j                                        d
          d| j                   d S )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_   versionrM   r(   r   s     r)   r   zPublisher.report_ExceptionT  s   eU011 	2%%e,,,,,122 	2$$U+++++r}-- 	2L  (*,/%*@*@ A B B B B Br~.. 	2L?51123 3 3 3 3 $///dlCCCC  2= !4;	 
 ""$$Q'   %)L2 2 2 2 2 2r+   c                ~    t          d|j        dt          j        j        |j                 d| j                   d S )NzExiting due to level-z (z) system message.r   )r   levelr	   Reporterlevelsr'   r   s     r)   r   zPublisher.report_SystemMessagej  sM    +++u~4U[AAAC<	! 	! 	! 	! 	! 	!r+   c                   |j         |j        |j                 }| j                            t          j        |          d| j        j        d|	                    dd          d|	                    dd          d| j        j
        dt          d	t          j                                        d
         d           d S )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%   r{   r   r|   r   r_   r   rM   )r(   r   datas      r)   r   zPublisher.report_UnicodeErroro  s    |EK	12* u%%%%},,,{{7$78888{{7$67777}:::{{CK--//22234	5 	5 	5 	5 	5r+   r   r   )NN)NNNN)NNNNN)r!   ri   rd   rj   r   r   )r#   rs   re   rj   r   r   )NNNNNNF)r   r   __qualname____doc__r   	FileInput
FileOutputr*   r/   r3   r<   rR   rV   r]   rb   rh   rf   rg   r   r   r   r   r   r   r   rY   r+   r)   r   r   %   s         #42<!R]4( 4( 4( 4( 4(l- - - - -% % % %
) ) ) ) >BBF6 6 6 6, 488<   "	* 	* 	* 	* GK@D7 7 7 7 7"D D D D D )-15F F F F F 6:;?G G G G G>5 5 5 5 :>7;8=( ( ( (T: : : :.! ! ! !,2 2 2 2,! ! ! !
5 5 5 5 5 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          |||           | p|pd} |p|pd}|p|pd}t          | |||          }|                    ||||||	|
          }|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%   rL   r   )_name_arg_warningr   r   )r   r;   r   r-   r    r1   r%   rP   r\   rL   r   r`   rG   rH   	publisherru   s                   r)   publish_cmdliner     s    , k;<<<2{2lF8{8&8F1{1kF&&&8DDDIe[-1C%:L  N 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!   rd   r$   r#   re   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   rY   )r   publish_programmaticallyr   r   r   )r!   rd   r#   re   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   ru   
_publishers                    r)   publish_filer     s    k;<<<1 
/ 
/ 
/\\
/*0&
/>Ik
/--
/  K
/ 3C2B
/ v	
/ $/;	
/
 v
/
 $/;
/ v
/ $/;
/ 
/ *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!   rd   r$   r#   Nre   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   rY   )r   r   r   StringInputStringOutput)r!   rd   re   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   ru   r   s                   r)   publish_stringr     s   4 k;<<<1 
/ 
/ 
/^^
/,2F
/@K
///
/ D
/ ,<+;
/ v	
/ $/;	
/
 v
/
 $/;
/ v
/ $/;
/ 
/ *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!   rd   r"   r$   r#   Nre   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   rY   )r   r   r   r   r    rQ   )r!   rd   r"   re   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   _outputr   s                    r)   publish_partsr   	  s   2 k;<<<1 
/ 
/ 
/v
/#.;
/=I\
///
/ D
/ ,<+;
/ v	
/ $/;	
/
 v
/
 $/;
/ v
/ $/;
/ 
/ *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!   rd   r"   r#   re   r$   r   r;   r   r-   r    nullr1   r%   rP   r\   rL   r   rY   )r   r   r   
NullOutputr   )r!   rd   r"   r   r;   r   r-   r%   rP   r\   rL   r   r   r   s                 r)   publish_doctreer   2  s    k;5551 
/ 
/ 
/v
/#.;
/!\
/ D
/ ,04
/ --	
/
 v
/
 $/;
/ v
/ $/;
/ v
/ $(4
/ 
/ *7
/ .-
/ ?Mn
/ .-
/GY r+   c	                4   t          dd|           t          t          j                    |p|pdt	          j        |           t          j        |          }	|	                    |||           |	                    d|           |		                    |          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]   rg   r   )
r   re   r    r1   r%   rP   r\   rL   r   r   s
             r)   publish_from_doctreer   O  s    2 dD+...!1!1!'!E;!E+!#!:!:,.O#+	- - -I
 ++)>; ; ;d$45550BCCCr+   r   r   r   c           	         t          j        dt          d           t          | ||||          }|                    |||           |                    ||||||	|
          }|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.r5   r6   )r%   r$   r   )r8   r9   rK   r   r<   r   )r   r;   r   r-   r    r1   r%   rP   r\   rL   r   r`   rG   rH   r#   r$   r   ru   s                     r)   publish_cmdline_to_binaryr   t  s    @ M '(:qJ J J J &&&8,=? ? ?I[+{CCCe[-1C%:L  N NF Mr+   r   r   c            
         t          d|           D ]-\  }}|&t          j        d| d| d| dt          d           .d S )N)r   r   r    z
Argument "z1_name" will be removed in Docutils 2.0.  Specify z name in the "z" argument.   r6   )zipr8   r9   r:   )	name_args	componentname_args      r)   r   r     s    "#A9MM C C	8M <y < <4=< <%.< < < 4C C C CC Cr+   c                
   |p|pd}|p|	pd}|
p|pd}
t          |||
|| |          }|                    |||           |                    ||           |                    ||           |                    |          }||fS )aH  
    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 name 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]   rf   rg   r   )r"   r!   rd   r$   r#   re   r   r;   r   r-   r    r1   r%   rP   r\   rL   r   r   ru   s                      r)   r   r     s    L 2{2lF8{8&8F1{1kF&&&8'3,=? ? ?I ++)>; ; ;---k+;<<<2DEEF9r+   r   c                
   d| d| dt           z   }	 t          j        t          j        d           n?# t          j        $ r-}t
          j                            d| d           Y d }~nd }~ww xY wt          | |           d S )Nz	Generate zZ documents from standalone reStructuredText sources <https://docutils.sourceforge.io/docs/z>.  r   z(WARNING: Cannot set the default locale: z.
)r    rH   )	default_descriptionlocale	setlocaleLC_ALLErrorr_   stderrr   r   )r    documenttypedoc_pathrH   es        r)   rst2somethingr  !  s    	@L 	@ 	@19	@ 	@ 	@ 	 
L++++< L L L
JAJJJKKKKKKKKL6{;;;;;;s   3 A/#A**A/c                 (    t          ddd           d S )NhtmlHTMLzuser/html.html#htmlr  rY   r+   r)   rst2htmlr	  2  s    &&"788888r+   c                 (    t          ddd           d S )Nhtml4z	XHTML 1.1zuser/html.html#html4css1r  rY   r+   r)   	rst2html4r  6  s    ';(BCCCCCr+   c                 (    t          ddd           d S )Nhtml5HTML5zuser/html.html#html5-polyglotr  rY   r+   r)   	rst2html5r  :  s    '7$CDDDDDr+   c                 (    t          ddd           d S )NlatexLaTeXuser/latex.htmlr  rY   r+   r)   	rst2latexr  >  s    '7$566666r+   c                 (    t          ddd           d S )NmanpagezUnix manual (troff)zuser/manpage.htmlr  rY   r+   r)   rst2manr  B  s    )24GHHHHHr+   c                 (    t          ddd           d S )NodtzOpenDocument text (ODT)zuser/odt.htmlr  rY   r+   r)   rst2odtr  F  s    %2ODDDDDr+   c                 (    t          ddd           d S )Nr   zpseudo-XML (test)ref/doctree.htmlr  rY   r+   r)   rst2pseudoxmlr  J  s    +24FGGGGGr+   c                 (    t          ddd           d S )Ns5zS5 HTML slideshowzuser/slide-shows.htmlr  rY   r+   r)   rst2s5r!  N  s    $+-DEEEEEr+   c                 (    t          ddd           d S )NxetexzLaTeX (XeLaTeX/LuaLaTeX)r  r  rY   r+   r)   	rst2xetexr$  R  s    '57HIIIIIr+   c                 (    t          ddd           d S )NxmlzDocutils-native XMLr  r  rY   r+   r)   rst2xmlr'  V  s    %.0BCCCCCr+   )NNNNNNNNNNNNNNF)NNNNNNNNNNNNF)NNNNNNNFr   )r   )4r   
__future__r   __docformat__r   r   ro   r_   r8   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'  rY   r+   r)   <module>r2     s  
	 	 # " " " " ""   				 



 < < < < < < < < < < < < < < < < < < < < * * * * * * $ $ $ $ $ $ '&&&&&&f5 f5 f5 f5 f5 f5 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 "D "D "DJ &*|%)7I%){'+,015-115#'$1*=*.020C) ) ) )XC C C Cr r rp< < < < <"9 9 9 9D D D DE E E E7 7 7 7I I I IE E E EH H H HF F F FJ J J JD D D D D Dr+   