File: //opt/cppython/lib/python3.8/site-packages/botocore/docs/__pycache__/translator.cpython-38.pyc
U
KD�g � @ s8 d dl mZ d dlmZ d dlmZ G dd� de�ZdS )� )�nodes)�admonitionlabels)�HTML5Translatorc s8 e Zd ZdZdgZd
dd�Zdd� Z� fdd �Z� ZS )�BotoHTML5TranslatorzEExtension of Sphinx's ``HTML5Translator`` for Botocore documentation.z
[REQUIRED]� c C s@ | j �| j|dd| d�� |r<dt| � d�}| j �|� dS )z;Uses the h3 tag for admonition titles instead of the p tag.�divzadmonition )ZCLASSz<h3 class='admonition-title'> z</h3>N)�body�appendZstarttagr )�self�node�name�title� r �E/opt/cppython/lib/python3.8/site-packages/botocore/docs/translator.py�visit_admonition s ��z$BotoHTML5Translator.visit_admonitionc C sV t |�dkoTt|d tj�oTt |d �dkoTt|d d tj�oT|d d �� | jkS )z�Determines 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�TextZastext�IGNORE_IMPLICIT_HEADINGS)r
r r r r �is_implicit_heading$ s ����z'BotoHTML5Translator.is_implicit_headingc sB | � |�r2|d d }| j�d|� d�� tj�nt� �|� dS )z�Visit 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 ZSkipNode�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)Zdocutilsr Z
sphinx.localer Zsphinx.writers.html5r ZSphinxHTML5Translatorr r r r r �<module>
s