o
    @x#[w  ã                   @   sF   d Z ddlmZmZ 			ddd„Z			dd	d
„Z		ddd„ZdS )a1  
This module contains practical examples of Docutils client code.

Importing this module from client code is not recommended; its contents are
subject to change in future Docutils releases.  Instead, it is recommended
that you copy and paste the parts you need into your own code, modifying as
necessary.
é    )ÚcoreÚioNÚunicodeTé   c                 C   s$   |||dœ}t j| ||d|d�}|S )a  
    Given an input string, returns a dictionary of HTML document parts.

    Dictionary keys are the names of parts, and values are Unicode strings;
    encoding is up to the client.

    Parameters:

    - `input_string`: A multi-line text string; required.
    - `source_path`: Path to the source file or object.  Optional, but useful
      for diagnostic output (system messages).
    - `destination_path`: Path to the file or object which will receive the
      output; optional.  Used for determining relative paths (stylesheets,
      source links, etc.).
    - `input_encoding`: The encoding of `input_string`.  If it is an encoded
      8-bit string, provide the correct encoding.  If it is a Unicode string,
      use "unicode", the default.
    - `doctitle`: Disable the promotion of a lone top-level section title to
      document title (and subsequent section title to document subtitle
      promotion); enabled by default.
    - `initial_header_level`: The initial level for header elements (e.g. 1
      for "<h1>").
    )Úinput_encodingÚdoctitle_xformÚinitial_header_levelÚhtml)ÚsourceÚsource_pathÚdestination_pathÚwriter_nameÚsettings_overrides)r   Úpublish_parts)Úinput_stringr   r   r   Údoctitler   Ú	overridesÚparts© r   ú3/usr/lib/python3/dist-packages/docutils/examples.pyÚ
html_parts   s   þýr   c           	      C   s2   t | |||||d�}|d }|dkr| |¡}|S )aE  
    Given an input string, returns an HTML fragment as a string.

    The return value is the contents of the <body> element.

    Parameters (see `html_parts()` for the remainder):

    - `output_encoding`: The desired encoding of the output.  If a Unicode
      string is desired, use the default value of "unicode" .
    )r   r   r   r   r   r   Ú	html_bodyr   )r   Úencode)	r   r   r   r   Úoutput_encodingr   r   r   Úfragmentr   r   r   r   4   s   ü
r   c                 C   s    |r|  ¡ }ni }||d< tjdi dtj“d| “d|“dtj“dd“d|“d	d“d
d“dd“dd“dd“dd“dd“dd“d|“dd“dd“Ž\}}|jj|fS )zx
    Return the document tree and publisher, for exploring Docutils internals.

    Parameters: see `html_parts()`.
    r   Úsource_classr
   r   Údestination_classÚdestinationNr   ÚreaderÚreader_nameÚ
standaloneÚparserÚparser_nameÚrestructuredtextÚwriterr   ÚnullÚsettingsÚsettings_specr   Úconfig_sectionÚenable_exit_statusr   )Úcopyr   Úpublish_programmaticallyr   ÚStringInputÚ
NullOutputr$   Údocument)r   r   r   r   r   r   ÚoutputÚpubr   r   r   Ú	internalsK   sP   

ÿÿþýýüûûúúùùøøø	÷	÷
r1   )NNr   Tr   )NNr   r   Tr   )NNr   N)Ú__doc__Údocutilsr   r   r   r   r1   r   r   r   r   Ú<module>   s   	
þ#
þÿ