§
    šŠtj   ã                   óV   — d dl Z d dlmZmZmZmZmZ d dlmZm	Z	  G d„ de¦  «        Z
dS )é    N)ÚAnyÚListÚOptionalÚSequenceÚUnion)ÚBaseDocumentTransformerÚDocumentc                   ó¸   — e Zd ZdZ	 	 	 	 ddeeeee         f                  deeeee         f                  deded	e	d
dfd„Z
dee         d	e	d
ee         fd„ZdS )ÚMarkdownifyTransformeram  Converts HTML documents to Markdown format with customizable options for handling
    links, images, other tags and heading styles using the markdownify library.

    Arguments:
        strip: A list of tags to strip. This option can't be used with the convert option.
        convert: A list of tags to convert. This option can't be used with the strip option.
        autolinks: A boolean indicating whether the "automatic link" style should be used when a a tag's contents match its href. Defaults to True.
        heading_style: Defines how headings should be converted. Accepted values are ATX, ATX_CLOSED, SETEXT, and UNDERLINED (which is an alias for SETEXT). Defaults to ATX.
        kwargs: Additional options to pass to markdownify.

    Example:
        .. code-block:: python
            from langchain_community.document_transformers import MarkdownifyTransformer
            markdownify = MarkdownifyTransformer()
            docs_transform = markdownify.transform_documents(docs)

    More configuration options can be found at the markdownify GitHub page:
    https://github.com/matthewwithanm/python-markdownify
    NTÚATXÚstripÚconvertÚ	autolinksÚheading_styleÚkwargsÚreturnc                 ó¬   — t          |t          ¦  «        r|gn|| _        t          |t          ¦  «        r|gn|| _        || _        || _        || _        d S )N)Ú
isinstanceÚstrr   r   r   r   Úadditional_options)Úselfr   r   r   r   r   s         ús/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_community/document_transformers/markdownify.pyÚ__init__zMarkdownifyTransformer.__init__   sY   € õ !+¨5µ#Ñ 6Ô 6ÐA�e�W�W¸EˆŒ
Ý$.¨w½Ñ$<Ô$<ÐI˜�y�yÀ'ˆŒØ"ˆŒØ*ˆÔØ"(ˆÔÐÐó    Ú	documentsc           
      ó€  — 	 ddl m } n# t          $ r t          d¦  «        ‚w xY wg }|D ]“} |d
|j        | j        | j        | j        | j        dœ| j        ¤Ž                     dd¦  «                             ¦   «         }t          j
        dd|¦  «        }|                     t          ||j        ¬	¦  «        ¦  «         Œ”|S )Nr   )Úmarkdownifyz`markdownify package not found, please 
                install it with `pip install markdownify`)Úhtmlr   r   r   r   õ   Â ú z\n\s*\nz

)Úmetadata© )r   ÚImportErrorÚpage_contentr   r   r   r   r   ÚreplaceÚreÚsubÚappendr	   r!   )r   r   r   r   Úconverted_documentsÚdocÚmarkdown_contentÚcleaned_markdowns           r   Útransform_documentsz*MarkdownifyTransformer.transform_documents*   s  € ð
	Ø/Ð/Ð/Ð/Ð/Ð/Ð/øÝð 	ð 	ð 	Ýð=ñô ð ð	øøøð !ÐØð 	ð 	ˆCà�ð ØÔ)Øœ*Ø œLØ"œnØ"&Ô"4ðð ð Ô-ðð ÷ ’˜ Ñ%Ô%ß’‘”ð õ  "œv j°&Ð:JÑKÔKÐà×&Ò&ÝÐ)°C´LÐAÑAÔAñô ð ð ð #Ð"s   ‚	 ‰#)NNTr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Úboolr   r   r   r	   r-   r"   r   r   r   r      sÝ   € € € € € ðð ð, 26Ø37ØØ"ð)ð )à˜˜c 4¨¤9˜nÔ-Ô.ð)ð ˜%  T¨#¤Y Ô/Ô0ð)ð ð	)ð
 ð)ð ð)ð 
ð)ð )ð )ð )ð"#à˜HÔ%ð"#ð ð"#ð 
�(Ô	ð	"#ð "#ð "#ð "#ð "#ð "#r   r   )r&   Útypingr   r   r   r   r   Úlangchain_core.documentsr   r	   r   r"   r   r   ú<module>r5      s�   ðØ 	€	€	€	Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7à FÐ FÐ FÐ FÐ FÐ FÐ FÐ FðE#ð E#ð E#ð E#ð E#Ð4ñ E#ô E#ð E#ð E#ð E#r   