o
    	Jh	                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )nodes)admonitionlabels)HTML5Translatorc                       s8   e Zd ZdZdgZd
ddZdd Z fdd	Z  ZS )BotoHTML5TranslatorzEExtension of Sphinx's ``HTML5Translator`` for Botocore documentation.z
[REQUIRED] c                 C   sD   | j | j|dd| d |r dt|  d}| j | dS dS )z;Uses the h3 tag for admonition titles instead of the p tag.divzadmonition )CLASSz<h3 class='admonition-title'> z</h3>N)bodyappendstarttagr   )selfnodenametitle r   x/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/botocore/docs/translator.pyvisit_admonition   s   z$BotoHTML5Translator.visit_admonitionc                 C   sV   t |dko*t|d tjo*t |d dko*t|d d tjo*|d d  | jvS )zDetermines if a node is an implicit heading.

        An implicit heading is represented by a paragraph node whose only
        child is a strong node with text that isnt in `IGNORE_IMPLICIT_HEADINGS`.
           r   )len
isinstancer   strongTextastextIGNORE_IMPLICIT_HEADINGS)r   r   r   r   r   is_implicit_heading$   s   z'BotoHTML5Translator.is_implicit_headingc                    s@   |  |r|d d }| jd| d tjt | dS )zVisit a paragraph HTML element.

        Replaces implicit headings with an h3 tag and defers to default
        behavior for normal paragraph elements.
        r   z<h3>z</h3>
N)r   r	   r
   r   SkipNodesupervisit_paragraph)r   r   text	__class__r   r   r   2   s
   
z#BotoHTML5Translator.visit_paragraph)r   )	__name__
__module____qualname____doc__r   r   r   r   __classcell__r   r   r   r   r      s    
r   N)docutilsr   sphinx.localer   sphinx.writers.html5r   SphinxHTML5Translatorr   r   r   r   r   <module>   s   