HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/docutils/__pycache__/examples.cpython-312.pyc
�

�ddy��@�dZddlmZmZ			dd�Z			dd�Z		d	d�Zy)
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�ioNc�F�|||d�}tj|||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_stringrrr�doctitler�	overrides�partss        �3/usr/lib/python3/dist-packages/docutils/examples.py�
html_partsrs:��4$2�#+�)=�?�I�
�����)��y�
:�E��L�c�^�t||||||��}|d}|dk7r|j|�}|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" .
    )rrrrrr�	html_body�unicode)r�encode)	rrrr�output_encodingrrr�fragments	         rrr5sE��
�!�{�)�%��1�	
3�E�
�[�!�H��)�#��?�?�?�3���Orc�0�|r|j�}ni}||d<tjdidtj�d|�d|�dtj
�dd�d|�d	d�d
d�dd�d
d�dd�dd�dd�dd�d|�dd�dd��\}}|jj|fS)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_status�)�copyr�publish_programmaticallyr�StringInput�
NullOutputr'�document)rrrrrr�output�pubs        r�	internalsr5Ms����&�+�+�-�	��	�"0�I����/�/�	6��^�^�	6�,8�	6��	6��-�-�	6�6:�	6�*�		6�
�	6�
".�	6��
	6�"4�
	6��	6�"(�	6��	6�&*�	6�?H�	6��	6�15�	6�K�F�C��:�:����#�#r)NNrT�)NNrrTr6)NNrN)�__doc__�docutilsrrrrr5r-rr�<module>r9sC��
��AE�26�$%�!�H@D�8A�23��0@D�;?�$r