HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/writers/__pycache__/texinfo.cpython-310.pyc
o

�$�a���@s�dZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddlmZmZddlmZmZmZddlmZmZddlmZdd	lm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&m'Z'm(Z(dd
l)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0er�ddl1m2Z2e*�3e4�Z5dZ6dedZ7dedeej8fdd�Z9d!de:de:de:fdd�Z;Gdd�dej<�Z=Gdd �d e,�Z>dS)"z�
    sphinx.writers.texinfo
    ~~~~~~~~~~~~~~~~~~~~~~

    Custom docutils writer for Texinfo.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�
TYPE_CHECKING�Any�Dict�Iterable�Iterator�List�Optional�Pattern�Set�Tuple�Union�cast)�nodes�writers)�Element�Node�Text)�__display_version__�addnodes)�RemovedInSphinx50Warning)�
IndexEntry)�IndexDomain)�ExtensionError)�_�__�admonitionlabels)�logging)�SphinxTranslator)�format_date)�collected_footnote)�TexinfoBuilderzn@quotation
%(project)s %(release)s, %(date)s

%(author)s

Copyright @copyright{} %(copyright)s
@end quotation
z�\input texinfo   @c -*-texinfo-*-
@c %%**start of header
@setfilename %(filename)s
@documentencoding UTF-8
@ifinfo
@*Generated by Sphinx a.@*
@end ifinfo
@settitle %(title)s
@defindex ge
@paragraphindent %(paragraphindent)s
@exampleindent %(exampleindent)s
@finalout
%(direntry)s
@definfoenclose strong,`,'
@definfoenclose emph,`,'
@c %%**end of header

@copying
%(copying)s
@end copying

@titlepage
@title %(title)s
@insertcopying
@end titlepage
@contents

@c %%** start of user preamble
%(preamble)s
@c %%** end of user preamble

@ifnottex
@node Top
@top %(title)s
@insertcopying
@end ifnottex

@c %%**start of body
%(body)s
@c %%**end of body
@bye
�section�returncCsDg}|D]}t|tj�r|�|�qt|tj�r|�t|��q|S)z7Return a list of subsections for the given ``section``.)�
isinstancerr"�appendr�extend�find_subsections)r"�result�child�r*�8/usr/lib/python3/dist-packages/sphinx/writers/texinfo.pyr'^s
�r'�s�sepcCsH|�|�}t|�D]\}}tdd�|D��r|��||<q	|p d�|�S)z_Like string.capwords() but does not capitalize words that already
    contain a capital letter.cs��|]}|��VqdS�N)�islower)�.0�xr*r*r+�	<genexpr>o��z!smart_capwords.<locals>.<genexpr>� )�split�	enumerate�all�
capitalize�join)r,r-�words�i�wordr*r*r+�smart_capwordsjs
�r>c
s�eZdZUdZdZddddgddifd	d
gddifddgddifd
dgddifffZeeeeeee	ee
eeffdffed<iZe
ed<dZ
eed<dZd�fdd�Zddd�Z�ZS)�
TexinfoWriterz0Texinfo writer for generating Texinfo documents.)�texinfo�texizTexinfo Specific OptionsNzName of the Info filez--texinfo-filename�default�z	Dir entryz--texinfo-dir-entry�Descriptionz--texinfo-dir-description�Categoryz--texinfo-dir-category�
Miscellaneous.�
settings_spec�settings_defaults�output)rI�fragment�builderr!r#cst���||_dSr/)�super�__init__rK)�selfrK��	__class__r*r+rM�s

zTexinfoWriter.__init__cCsX|j�|j|j�}tt|�|_|j�|�|j��|jD]}t	||t
|j|��qdSr/)rK�create_translator�documentr�TexinfoTranslator�visitor�	walkabout�finish�visitor_attributes�setattr�getattr)rNrT�attrr*r*r+�	translate�s

�zTexinfoWriter.translate)rKr!r#N�r#N)�__name__�
__module__�__qualname__�__doc__�	supportedrGr�strrrr�__annotations__rHrIrWrMr[�
__classcell__r*r*rOr+r?ts"
��4�r?c
s8eZdZUdZded<dZddddddddddddd�Zd	ejddd
df�fdd�Z	�d�d
d�Z
�d�dd�Z�d�dd�Z�d�dd�Z
�d�dd�Zded
efdd�Zded
efdd�Zded
efdd�Zded
efdd�Z�d�d d!�Zd"ed#ed$ed
efd%d&�Ze�d'�fd(eed)ed
dfd*d+�Zd#ed
dfd,d-�Zd.ed
efd/d0�Z�d�d1d2�Zd3ed
eeee e!e"fffd4d5�Z#d6ed
efd7d8�Z$d6ed3e%d
dfd9d:�Z&d6ed"ed3e%d
dfd;d<�Z'd3ed
dfd=d>�Z(d3ed
dfd?d@�Z)d3e*d
dfdAdB�Z+d3e*d
dfdCdD�Z,d3ed
dfdEdF�Z-d3ed
dfdGdH�Z.dIZ/dJZ0d3ed
dfdKdL�Z1d3ed
dfdMdN�Z2d3ed
dfdOdP�Z3d3ed
dfdQdR�Z4d3ed
dfdSdT�Z5d3ed
dfdUdV�Z6d3ed
dfdWdX�Z7d3ed
dfdYdZ�Z8d3ed
dfd[d\�Z9d3ed
dfd]d^�Z:d3ed
dfd_d`�Z;d3ed
dfdadb�Z<d3ed
dfdcdd�Z=d3ed
dfdedf�Z>d3ed
dfdgdh�Z?d3ed
dfdidj�Z@d3ed
dfdkdl�ZAd3ed
dfdmdn�ZBeAZCeBZDd3ed
dfdodp�ZEd3ed
dfdqdr�ZFd3ed
dfdsdt�ZGd3ed
dfdudv�ZHd3ed
dfdwdx�ZId3ed
dfdydz�ZJd3ed
dfd{d|�ZKd3ed
dfd}d~�ZLd3ed
dfdd��ZMd3ed
dfd�d��ZNd3ed
dfd�d��ZOd3ed
dfd�d��ZPd3ed
dfd�d��ZQd3ed
dfd�d��ZRd3ed
dfd�d��ZSd3ed
dfd�d��ZTd3ed
dfd�d��ZUd3ed
dfd�d��ZVd3ed
dfd�d��ZWd3ed
dfd�d��ZXd3ed
dfd�d��ZYd3ed
dfd�d��ZZd3ed
dfd�d��Z[d3ed
dfd�d��Z\d3ed
dfd�d��Z]d3ed
dfd�d��Z^d3ed
dfd�d��Z_d3ed
dfd�d��Z`d3ed
dfd�d��Zad3ed
dfd�d��Zbd3ed
dfd�d��Zcd3ed
dfd�d��Zdd3ed
dfd�d��Zed3ed
dfd�d��Zfd3ed
dfd�d��Zgd3ed
dfd�d��Zhd3ed
dfd�d��Zid3ed
dfd�d��Zjd3ed
dfd�d��Zkd3ed
dfd�d��Zld3ed
dfd�d��Zmd3ed
dfd�d„Znd3ed
dfd�dĄZod3ed
dfd�dƄZpd3ed
dfd�dȄZqd3ed
dfd�dʄZrd3ed
dfd�d̄Zsd3ed
dfd�d΄Ztd3ed
dfd�dЄZud3ed
dfd�d҄Zvd3ed
dfd�dԄZwd3ed
dfd�dքZxd3ed
dfd�d؄Zyd3ed
dfd�dڄZzd3ed
dfd�d܄Z{d3ed
dfd�dބZ|d3ed
dfd�d�Z}d3ed
dfd�d�Z~d3ed
dfd�d�Zd3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d�Z�d3ed
dfd�d��Z�d3ed
dfd�d��Z�d3ed
dfd�d��Z�d3ed
dfd�d��Z�d3ed
dfd�d��Z�d3ed
dfd��d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z��d�d3ed"ed
df�d�d�Z�d3ed
df�d	�d
�Z�d3ed
df�d�d�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�e�Z�d3ed
df�d
�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d�Z�d3ed
df�d�d �Z�d3ed
df�d!�d"�Z�d3ed
df�d#�d$�Z�d3ed
df�d%�d&�Z�d3ed
df�d'�d(�Z�d3ed
df�d)�d*�Z�d3ed
df�d+�d,�Z�d3ed
df�d-�d.�Z�d3ed
df�d/�d0�Z�d3ed
df�d1�d2�Z�d3ed
df�d3�d4�Z�d3ed
df�d5�d6�Z�d3ed
df�d7�d8�Z�d3ed
df�d9�d:�Z�d3ed
df�d;�d<�Z�d3ed
df�d=�d>�Z�d3ed
df�d?�d@�Z�d3ed
df�dA�dB�Z�d3ed
df�dC�dD�Z�d3ed
df�dE�dF�Z�d3ed
df�dG�dH�Z�d3ed
df�dI�dJ�Z�d3ed
df�dK�dL�Z�d3ed
df�dM�dN�Z�d3ed
df�dO�dP�Z�d3ed
df�dQ�dR�Z�d3ed
df�dS�dT�Z�d3ed
df�dU�dV�Z�d3e%d
df�dW�dX�Z�d3e%d
df�dY�dZ�Z�d3ed
df�d[�d\�Z�d3ed
df�d]�d^�Z�d3ed
df�d_�d`�Z�d3ed
df�da�db�Z�d3ed
df�dc�dd�Z�d3ed
df�de�df�Z�d3ed
df�dg�dh�Z�d3ed
df�di�dj�Z�d3ed
df�dk�dl�Z�d3ed
df�dm�dn�Z�d3ed
df�do�dp�Z�d3ed
df�dq�dr�Z�d3ed
df�ds�dt�Z�d3ed
df�du�dv�Z�d3ed
df�dw�dx�Z�d3ed
df�dy�dz�Z�d3ed
df�d{�d|�Z�d3ed
df�d}�d~�Z�d3ed
df�d�d��Z�d3e�j�d
df�d��d��Z�d3e�j�d
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d��Z�d3ed
df�d��d���Zd3ed
df�d��d���Zd3ed
df�d��d„�Zd3ed
df�dÐdĄ�Zd3ed
df�dŐdƄ�Zd3ed
df�dǐdȄ�Zd3ed
df�dɐdʄ�Zd3ed
df�dːd̄�Zd3ed
df�d͐d΄�Zd3ed
df�dϐdЄ�Z	d3ed
df�dѐd҄�Z
�ed
�ee�j�f�dӐdԄ�Z��Z
S(�rSNr!rKFrC�r)�author�body�copying�date�direntry�
exampleindent�filename�paragraphindent�preamble�project�release�titlerRr#cs�t��||�|��t�|_t�|_g|_i|_i|_i|_	i|_
|��|��|�
�|��g|_g|_g|_d|_d|_d|_t�|_d|_d|_g|_g|_d|_t�|_d|_dS)NrF)rLrM�
init_settings�set�written_ids�referenced_ids�indices�	short_ids�
node_names�
node_menus�rellinks�collect_indices�collect_node_names�collect_node_menus�collect_rellinksrg�context�descs�previous_section�
section_level�
seen_title�next_section_ids�escape_newlines�escape_hyphens�curfilestack�
footnotestack�in_footnote�
handled_abbrs�	colwidths)rNrRrKrOr*r+rM�s6
zTexinfoTranslator.__init__cCs�|jdur
|�d�|jD]"}|\}}t|g|j|�}|j�d|�|j�d||f�q
|jrJ|j��}||j	vrG|j�d|df�|js3|�
�d�|j�|_|j|j
d<t|j
|_dS)N�Top�
@node %s,%s,%s,%s
z@unnumbered %s

%s
z@anchor{%s}@w{%s}
z                              rCrg)r��add_menurv�tuplerzrgr%ru�poprt�
ensure_eolr:rJ�elements�TEMPLATErI)rN�index�name�content�pointers�rr*r*r+rV�s 




�zTexinfoTranslator.finishcCst|j��}|_|�|jj|jj|jj|�|j	j
�|�|j	j�|�|j	j�|�|j	j
p8t|j	jp3td�|j	jd��d��|jj}|sR|j�tj�}|rP|��nd}|�|�pXd|d<|ds�|j�d�pfd|d<|dd	d�d
vr}|ddd	�|d<|dd7<|jjr�|�|�|jj�d|d|�|jj��}d
|�|jj�|f|d<t||d<|�|jj�dS)Nz	%b %d, %Y)�language)rqrfrlrpro�	copyrightri�
<untitled>rqrl�source�untitled���)z.txtz.rstz.infoz(%s)z*@dircategory %s
@direntry
%s@end direntry
rjrh) �default_elements�copyr��update�settingsrqrf�texinfo_filename�escape�configrpror��todayr�	today_fmtrr�rR�	next_noder�astext�	escape_id�get�texinfo_dir_entry�format_menu_entry�escape_menu�
escape_arg�texinfo_dir_description�texinfo_dir_category�COPYING�texinfo_elements)rNr�rq�
title_node�entryr*r*r+rr�sH���
���zTexinfoTranslator.init_settingscs�dtdtf�fdd��d�jd<�d��d��fdd	��jD��_�j�tj�D]}ttj|�tj	��}|r<|�
�nd
}�|�|d<q*dS)zeGenerates a unique id for each section.

        Assigns the attribute ``node_name`` to each section.r�r#cs|��|�}d\}}||�jvs||�jvr-|d7}d|}||�jvs||�jvs||7}�j�|�|�j|<|S)N)�rCr�z<%s>)r�rtrx�add)r��node_id�nth�suffix�rNr*r+�
add_node_names
�
z;TexinfoTranslator.collect_node_names.<locals>.add_node_namer��	node_name�topcsg|]
\}}�|�|f�qSr*r*)r1r�r�)r�r*r+�
<listcomp>s�z8TexinfoTranslator.collect_node_names.<locals>.<listcomp>r�N)rbrRrv�traverserr"r�TextElementr��Titularr�)rNr"rqr�r*)r�rNr+r|s


��z$TexinfoTranslator.collect_node_namesc	Cs|j}|jg}|�|j�tj��|D]}d|vr|dsJ�dd�t|�D�}|||d<q|j�tj�}|r;|j	n|j}t
|tjtjf�sJ|j}||jurl||d}||ddd�7}||d<||d=d|d<|jD]\}}g||<|d�|�qodS)z1Collect the menu entries for each "node" section.r�cSsg|]}|d�qS)r�r*)r1r,r*r*r+r�,sz8TexinfoTranslator.collect_node_menus.<locals>.<listcomp>r�r�N)
ryrRr&r�rr"r'r�rq�parentr$rvr%)	rNry�targets�node�entriesrqr�r�r�r*r*r+r}%s*

�z$TexinfoTranslator.collect_node_menuscCs�|j}|j}|��D]
\}}gd�||<q
|��D]\}}|D]}|||d<qq|��D]-\}}t|�D]$\}}|dkrG||d||d<|t|�dkrY||d||d<q5q-z|dd}Wn
tymYdSw||dd<d||d<dS)z@Collect the relative links (next, previous, up) for each "node".)rCrCrC�rr�r�N)rzry�itemsr7�len�
IndexError)rNrzry�idr��er<�firstr*r*r+r~>s.����z"TexinfoTranslator.collect_rellinksr,cCs@|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)z8Return a string with Texinfo command characters escaped.�@z@@�{z@{�}z@}z``z`@w{`}z''z'@w{'})�replace�rNr,r*r*r+r�_szTexinfoTranslator.escapecC�,|�|�}|�dd�}d�|�����}|S)zVReturn an escaped string suitable for use as an argument
        to a Texinfo command.�,z@comma{}r5)r�r�r:r6�stripr�r*r*r+r�is
zTexinfoTranslator.escape_argcCsNd}|D]}|�|d�}qt�d|�r|�dd�}d�|�����}|�|�S)z=Return an escaped string suitable for node names and anchors.z,:()r5z[^ .]�.)r��re�searchr:r6r�r�)rNr,�	bad_chars�bcr*r*r+r�ss
zTexinfoTranslator.escape_idcCr�)z3Return an escaped string suitable for menu entries.�:�;r5)r�r�r:r6r�r�r*r*r+r�~s
zTexinfoTranslator.escape_menucCs4|jr|jddd�dkr|j�d�dSdSdS)z7Ensure the last line in body is terminated by new line.���N�
�rgr%r�r*r*r+r��s�zTexinfoTranslator.ensure_eolr�r��desccsn||kr
d|f}nd||f}tdt|�ddf��d��fdd�tj|d�d	�D��}||��dS)
Nz* %s:: z
* %s: %s. �re�Nr�c3s�|]	}d�|VqdS)r5Nr*)r1�l��offsetr*r+r3�s�z6TexinfoTranslator.format_menu_entry.<locals>.<genexpr>)�width)�maxr�r:�textwrap�wrapr�)rNr�r�r�r,�wdescr*r�r+r��s�z#TexinfoTranslator.format_menu_entryz
\s+---?\s+r��regc	Cs�|D]>}|j|}z|�|d�}Wnty|g}Ynwt|�dkr)|\}}nd}|�|�}|�|�}|j�|�|||��qdS)Nr�r�rC)	rxr6�	TypeErrorr�r�r�rgr%r�)rNr�r�r�r��partsr�r*r*r+�add_menu_entries�s

�


�z"TexinfoTranslator.add_menu_entriescs��j|}|s	dS�j�d���|�|dks#�j|dr#�jjr+�j�d�dSdtddf��fdd���j�d	�|D]}�|�q?�j�d
�dS)N�
@menu
r�rz
@end menu
r�r#csN�j|}|s	dS�j�d���j|����|�|D]}�|�qdS)Nz
%s

)ryrgr%r�rxr�)r�r��subentry��_add_detailed_menurNr*r+r��s


�z6TexinfoTranslator.add_menu.<locals>._add_detailed_menuz0
@detailmenu
 --- The Detailed Node Listing ---
z
@end detailmenu
@end menu
)ryrgr%r�r��texinfo_no_detailmenurb)rNr�r�r�r*r�r+r��s"

��	
zTexinfoTranslator.add_menu�	width_strcCsXt�d|�}|s
|S|}|��dd�\}}|r|dkrdS|dkr*dt|�d}|S)Nz(\d*\.?\d*)\s*(\S*)r��pxrC�%z%d.0ptgDI��@)r��match�groups�float)rNr�r��res�amount�unitr*r*r+�tex_image_length�sz"TexinfoTranslator.tex_image_lengthc	s�dtttttfdtdtf�fdd�}�jj}|rW�jjj	�
�D]4}|jD].}d|j|jf}t
|t�r;||vr;q'||���jj�\}}|sIq'�j�|j|||�f�q'q"tt�jj�d��}�jjD]}|j|ry�j�td�d	f�dSqedS)
Nr��	collapsedr#c
s�dg}|D]5\}}|D].}|dsq��|d�}��d|d|df�}��|d�}��|||�}	|�|	�qq|�d�d�|�S)	Nr��rz%s:%sr��z
@end menu
rC)r��get_short_idr�r�r%r:)
r�r��ret�letterr�r�r��sidr��mer�r*r+�generate�s�

z3TexinfoTranslator.collect_indices.<locals>.generatez%s-%sr��Indexz
@printindex ge
)rrrbr�boolr��texinfo_domain_indicesrK�env�domains�valuesrvr�r$�listr�docnamesr%�	localnamerr�
get_domainr�r)	rNr�indices_config�domain�indexcls�	indexnamer�r��docnamer*r�r+r{�s2*

�
��
��z!TexinfoTranslator.collect_indicesr�cshdtdttjf�fdd��i}�|�D]}ttj|d�}|����}tdg|j	�R�dg||<q|S)N�nr#c3sP�t|tj�r|VdS|jD]}t|tj�rqt|tj�r%�|�EdHqdSr/)r$r�footnote�childrenr�
start_of_filer)r�c��footnotes_underr*r+r�s�

��z<TexinfoTranslator.collect_footnotes.<locals>.footnotes_underrrCF)
rrrrr�labelr�r�r r)rNr��fnotes�fnr�numr*rr+�collect_footnotes�s	z#TexinfoTranslator.collect_footnotesr�cCsFz|j|}W|Sty"tt|j��dd�}||j|<Y|Sw)z-Return a shorter 'id' associated with ``id``.r�N)rw�KeyError�hexr�)rNr�rr*r*r+rs��zTexinfoTranslator.get_short_idcCsl|�d�rdS|jdd|}|�|�}|�|�}||fD]}||jvr3|j�d|�|j�|�qdS)Nzindex-r�r�z@anchor{%s})�
startswithr�r�rrtrgr%r�)rNr�r��eidrr*r*r+�
add_anchors



��zTexinfoTranslator.add_anchorcCsJ|�|�}|�|�}|j�d||f�|j�|�|j�|�|��dS)Nz@ref{%s,,%s})r�rrgr%rur�r�)rNr�r�r�rr*r*r+�add_xref!s


zTexinfoTranslator.add_xrefcCsB|j�|�|��|j�|�dd��d|vr|�d|�dSdS)NrrC�:doc)r�r%r!r�r�r&�rNr�r*r*r+�visit_document*s
�z TexinfoTranslator.visit_documentcC�|j��|j��dSr/)r�r�r�r)r*r*r+�depart_document0�
z!TexinfoTranslator.depart_documentcCsB|�|���}|jr|�dd�}|jr|�dd�}|j�|�dS)Nr�r5�-z@w{-})r�r�r�r�r�rgr%)rNr�r,r*r*r+�
visit_Text4szTexinfoTranslator.visit_TextcC�dSr/r*r)r*r*r+�depart_Text=�zTexinfoTranslator.depart_TextcCs�|j�|�dg��|jsdS|jr|�|jd�n|�d�|d}t|g|j|�}|j�	d|�t
|j�D]}|�||�q;|j��t
tj|�|_|jd7_dS)N�idsr�r�r�r�)r�r�r�r�r�r�r�rzrgr%�sortedr&�clearrrr"r�)rNr�r�r�r�r*r*r+�
visit_section@s

zTexinfoTranslator.visit_sectioncC�|jd8_dS�Nr�)r�r)r*r*r+�depart_sectionS�z TexinfoTranslator.depart_section)z@unnumberedz@chapterz@sectionz@subsectionz@subsubsection)z@headingz@subheadingz@subsubheadingcCs�|js	d|_tj�|j}t|tj�rdSt|tjtjtjf�r"tj�t|tj	�s8t
jtd�|d�|�
|�dSz|j|j}WntyN|jd}Ynw|j�d|�dS)NTzJencountered title node not in section, topic, table, admonition or sidebar��locationr��
%s )r�r�SkipNoder�r$�table�
Admonition�sidebar�topicr"�logger�warningr�visit_rubric�headingsr�r�rgr%)rNr�r��headingr*r*r+�visit_titleds&
��zTexinfoTranslator.visit_titlecC�|j�d�dS�N�

r�r)r*r*r+�depart_titley�zTexinfoTranslator.depart_titlecCsvt|�dkr|��dtd�fvrtj�z|j|j}Wnty)|jd}Ynw|j�	d|�|j
d7_
dS)Nr��	Footnotesr�r=)r�r�rrr>�rubricsr�r�rgr%r�)rNr��rubricr*r*r+rE|s �zTexinfoTranslator.visit_rubriccCs|jd8_|j�d�dS)Nr�rK)r�rgr%r)r*r*r+�
depart_rubric��zTexinfoTranslator.depart_rubriccCrI)Nz

@noindent
r�r)r*r*r+�visit_subtitle�rMz TexinfoTranslator.visit_subtitlecCrIrJr�r)r*r*r+�depart_subtitle�rMz!TexinfoTranslator.depart_subtitlec	Cs�|j�|�}z?z	|j|d}Wnty%|jj|jj�|j�}Ynwt|tj�rD|�d�r9|j�|d�|j�	|d�WdSWntt
fyPYnwd|vrWdS|�d�rd|�|d|�|dD]}|�||�qhdS)Nr��refidr3�refuri)r�r�r�r$rr"r�r�r�r��AttributeErrorr&)rNr��parindex�nextr�r*r*r+�visit_target�s.�
��
�zTexinfoTranslator.visit_targetcCr0r/r*r)r*r*r+�
depart_target�r2zTexinfoTranslator.depart_targetcCs�t|jtjtjf�rdSt|dtj�rdS|�d|����	�}|�dd�}|s:|�d�r:d|j
dd|d}|s>dS|�d	�ro|�|d
d��}|�|�}|rW||krb|j
�d|�tj�|j
�d||f�tj�|�d�r�|j
dd
|dd�}|�|||�tj�|�d�r�|�d�}|dkr�|dd�d}n
|dd��dd
�}|�|||�tj�|�d��r|dd��dd�}|�|�}d}d|vr�|�dd�\}}|�|�}|�|�}||kr�|j
�d||f�tj�|j
�d|||f�tj�|�|�}|�|�}|jj}|j�rd}|�r||k�r)|j
�d|�tj�|dk�r;|j
�d||f�tj�|dk�rM|j
�d||f�tj�|j
�d||f�tj�)Nrr�rVrCrUr�r��#zmailto:�z
@email{%s}z
@email{%s,%s}r�r�z::doczinfo:�rr5r�z
@ref{%s,,,%s}z@ref{%s,,%s,%s}�inlinez@indicateurl{%s}z@uref{%s,%s}�noz
@uref{%s,,%s}z%s@footnote{%s})r$r�rrqr�	desc_type�imager�r�r�r�r$r�rgr%r'�findr�r6r�r�r��texinfo_show_urlsr�r>)rNr�r��urir��	hashindex�	show_urlsr*r*r+�visit_reference�st

,�*
�&
�
�


�
�

�
��z!TexinfoTranslator.visit_referencecCr0r/r*r)r*r*r+�depart_reference�r2z"TexinfoTranslator.depart_referencecCs"t�|�dd��}|�|�tj�)Nrqr\)rrr�r/r>�rNr��textr*r*r+�visit_number_reference�s
z(TexinfoTranslator.visit_number_referencecCs$|��}|j�d|�|��tj�)Nz	@cite{%s})r�rgr%r�rr>rjr*r*r+�visit_title_reference�sz'TexinfoTranslator.visit_title_referencecCrI�Nr�r�r)r*r*r+�visit_paragraph�rMz!TexinfoTranslator.visit_paragraphcCrIrnr�r)r*r*r+�depart_paragraph�rMz"TexinfoTranslator.depart_paragraphcCrI)Nz
@quotation
r�r)r*r*r+�visit_block_quoterMz#TexinfoTranslator.visit_block_quotecC�|��|j�d�dS)Nz@end quotation
�r�rgr%r)r*r*r+�depart_block_quote�z$TexinfoTranslator.depart_block_quotecCrI)Nz

@example
r�r)r*r*r+�visit_literal_blockrMz%TexinfoTranslator.visit_literal_blockcCrr)Nz
@end example
rsr)r*r*r+�depart_literal_blockruz&TexinfoTranslator.depart_literal_blockcCs*t|jtj�s
|j�d�|j�d�dS)NrKz	@display
)r$r�r�
line_blockrgr%r)r*r*r+�visit_line_blocksz"TexinfoTranslator.visit_line_blockcCs.|j�d�t|jtj�s|j�d�dSdS)Nz
@end display
rK)rgr%r$r�rrxr)r*r*r+�depart_line_blocks�z#TexinfoTranslator.depart_line_blockcCs|jd7_dSr8�r�r)r*r*r+�
visit_liner:zTexinfoTranslator.visit_linecC�|j�d�|jd8_dS)Nz@w{ }
r�)rgr%r�r)r*r*r+�depart_line�zTexinfoTranslator.depart_linecCrI)Nz@strong{r�r)r*r*r+�visit_strong%rMzTexinfoTranslator.visit_strongcCrI�Nr�r�r)r*r*r+�
depart_strong(rMzTexinfoTranslator.depart_strongcCrI)Nz@emph{r�r)r*r*r+�visit_emphasis+rMz TexinfoTranslator.visit_emphasiscCrIr�r�r)r*r*r+�depart_emphasis.rMz!TexinfoTranslator.depart_emphasiscCrI�Nz@code{r�r)r*r*r+�
visit_literal1rMzTexinfoTranslator.visit_literalcCrIr�r�r)r*r*r+�depart_literal4rMz TexinfoTranslator.depart_literalcCrI)Nz@w{^r�r)r*r*r+�visit_superscript7rMz#TexinfoTranslator.visit_superscriptcCrIr�r�r)r*r*r+�depart_superscript:rMz$TexinfoTranslator.depart_superscriptcCrI�Nz@w{[r�r)r*r*r+�visit_subscript=rMz!TexinfoTranslator.visit_subscriptcCrI�Nz]}r�r)r*r*r+�depart_subscript@rMz"TexinfoTranslator.depart_subscriptcC�tj�r/�rr>r)r*r*r+�visit_footnoteE�z TexinfoTranslator.visit_footnotecCs|jd7_|j�d�dS)Nr�z
@footnote{)r�rgr%r)r*r*r+�visit_collected_footnoteHrRz*TexinfoTranslator.visit_collected_footnotecCr})Nr�r�)rgr%r�r)r*r*r+�depart_collected_footnoteLrz+TexinfoTranslator.depart_collected_footnotec
CsX|����}z|jd|\}}Wnttfy#}ztj|�d}~ww|�|�tj�)Nr�)	r�r�r�r"r�rr>rU�SkipChildren)rNr�r �footnode�used�excr*r*r+�visit_footnote_referencePs��
z*TexinfoTranslator.visit_footnote_referencecCs:|j�d�|�d�D]}|�||�q|jd7_dS)Nr�r3r�)rgr%r�r&r�)rNr�r�r*r*r+�visit_citationZsz TexinfoTranslator.visit_citationcCr7r8r{r)r*r*r+�depart_citation`r:z!TexinfoTranslator.depart_citationcCrIr�r�r)r*r*r+�visit_citation_referencecrMz*TexinfoTranslator.visit_citation_referencecCrIr�r�r)r*r*r+�depart_citation_referencefrMz+TexinfoTranslator.depart_citation_referencecCs |�dd�}|j�d|�dS)N�bullet�*z

@itemize %s
�r�rgr%)rNr�r�r*r*r+�visit_bullet_listksz#TexinfoTranslator.visit_bullet_listcCrr)Nz
@end itemize
rsr)r*r*r+�depart_bullet_listoruz$TexinfoTranslator.depart_bullet_listcCs@|�dd�}dddd�}|�d|�|d��}|j�d|�dS)	N�enumtype�arabicrC�a�A)r��
loweralpha�
upperalpha�startz

@enumerate %s
r�)rNr��enum�startersr�r*r*r+�visit_enumerated_listss�z'TexinfoTranslator.visit_enumerated_listcCrr)Nz@end enumerate
rsr)r*r*r+�depart_enumerated_list|ruz(TexinfoTranslator.depart_enumerated_listcCrI)Nz
@item r�r)r*r*r+�visit_list_item�rMz!TexinfoTranslator.visit_list_itemcCr0r/r*r)r*r*r+�depart_list_item�r2z"TexinfoTranslator.depart_list_itemcCrI)Nz

@table @option
r�r)r*r*r+�visit_option_list�rMz#TexinfoTranslator.visit_option_listcCrr�Nz@end table
rsr)r*r*r+�depart_option_list�ruz$TexinfoTranslator.depart_option_listcCr0r/r*r)r*r*r+�visit_option_list_item�r2z(TexinfoTranslator.visit_option_list_itemcCr0r/r*r)r*r*r+�depart_option_list_item�r2z)TexinfoTranslator.depart_option_list_itemcC�
d|_dS�Nz@item��	at_item_xr)r*r*r+�visit_option_group��
z$TexinfoTranslator.visit_option_groupcCr0r/r*r)r*r*r+�depart_option_group�r2z%TexinfoTranslator.depart_option_groupcCs*|jd7_|j�d|j�d|_dS)Nr�r=�@itemx)r�rgr%r�r)r*r*r+�visit_option�s
zTexinfoTranslator.visit_optioncCr7r8)r�r)r*r*r+�
depart_option�r:zTexinfoTranslator.depart_optioncCr0r/r*r)r*r*r+�visit_option_string�r2z%TexinfoTranslator.visit_option_stringcCr0r/r*r)r*r*r+�depart_option_string�r2z&TexinfoTranslator.depart_option_stringcCs|j�|�dd��dS)N�	delimiterr5)rgr%r�r)r*r*r+�visit_option_argument�sz'TexinfoTranslator.visit_option_argumentcCr0r/r*r)r*r*r+�depart_option_argument�r2z(TexinfoTranslator.depart_option_argumentcCrIrnr�r)r*r*r+�visit_description�rMz#TexinfoTranslator.visit_descriptioncCr0r/r*r)r*r*r+�depart_description�r2z$TexinfoTranslator.depart_descriptioncCrI)Nz

@table @asis
r�r)r*r*r+�visit_definition_list�rMz'TexinfoTranslator.visit_definition_listcCrrr�rsr)r*r*r+�depart_definition_list�ruz(TexinfoTranslator.depart_definition_listcCr�r�r�r)r*r*r+�visit_definition_list_item�r�z,TexinfoTranslator.visit_definition_list_itemcCr0r/r*r)r*r*r+�depart_definition_list_item�r2z-TexinfoTranslator.depart_definition_list_itemcCsp|�d�D]}|�||�q|dd�D]}t|tjtjf�r)|�|�|�|�q|j	�
d|j�d|_dS)Nr3r=r�)r�r&r$rr�r�targetrU�removergr%r�)rNr�r�rr*r*r+�
visit_term�s

�
zTexinfoTranslator.visit_termcCr0r/r*r)r*r*r+�depart_term�r2zTexinfoTranslator.depart_termcCrI)Nz : r�r)r*r*r+�visit_classifier�rMz"TexinfoTranslator.visit_classifiercCr0r/r*r)r*r*r+�depart_classifier�r2z#TexinfoTranslator.depart_classifiercCrIrnr�r)r*r*r+�visit_definition�rMz"TexinfoTranslator.visit_definitioncCr0r/r*r)r*r*r+�depart_definition�r2z#TexinfoTranslator.depart_definitioncCr�r���	entry_sepr)r*r*r+�visit_table�r�zTexinfoTranslator.visit_tablecCrI)Nz
@end multitable

r�r)r*r*r+�depart_table�rMzTexinfoTranslator.depart_tablecCr0r/r*r)r*r*r+�visit_tabular_col_spec�r2z(TexinfoTranslator.visit_tabular_col_speccCr0r/r*r)r*r*r+�depart_tabular_col_spec�r2z)TexinfoTranslator.depart_tabular_col_speccCs`|j�|d�t|j�|jkrdS|j�d�t|j�D]\}}|j�dd|d�qdS)N�colwidthz

@multitable z{%s} r2r�)r�r%r��n_colsrgr7)rNr�r<rr*r*r+�
visit_colspec�s�zTexinfoTranslator.visit_colspeccCr0r/r*r)r*r*r+�depart_colspec�r2z TexinfoTranslator.depart_colspeccCsg|_|d|_dS)N�cols)r�r�r)r*r*r+�visit_tgroup�szTexinfoTranslator.visit_tgroupcCr0r/r*r)r*r*r+�
depart_tgroup�r2zTexinfoTranslator.depart_tgroupcCr�)Nz	@headitemr�r)r*r*r+�visit_thead�r�zTexinfoTranslator.visit_theadcCr0r/r*r)r*r*r+�depart_theadr2zTexinfoTranslator.depart_theadcCr0r/r*r)r*r*r+�visit_tbodyr2zTexinfoTranslator.visit_tbodycCr0r/r*r)r*r*r+�depart_tbodyr2zTexinfoTranslator.depart_tbodycCr0r/r*r)r*r*r+�	visit_row
r2zTexinfoTranslator.visit_rowcCr�r�r�r)r*r*r+�
depart_row
r�zTexinfoTranslator.depart_rowcCs|j�d|j�d|_dS)Nz
%s
z@tab)rgr%r�r)r*r*r+�visit_entrys
zTexinfoTranslator.visit_entrycCs&t|�dd��D]}|j�d�qdS)N�morecolsrz
@tab
)�ranger�rgr%)rNr�r<r*r*r+�depart_entrys�zTexinfoTranslator.depart_entrycCr0r/r*r)r*r*r+�visit_field_listr2z"TexinfoTranslator.visit_field_listcCr0r/r*r)r*r*r+�depart_field_listr2z#TexinfoTranslator.depart_field_listcCrIrnr�r)r*r*r+�visit_field rMzTexinfoTranslator.visit_fieldcCrIrnr�r)r*r*r+�depart_field#rMzTexinfoTranslator.depart_fieldcCrr)Nz@*rsr)r*r*r+�visit_field_name&ruz"TexinfoTranslator.visit_field_namecCrI)Nz: r�r)r*r*r+�depart_field_name*rMz#TexinfoTranslator.depart_field_namecCr0r/r*r)r*r*r+�visit_field_body-r2z"TexinfoTranslator.visit_field_bodycCr0r/r*r)r*r*r+�depart_field_body0r2z#TexinfoTranslator.depart_field_bodycCs6|sttj|d�}|�|���}|j�d|�dS)Nr�
@cartouche
@quotation %s )rrrqr�r�rgr%)rNr�r�rqr*r*r+�visit_admonition5sz"TexinfoTranslator.visit_admonitioncCst|j}|j�d|�dS)Nr�)r�tagnamergr%)rNr�rr*r*r+�_visit_named_admonition;s
z)TexinfoTranslator._visit_named_admonitioncCrr)Nz@end quotation
@end cartouche
rsr)r*r*r+�depart_admonition?ruz#TexinfoTranslator.depart_admonitioncCr�r/r�r)r*r*r+�
visit_docinfoYr�zTexinfoTranslator.visit_docinfocCr�r/r�r)r*r*r+�visit_generated\r�z!TexinfoTranslator.visit_generatedcCr�r/r�r)r*r*r+�visit_header_r�zTexinfoTranslator.visit_headercCr�r/r�r)r*r*r+�visit_footerbr�zTexinfoTranslator.visit_footercC�|�d�r
|j�d�dSdS)N�
literal_blockz

@float LiteralBlock
r�r)r*r*r+�visit_containere�
�z!TexinfoTranslator.visit_containercCr�)Nr��
@end float

r�r)r*r*r+�depart_containerir�z"TexinfoTranslator.depart_containercCr0r/r*r)r*r*r+�visit_decorationmr2z"TexinfoTranslator.visit_decorationcCr0r/r*r)r*r*r+�depart_decorationpr2z#TexinfoTranslator.depart_decorationcCsXd|�dg�vrtj�ttj|d�}|�|�|j�d|�|�	���|�
|�dS)N�contents�classesrz%s
)r�rr>rrqrErgr%r�r�rQ)rNr�rqr*r*r+�visit_topicss
zTexinfoTranslator.visit_topiccCr0r/r*r)r*r*r+�depart_topic|r2zTexinfoTranslator.depart_topiccCs|j�dd�dS)Nz

%s

�B__________________________________________________________________r�r)r*r*r+�visit_transitionsz"TexinfoTranslator.visit_transitioncCr0r/r*r)r*r*r+�depart_transition�r2z#TexinfoTranslator.depart_transitioncCrI)Nz

@center --- r�r)r*r*r+�visit_attribution�rMz#TexinfoTranslator.visit_attributioncCrIrJr�r)r*r*r+�depart_attribution�rMz$TexinfoTranslator.depart_attributioncCs6|�dd���}d|vsd|vr|j�|���tj�)N�formatrCr@rA)r�r6rgr%r�rr>)rNr�r
r*r*r+�	visit_raw�szTexinfoTranslator.visit_rawcCrI)Nz

@float Figure
r�r)r*r*r+�visit_figure�rMzTexinfoTranslator.visit_figurecCrI)Nr�r�r)r*r*r+�
depart_figure�rMzTexinfoTranslator.depart_figurecCsNt|jtj�st|jtj�r|j�d�r|j�d�dStj	t
d�|d�dS)Nr�z

@caption{zcaption not inside a figure.r;)r$r�r�figure�	containerr�rgr%rCrDrr)r*r*r+�
visit_caption�s�
�

�zTexinfoTranslator.visit_captioncCs@t|jtj�st|jtj�r|j�d�r|j�d�dSdSdS)Nr�z}
)r$r�rrrr�rgr%r)r*r*r+�depart_caption�s�
��z TexinfoTranslator.depart_captionc	
Cs�|d|jjvr|jj|d}n	|jrdS|d}|�d�dkr#dSt�|�\}}|�|�dd��}|�|�dd��}|�|�dd��}d|j	d	dd
�|f}|j
�d|||||dd�f�dS)
Nrez://r�r�rC�height�altz
%s-figures/%srl���z
@image{%s,%s,%s,%s,%s}
r�)rK�images�ignore_missing_imagesrcr�splitextr�r�r�r�rgr%)	rNr�rer��extr�rrrlr*r*r+�visit_image�s
�zTexinfoTranslator.visit_imagecCr0r/r*r)r*r*r+�depart_image�r2zTexinfoTranslator.depart_imagecCr0r/r*r)r*r*r+�visit_compound�r2z TexinfoTranslator.visit_compoundcCr0r/r*r)r*r*r+�depart_compound�r2z!TexinfoTranslator.depart_compoundcC�|�|�dSr/)rr)r*r*r+�
visit_sidebar��zTexinfoTranslator.visit_sidebarcCrr/)rr)r*r*r+�depart_sidebar�rz TexinfoTranslator.depart_sidebarcCrI)Nz@w{(r�r)r*r*r+�visit_label�rMzTexinfoTranslator.visit_labelcCrI)Nz)} r�r)r*r*r+�depart_label�rMzTexinfoTranslator.depart_labelcCr0r/r*r)r*r*r+�visit_legend�r2zTexinfoTranslator.visit_legendcCr0r/r*r)r*r*r+�
depart_legend�r2zTexinfoTranslator.depart_legendcCr0r/r*r)r*r*r+�visit_substitution_reference�r2z.TexinfoTranslator.visit_substitution_referencecCr0r/r*r)r*r*r+�depart_substitution_reference�r2z/TexinfoTranslator.depart_substitution_referencecCr�r/r�r)r*r*r+�visit_substitution_definition�r�z/TexinfoTranslator.visit_substitution_definitioncCs|j�d|���tj�)Nz.
@verbatim
<SYSTEM MESSAGE: %s>
@end verbatim
)rgr%r�rr>r)r*r*r+�visit_system_message�s�z&TexinfoTranslator.visit_system_messagecCs4|j�d�|����D]
}|j�d|�qtj�)Nr�z@c %s
)rgr%r��
splitlinesrr>)rNr��liner*r*r+�
visit_comment�szTexinfoTranslator.visit_commentcCrI)Nz>>r�r)r*r*r+�visit_problematic�rMz#TexinfoTranslator.visit_problematiccCrI)Nz<<r�r)r*r*r+�depart_problematic�rMz$TexinfoTranslator.depart_problematiccC�tjtd�||d�dS)Nzunimplemented node type: %rr;�rCrDrr)r*r*r+�unimplemented_visit��
�z%TexinfoTranslator.unimplemented_visitcCr.)Nzunknown node type: %rr;r/r)r*r*r+�
unknown_visit�r1zTexinfoTranslator.unknown_visitcCr0r/r*r)r*r*r+�unknown_departure�r2z#TexinfoTranslator.unknown_departurecCs�|�d�g}tttj|�}|D]	}|�|d�qtdd�|D��}|D]:}|drD|�d�D]}|�||�q1|d�	|�d}ndd|}|j
�|�|��|j
�|�|��d��q&|�
d�tj�)	N�	tokennamecss�|]}t|�VqdSr/)r�)r1r�r*r*r+r3r4z9TexinfoTranslator.visit_productionlist.<locals>.<genexpr>r3z ::=z%s    r5r�)rvrrr�
productionr%r�r�r&�ljustrgr�r�rwrr>)rNr��names�productionlistr5�maxlenr�r,r*r*r+�visit_productionlist�s 

z&TexinfoTranslator.visit_productionlistcCr0r/r*r)r*r*r+�visit_productionr2z"TexinfoTranslator.visit_productioncCr0r/r*r)r*r*r+�depart_productionr2z#TexinfoTranslator.depart_productioncCrIr�r�r)r*r*r+�visit_literal_emphasisrMz(TexinfoTranslator.visit_literal_emphasiscCrIr�r�r)r*r*r+�depart_literal_emphasisrMz)TexinfoTranslator.depart_literal_emphasiscCrIr�r�r)r*r*r+�visit_literal_strongrMz&TexinfoTranslator.visit_literal_strongcCrIr�r�r)r*r*r+�depart_literal_strongrMz'TexinfoTranslator.depart_literal_strongcCs^t|jtj�r|��n|j�d�|dD]}|\}}}}}|�|�}|j�d|�qdS)Nr�r�z@geindex %s
)r$r�r�	paragraphr�rgr%r�)rNr�r��typrk�tid�text2�key_r*r*r+�visit_index"s

�zTexinfoTranslator.visit_indexcCrIrnr�r)r*r*r+�visit_versionmodified-rMz'TexinfoTranslator.visit_versionmodifiedcCrIrnr�r)r*r*r+�depart_versionmodified0rMz(TexinfoTranslator.depart_versionmodifiedcCs2|j�d�|j�|d�|j�|�|��dS)Nr(r)r�r�r�r%r�r!r)r*r*r+�visit_start_of_file3sz%TexinfoTranslator.visit_start_of_filecCr+r/)r�r�r�r)r*r*r+�depart_start_of_file9r-z&TexinfoTranslator.depart_start_of_filecCs$|�|���}|j�d|�tj�)Nz

@center %s

)r�r�rgr%rr>�rNr��txtr*r*r+�visit_centered=sz TexinfoTranslator.visit_centeredcCs|j�dtd�dS)Nz

@subsubheading %s

�seealso)rgr%rr)r*r*r+�
visit_seealsoBs
�zTexinfoTranslator.visit_seealsocCrIrnr�r)r*r*r+�depart_seealsoFrMz TexinfoTranslator.depart_seealsocCr�r/r�r)r*r*r+�
visit_metaIr�zTexinfoTranslator.visit_metacCr0r/r*r)r*r*r+�visit_glossaryLr2z TexinfoTranslator.visit_glossarycCr0r/r*r)r*r*r+�depart_glossaryOr2z!TexinfoTranslator.depart_glossarycCs^ttj|d�}tttj|�}|j�d�|j�d�dd�|D��d�|j�d�tj�)NrrK�, csr.r/)r�)r1rr*r*r+r3Vr4z/TexinfoTranslator.visit_acks.<locals>.<genexpr>r�)	rr�bullet_listr�	list_itemrgr%r:r>)rNr�rU�
list_itemsr*r*r+�
visit_acksRs zTexinfoTranslator.visit_ackscCs|j�|�d|_dS)Nz@deffn)r�r%�	at_deffnxr)r*r*r+�
visit_desca�
zTexinfoTranslator.visit_desccCs"|j��|��|j�d�dS)Nz@end deffn
)r�r�r�rgr%r)r*r*r+�depart_desces
zTexinfoTranslator.depart_descc	Cs�|jd7_|jd}|dkr|�d�D]}|�||�qz|jj�|jd�}|�|j||j	j
|jk�}Wn
tt
fyE|}Ynw|�t|��}|j�d|j|f�d|_||_dS)Nr��objtype�describer3rz	
%s {%s} z@deffnx)r�r�r�r&rKr
r�
get_type_name�object_typesr��primary_domainr�r"rr�r>rgr%rY�desc_type_name)rNr�r]r�rr��categoryr*r*r+�visit_desc_signaturejs"
��
z&TexinfoTranslator.visit_desc_signaturecCs$|j�d�|jd8_d|_dS)Nr�r�)rgr%r�rbr)r*r*r+�depart_desc_signature}s
z'TexinfoTranslator.depart_desc_signaturecCr0r/r*r)r*r*r+�visit_desc_signature_line�r2z+TexinfoTranslator.visit_desc_signature_linecCr0r/r*r)r*r*r+�depart_desc_signature_line�r2z,TexinfoTranslator.depart_desc_signature_linecCr0r/r*r)r*r*r+�visit_desc_content�r2z$TexinfoTranslator.visit_desc_contentcCr0r/r*r)r*r*r+�depart_desc_content�r2z%TexinfoTranslator.depart_desc_contentcCr0r/r*r)r*r*r+�visit_desc_inline�r2z#TexinfoTranslator.visit_desc_inlinecCr0r/r*r)r*r*r+�depart_desc_inline�r2z$TexinfoTranslator.depart_desc_inlinecCr0r/r*r)r*r*r+�visit_desc_name�r2z!TexinfoTranslator.visit_desc_namecCr0r/r*r)r*r*r+�depart_desc_name�r2z"TexinfoTranslator.depart_desc_namecCr0r/r*r)r*r*r+�visit_desc_addname�r2z$TexinfoTranslator.visit_desc_addnamecCr0r/r*r)r*r*r+�depart_desc_addname�r2z%TexinfoTranslator.depart_desc_addnamecCr0r/r*r)r*r*r+�visit_desc_type�r2z!TexinfoTranslator.visit_desc_typecCr0r/r*r)r*r*r+�depart_desc_type�r2z"TexinfoTranslator.depart_desc_typecCrI)Nz -> r�r)r*r*r+�visit_desc_returns�rMz$TexinfoTranslator.visit_desc_returnscCr0r/r*r)r*r*r+�depart_desc_returns�r2z%TexinfoTranslator.depart_desc_returnscCs|j�d�d|_dS)Nz (r�)rgr%�first_paramr)r*r*r+�visit_desc_parameterlist�r[z*TexinfoTranslator.visit_desc_parameterlistcCrI)N�)r�r)r*r*r+�depart_desc_parameterlist�rMz+TexinfoTranslator.depart_desc_parameterlistcCsF|js
|j�d�nd|_|�|���}|�dd�}|j�|�tj�)NrTr� z@w{ })rtrgr%r�r�r�rr>rjr*r*r+�visit_desc_parameter�sz&TexinfoTranslator.visit_desc_parametercCrI)N�[r�r)r*r*r+�visit_desc_optional�rMz%TexinfoTranslator.visit_desc_optionalcCrI)N�]r�r)r*r*r+�depart_desc_optional�rMz&TexinfoTranslator.depart_desc_optionalcCsF|����}|jr||jddks|jr||j��vr!tj�dSdS)Nr�r])r�r�r�rbr6rr>rKr*r*r+�visit_desc_annotation�s��z'TexinfoTranslator.visit_desc_annotationcCr0r/r*r)r*r*r+�depart_desc_annotation�r2z(TexinfoTranslator.depart_desc_annotationcCr0r/r*r)r*r*r+�visit_inline�r2zTexinfoTranslator.visit_inlinecCr0r/r*r)r*r*r+�
depart_inline�r2zTexinfoTranslator.depart_inlinecCsb|��}|j�d�|�d�r)||jvr)|j�d|�|d��|j�|�dS|j�d�dS)Nz@abbr{�explanationz,%s}r�)r�rgr%�hasattrr�rr�r�)rNr��abbrr*r*r+�visit_abbreviation�sz$TexinfoTranslator.visit_abbreviationcCs|j�|j���dSr/)rgr%rr�r)r*r*r+�depart_abbreviation�sz%TexinfoTranslator.depart_abbreviationcC�
|�|�Sr/)r=r)r*r*r+�
visit_manpage�r�zTexinfoTranslator.visit_manpagecCr�r/)r>r)r*r*r+�depart_manpage�r�z TexinfoTranslator.depart_manpagecCr0r/r*r)r*r*r+�visit_download_reference�r2z*TexinfoTranslator.visit_download_referencecCr0r/r*r)r*r*r+�depart_download_reference�r2z+TexinfoTranslator.depart_download_referencecCrr/)r�r)r*r*r+�visit_hlist�rzTexinfoTranslator.visit_hlistcCrr/)r�r)r*r*r+�depart_hlist�rzTexinfoTranslator.depart_hlistcCr0r/r*r)r*r*r+�visit_hlistcol�r2z TexinfoTranslator.visit_hlistcolcCr0r/r*r)r*r*r+�depart_hlistcol�r2z!TexinfoTranslator.depart_hlistcolcCr0r/r*r)r*r*r+�visit_pending_xrefr2z$TexinfoTranslator.visit_pending_xrefcCr0r/r*r)r*r*r+�depart_pending_xrefr2z%TexinfoTranslator.depart_pending_xrefcCs$|j�d|�|���d�tj�)Nz@math{r�)rgr%r�r�rr>r)r*r*r+�
visit_mathszTexinfoTranslator.visit_mathcCs:|�d�r
|�|d|�|j�d|�|����tj�)Nrz

@example
%s
@end example

)r�r&rgr%r�r�rr>r)r*r*r+�visit_math_blocks
�z"TexinfoTranslator.visit_math_blockcCs$t�dt�t|j�r|jdSdS)Nz!TexinfoWriter.desc is deprecated.r�)�warnings�warnrr�r�r�r*r*r+r�s

zTexinfoTranslator.descr\)rC(r]r^r_rKrcrr�rrRrMrVrrr|r}r~rbr�r�r�r�r�r�r��compilerr
r�r�r�r{rrr
r rr!rrr&r'r*r,rr/r1r6r9rFrOrHrLrErQrSrTrZr[rhrirlrmrorprqrtrvrw�visit_doctest_block�depart_doctest_blockryrzr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��visit_attention�depart_attention�
visit_caution�depart_caution�visit_danger�
depart_danger�visit_error�depart_error�
visit_hint�depart_hint�visit_important�depart_important�
visit_note�depart_note�	visit_tip�
depart_tip�
visit_warning�depart_warningr�r�r�r�r�r�r�rrrrrrr	rrr
rrrrrrrr r!r"r#r$r%r&r'r(r+r,r-r0r2r3r:r;r<r=r>r?r@rFrGrHrIrJrMrOrPrQrRrSrXrr�rZr\rdrerfrgrhrirjrkrlrmrnrorprqrrrsrurwryr{r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��propertyr	rdr*r*rOr+rS�s
�!*!



�&'		
?
				&rSr/)?r`r�r�r��osr�typingrrrrrrr	r
rrr
r�docutilsrr�docutils.nodesrrr�sphinxrr�sphinx.deprecationr�sphinx.domainsr�sphinx.domains.indexr�
sphinx.errorsr�
sphinx.localerrr�sphinx.utilr�sphinx.util.docutilsr�sphinx.util.i18nr�sphinx.writers.latexr �sphinx.builders.texinfor!�	getLoggerr]rCr�r�r"r'rbr>�Writerr?rSr*r*r*r+�<module>s>
8

��-