o $a@sdZddlZddlZddlZddlmZddlmZmZm Z m Z m Z m Z m Z mZmZmZmZmZddlmZmZddlmZmZmZddlmZmZddlmZdd lm Z dd l!m"Z"dd l#m$Z$dd l%m&Z&m'Z'm(Z(dd l)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0erddl1m2Z2e*3e4Z5dZ6dedZ7dede ej8fddZ9d!de:de:de:fddZ;Gdddej<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_CHECKINGAnyDictIterableIteratorListOptionalPatternSetTupleUnioncast)nodeswriters)ElementNodeText)__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 sectionreturncCsDg}|D]}t|tjr||qt|tjr|t|q|S)z7Return a list of subsections for the given ``section``.) isinstancerr"appendrextendfind_subsections)r"resultchildr*8/usr/lib/python3/dist-packages/sphinx/writers/texinfo.pyr'^s   r'ssepcCsH||}t|D]\}}tdd|Dr|||<q |p d|S)z_Like string.capwords() but does not capitalize words that already contain a capital letter.cs|]}|VqdSN)islower).0xr*r*r+ oz!smart_capwords.. )split enumerateall capitalizejoin)r,r-wordsiwordr*r*r+smart_capwordsjs  r>c seZdZUdZdZddddgddifd d gddifd d gddifd dgddifffZeeeeeee ee eeffdffe d<iZ e e d<dZ ee d<dZdfdd ZdddZZS) TexinfoWriterz0Texinfo writer for generating Texinfo documents.)texinfotexizTexinfo Specific OptionsNzName of the Info filez--texinfo-filenamedefaultz Dir entryz--texinfo-dir-entry Descriptionz--texinfo-dir-descriptionCategoryz--texinfo-dir-category Miscellaneous. settings_specsettings_defaultsoutput)rIfragmentbuilderr!r#cst||_dSr/)super__init__rK)selfrK __class__r*r+rMs  zTexinfoWriter.__init__cCsX|j|j|j}tt||_|j||j|jD] }t ||t |j|qdSr/) rKcreate_translatordocumentrTexinfoTranslatorvisitor walkaboutfinishvisitor_attributessetattrgetattr)rNrTattrr*r*r+ translates    zTexinfoWriter.translate)rKr!r#Nr#N)__name__ __module__ __qualname____doc__ supportedrGr strrrr__annotations__rHrIrWrMr[ __classcell__r*r*rOr+r?ts" 4  r?c s8eZdZUdZded<dZddddddddddddd Zd ejddd dffd d Z dd dZ dddZ dddZ dddZ dddZded efddZded efddZded efddZded efddZdd d!Zd"ed#ed$ed efd%d&Zed'fd(eed)ed dfd*d+Zd#ed dfd,d-Zd.ed efd/d0Zdd1d2Zd3ed eeee e!e"fffd4d5Z#d6ed efd7d8Z$d6ed3e%d dfd9d:Z&d6ed"ed3e%d dfd;d<Z'd3ed dfd=d>Z(d3ed dfd?d@Z)d3e*d dfdAdBZ+d3e*d dfdCdDZ,d3ed dfdEdFZ-d3ed dfdGdHZ.dIZ/dJZ0d3ed dfdKdLZ1d3ed dfdMdNZ2d3ed dfdOdPZ3d3ed dfdQdRZ4d3ed dfdSdTZ5d3ed dfdUdVZ6d3ed dfdWdXZ7d3ed dfdYdZZ8d3ed dfd[d\Z9d3ed dfd]d^Z:d3ed dfd_d`Z;d3ed dfdadbZd3ed dfdgdhZ?d3ed dfdidjZ@d3ed dfdkdlZAd3ed dfdmdnZBeAZCeBZDd3ed dfdodpZEd3ed dfdqdrZFd3ed dfdsdtZGd3ed dfdudvZHd3ed dfdwdxZId3ed dfdydzZJd3ed dfd{d|ZKd3ed dfd}d~ZLd3ed dfddZMd3ed dfddZNd3ed dfddZOd3ed dfddZPd3ed dfddZQd3ed dfddZRd3ed dfddZSd3ed dfddZTd3ed dfddZUd3ed dfddZVd3ed dfddZWd3ed dfddZXd3ed dfddZYd3ed dfddZZd3ed dfddZ[d3ed dfddZ\d3ed dfddZ]d3ed dfddZ^d3ed dfddZ_d3ed dfddZ`d3ed dfddZad3ed dfddZbd3ed dfddZcd3ed dfddZdd3ed dfddZed3ed dfddZfd3ed dfddZgd3ed dfddZhd3ed dfddZid3ed dfddZjd3ed dfddZkd3ed dfddZld3ed dfddZmd3ed dfdd„Znd3ed dfddĄZod3ed dfddƄZpd3ed dfddȄZqd3ed dfddʄZrd3ed dfdd̄Zsd3ed dfdd΄Ztd3ed dfddЄZud3ed dfdd҄Zvd3ed dfddԄZwd3ed dfddքZxd3ed dfdd؄Zyd3ed dfddڄZzd3ed dfdd܄Z{d3ed dfddބZ|d3ed dfddZ}d3ed dfddZ~d3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZdd3ed"ed dfddZd3ed dfd d Zd3ed dfd d ZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZd3ed dfd dZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfdd Zd3ed dfd!d"Zd3ed dfd#d$Zd3ed dfd%d&Zd3ed dfd'd(Zd3ed dfd)d*Zd3ed dfd+d,Zd3ed dfd-d.Zd3ed dfd/d0Zd3ed dfd1d2Zd3ed dfd3d4Zd3ed dfd5d6Zd3ed dfd7d8Zd3ed dfd9d:Zd3ed dfd;d<Zd3ed dfd=d>Zd3ed dfd?d@Zd3ed dfdAdBZd3ed dfdCdDZd3ed dfdEdFZd3ed dfdGdHZd3ed dfdIdJZd3ed dfdKdLZd3ed dfdMdNZd3ed dfdOdPZd3ed dfdQdRZd3ed dfdSdTZd3ed dfdUdVZd3e%d dfdWdXZd3e%d dfdYdZZd3ed dfd[d\Zd3ed dfd]d^Zd3ed dfd_d`Zd3ed dfdadbZd3ed dfdcddZd3ed dfdedfZd3ed dfdgdhZd3ed dfdidjZd3ed dfdkdlZd3ed dfdmdnZd3ed dfdodpZd3ed dfdqdrZd3ed dfdsdtZd3ed dfdudvZd3ed dfdwdxZd3ed dfdydzZd3ed dfd{d|Zd3ed dfd}d~Zd3ed dfddZd3ejd dfddZd3ejd dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfddZd3ed dfdd„Zd3ed dfdÐdĄZd3ed dfdŐdƄZd3ed dfdǐdȄZd3ed dfdɐdʄZd3ed dfdːd̄Zd3ed dfd͐d΄Zd3ed dfdϐdЄZ d3ed dfdѐd҄Z e d e ejfdӐdԄZZ S(rSNr!rKFrCr) authorbodycopyingdatedirentry exampleindentfilenameparagraphindentpreambleprojectreleasetitlerRr#cst|||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_settingsset written_idsreferenced_idsindices short_ids node_names node_menusrellinkscollect_indicescollect_node_namescollect_node_menuscollect_rellinksrgcontextdescsprevious_section section_level seen_titlenext_section_idsescape_newlinesescape_hyphens curfilestack footnotestack in_footnote handled_abbrs colwidths)rNrRrKrOr*r+rMs6 zTexinfoTranslator.__init__cCs|jdur |d|jD]"}|\}}t|g|j|}|jd||jd||fq |jrJ|j}||j vrG|jd|df|js3| d |j|_ |j |j d<t|j |_dS)NTop @node %s,%s,%s,%s z@unnumbered %s %s z@anchor{%s}@w{%s} z rCrg)radd_menurvtuplerzrgr%rupoprt ensure_eolr:rJelementsTEMPLATErI)rNindexnamecontentpointersrr*r*r+rVs      zTexinfoTranslator.finishcCst|j}|_||jj|jj|jj||j j ||j j ||j j ||j j p8t|j jp3td|j jdd|jj}|sR|jtj}|rP|nd}||pXd|d<|ds|jdpfd|d<|dd dd vr}|ddd |d<|dd 7<|jjr|||jjd |d||jj}d ||jj|f|d<t||d<||jjdS)Nz %b %d, %Y)language)rqrfrlrpro copyrightri rqrlsourceuntitled)z.txtz.rstz.infoz(%s)z*@dircategory %s @direntry %s@end direntry rjrh) default_elementscopyrupdatesettingsrqrftexinfo_filenameescapeconfigrprortodayr today_fmtrrrR next_noderastext escape_idgettexinfo_dir_entryformat_menu_entry escape_menu escape_argtexinfo_dir_descriptiontexinfo_dir_categoryCOPYINGtexinfo_elements)rNrrq title_nodeentryr*r*r+rrsH        zTexinfoTranslator.init_settingscsdtdtffdd djd<ddfdd jD_jtjD]}ttj|tj }|r<| nd }||d<q*d S) zeGenerates a unique id for each section. Assigns the attribute ``node_name`` to each section.rr#cs||}d\}}||jvs||jvr-|d7}d|}||jvs||jvs||7}j||j|<|S)N)rCrz<%s>)rrtrxadd)rnode_idnthsuffixrNr*r+ add_node_name s   z;TexinfoTranslator.collect_node_names..add_node_namer node_nametopcsg|] \}}||fqSr*r*)r1rr)rr*r+ sz8TexinfoTranslator.collect_node_names..rN) rbrRrvtraverserr"r TextElementrTitularr)rNr"rqrr*)rrNr+r|s  z$TexinfoTranslator.collect_node_namesc Cs|j}|jg}||jtj|D]}d|vr|dsJddt|D}|||d<q|jtj}|r;|j n|j}t |tjtjfsJ|j}||jurl||d}||ddd7}||d<||d=d|d<|j D]\}}g||<|d |qodS)z1Collect the menu entries for each "node" section.rcSsg|]}|dqS)rr*)r1r,r*r*r+r,sz8TexinfoTranslator.collect_node_menus..rrN) ryrRr&rrr"r'rrqparentr$rvr%) rNrytargetsnodeentriesrqrrrr*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".)rCrCrCrrrN)rzryitemsr7len IndexError)rNrzryidrer<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{'})replacerNr,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)rrr:r6striprr*r*r+ris  zTexinfoTranslator.escape_argcCsNd}|D]}||d}qtd|r|dd}d|}||S)z=Return an escaped string suitable for node names and anchors.z,:()r5z[^ .].)rresearchr:r6rr)rNr, bad_charsbcr*r*r+rss   zTexinfoTranslator.escape_idcCr)z3Return an escaped string suitable for menu entries.:;r5)rrr:r6rrr*r*r+r~s  zTexinfoTranslator.escape_menucCs4|jr|jddddkr|jddSdSdS)z7Ensure the last line in body is terminated by new line.N rgr%rr*r*r+rszTexinfoTranslator.ensure_eolrrdesccsn||kr d|f}nd||f}tdt|ddfdfddtj|dd D}||dS) Nz* %s:: z * %s: %s. reNrc3s|] }d|VqdS)r5Nr*)r1loffsetr*r+r3sz6TexinfoTranslator.format_menu_entry..)width)maxrr:textwrapwrapr)rNrrrr,wdescr*rr+rs  z#TexinfoTranslator.format_menu_entryz \s+---?\s+rregc Cs|D]>}|j|}z||d}Wn ty|g}Ynwt|dkr)|\}}nd}||}||}|j||||qdS)NrrrC) rxr6 TypeErrorrrrrgr%r)rNrrrrpartsrr*r*r+add_menu_entriess       z"TexinfoTranslator.add_menu_entriescsj|}|s dSjd||dks#j|dr#jjr+jddSdtddffdd jd |D]}|q?jd dS) N @menu rrz @end menu rr#csNj|}|s dSjdj|||D]}|qdS)Nz %s )ryrgr%rrxr)rrsubentry_add_detailed_menurNr*r+rs   z6TexinfoTranslator.add_menu.._add_detailed_menuz0 @detailmenu --- The Detailed Node Listing --- z @end detailmenu @end menu )ryrgr%rrtexinfo_no_detailmenurb)rNrrrr*rr+rs"       zTexinfoTranslator.add_menu width_strcCsXtd|}|s |S|}|dd\}}|r|dkrdS|dkr*dt|d}|S)Nz(\d*\.?\d*)\s*(\S*)rpxrC%z%d.0ptgDI@)rmatchgroupsfloat)rNrrresamountunitr*r*r+tex_image_lengths  z"TexinfoTranslator.tex_image_lengthc sdtttttfdtdtffdd }jj}|rWjjj D]4}|j D].}d|j |j f}t |tr;||vr;q'||jj\}}|sIq'j |j|||fq'q"ttjjd}jjD]}|j|ryj tdd fdSqedS) Nr collapsedr#c sdg}|D]5\}}|D].}|dsq |d}d|d|df}|d}|||} || q q|dd|S) Nrrz%s:%srz @end menu rC)r get_short_idrrr%r:) rrretletterrrrsidrmerr*r+generates    z3TexinfoTranslator.collect_indices..generatez%s-%srIndexz @printindex ge )rr rbrboolrtexinfo_domain_indicesrKenvdomainsvaluesrvrr$listrdocnamesr% localnamerr get_domainrr) rNrindices_configdomainindexcls indexnamerrdocnamer*rr+r{s2*     z!TexinfoTranslator.collect_indicesrcshdtdttjffdd i}|D]}ttj|d}|}tdg|j Rdg||<q|S)Nnr#c3sPt|tjr |VdS|jD]}t|tjrqt|tjr%|EdHqdSr/)r$rfootnotechildrenr start_of_filer)rcfootnotes_underr*r+rs     z.footnotes_underrrCF) rrrrrlabelrrr r)rNrfnotesfnrnumr*rr+collect_footnotess  z#TexinfoTranslator.collect_footnotesrcCsFz|j|}W|Sty"tt|jdd}||j|<Y|Sw)z-Return a shorter 'id' associated with ``id``.rN)rwKeyErrorhexr)rNrrr*r*r+r s   zTexinfoTranslator.get_short_idcCsl|drdS|jdd|}||}||}||fD]}||jvr3|jd||j|qdS)Nzindex-rrz @anchor{%s}) startswithrrrrtrgr%r)rNrreidrr*r*r+ add_anchors      zTexinfoTranslator.add_anchorcCsJ||}||}|jd||f|j||j||dS)Nz @ref{%s,,%s})rrrgr%rurr)rNrrrrr*r*r+add_xref!s   zTexinfoTranslator.add_xrefcCsB|j|||j|ddd|vr|d|dSdS)NrrC:doc)rr%r!rrr&rNrr*r*r+visit_document*s z TexinfoTranslator.visit_documentcC|j|jdSr/)rrrr)r*r*r+depart_document0 z!TexinfoTranslator.depart_documentcCsB||}|jr|dd}|jr|dd}|j|dS)Nrr5-z@w{-})rrrrrrgr%)rNrr,r*r*r+ visit_Text4s   zTexinfoTranslator.visit_TextcCdSr/r*r)r*r*r+ depart_Text=zTexinfoTranslator.depart_TextcCs|j|dg|jsdS|jr||jdn|d|d}t|g|j|}|j d|t |jD]}| ||q;|j t tj||_|jd7_dS)Nidsrrrr)rrrrrrrrzrgr%sortedr&clearrrr"r)rNrrrrr*r*r+ visit_section@s  zTexinfoTranslator.visit_sectioncC|jd8_dSNr)rr)r*r*r+depart_sectionSz TexinfoTranslator.depart_section)z @unnumberedz@chapterz@sectionz @subsectionz@subsubsection)z@headingz @subheadingz@subsubheadingcCs|js d|_tj|j}t|tjrdSt|tjtjtjfr"tjt|tj s8t j t d|d| |dSz|j|j}WntyN|jd}Ynw|jd|dS)NTzJencountered title node not in section, topic, table, admonition or sidebarlocationr %s )rrSkipNoderr$table Admonitionsidebartopicr"loggerwarningr visit_rubricheadingsrrrgr%)rNrrheadingr*r*r+ visit_titleds&    zTexinfoTranslator.visit_titlecC|jddSN rr)r*r*r+ depart_titleyzTexinfoTranslator.depart_titlecCsvt|dkr|dtdfvrtjz|j|j}Wnty)|jd}Ynw|j d||j d7_ dS)Nr Footnotesrr=) rrrrr>rubricsrrrgr%r)rNrrubricr*r*r+rE|s  zTexinfoTranslator.visit_rubriccCs|jd8_|jddS)NrrK)rrgr%r)r*r*r+ depart_rubriczTexinfoTranslator.depart_rubriccCrI)Nz @noindent rr)r*r*r+visit_subtitlerMz TexinfoTranslator.visit_subtitlecCrIrJrr)r*r*r+depart_subtitlerMz!TexinfoTranslator.depart_subtitlec Cs|j|}z?z |j|d}Wnty%|jj|jj|j}Ynwt|tjrD|dr9|j|d|j |dWdSWn tt fyPYnwd|vrWdS|drd| |d||dD]}| ||qhdS)Nrrefidr3refuri) rrrr$rr"rrrrAttributeErrorr&)rNrparindexnextrr*r*r+ visit_targets.      zTexinfoTranslator.visit_targetcCr0r/r*r)r*r*r+ depart_targetr2zTexinfoTranslator.depart_targetcCst|jtjtjfr dSt|dtjrdS|d| }|dd}|s:|dr:d|j dd|d}|s>dS| d ro| |d d}| |}|rW||krb|j d |tj|j d ||ftj| dr|j dd |dd}||||tj| dr|d}|dkr|ddd}n |dddd }||||tj| dr|dddd}| |}d}d|vr|dd\}}||}||}||kr|j d||ftj|j d|||ftj| |}| |}|jj}|jrd}|r||kr)|j d|tj|dkr;|j d||ftj|dkrM|j d||ftj|j d||ftj)NrrrVrCrUrr#zmailto:z @email{%s}z @email{%s,%s}rrz::doczinfo:rr5rz @ref{%s,,,%s}z@ref{%s,,%s,%s}inlinez@indicateurl{%s}z @uref{%s,%s}noz @uref{%s,,%s}z%s@footnote{%s})r$rrrqr desc_typeimagerrrrr$rrgr%r'findrr6rrrtexinfo_show_urlsrr>)rNrrurir hashindex show_urlsr*r*r+visit_referencest    ,* &        z!TexinfoTranslator.visit_referencecCr0r/r*r)r*r*r+depart_referencer2z"TexinfoTranslator.depart_referencecCs"t|dd}||tj)Nrqr\)rrrr/r>rNrtextr*r*r+visit_number_references z(TexinfoTranslator.visit_number_referencecCs$|}|jd||tj)Nz @cite{%s})rrgr%rrr>rjr*r*r+visit_title_referencesz'TexinfoTranslator.visit_title_referencecCrINrrr)r*r*r+visit_paragraphrMz!TexinfoTranslator.visit_paragraphcCrIrnrr)r*r*r+depart_paragraphrMz"TexinfoTranslator.depart_paragraphcCrI)Nz @quotation rr)r*r*r+visit_block_quoterMz#TexinfoTranslator.visit_block_quotecC||jddS)Nz@end quotation rrgr%r)r*r*r+depart_block_quotez$TexinfoTranslator.depart_block_quotecCrI)Nz @example rr)r*r*r+visit_literal_blockrMz%TexinfoTranslator.visit_literal_blockcCrr)Nz @end example rsr)r*r*r+depart_literal_block ruz&TexinfoTranslator.depart_literal_blockcCs*t|jtjs |jd|jddS)NrKz @display )r$rr line_blockrgr%r)r*r*r+visit_line_blocks z"TexinfoTranslator.visit_line_blockcCs.|jdt|jtjs|jddSdS)Nz @end display rK)rgr%r$rrrxr)r*r*r+depart_line_blocks z#TexinfoTranslator.depart_line_blockcCs|jd7_dSr8rr)r*r*r+ visit_liner:zTexinfoTranslator.visit_linecC|jd|jd8_dS)Nz@w{ } r)rgr%rr)r*r*r+ depart_line zTexinfoTranslator.depart_linecCrI)Nz@strong{rr)r*r*r+ visit_strong%rMzTexinfoTranslator.visit_strongcCrINrrr)r*r*r+ depart_strong(rMzTexinfoTranslator.depart_strongcCrI)Nz@emph{rr)r*r*r+visit_emphasis+rMz TexinfoTranslator.visit_emphasiscCrIrrr)r*r*r+depart_emphasis.rMz!TexinfoTranslator.depart_emphasiscCrINz@code{rr)r*r*r+ visit_literal1rMzTexinfoTranslator.visit_literalcCrIrrr)r*r*r+depart_literal4rMz TexinfoTranslator.depart_literalcCrI)Nz@w{^rr)r*r*r+visit_superscript7rMz#TexinfoTranslator.visit_superscriptcCrIrrr)r*r*r+depart_superscript:rMz$TexinfoTranslator.depart_superscriptcCrINz@w{[rr)r*r*r+visit_subscript=rMz!TexinfoTranslator.visit_subscriptcCrINz]}rr)r*r*r+depart_subscript@rMz"TexinfoTranslator.depart_subscriptcCtjr/rr>r)r*r*r+visit_footnoteEz TexinfoTranslator.visit_footnotecCs|jd7_|jddS)Nrz @footnote{)rrgr%r)r*r*r+visit_collected_footnoteHrRz*TexinfoTranslator.visit_collected_footnotecCr})Nrr)rgr%rr)r*r*r+depart_collected_footnoteLrz+TexinfoTranslator.depart_collected_footnotec CsX|}z |jd|\}}Wnttfy#}ztj|d}~ww||tj)Nr) rrrr"rrr>rU SkipChildren)rNrr footnodeusedexcr*r*r+visit_footnote_referencePs  z*TexinfoTranslator.visit_footnote_referencecCs:|jd|dD]}|||q |jd7_dS)Nrr3r)rgr%rr&r)rNrrr*r*r+visit_citationZs z TexinfoTranslator.visit_citationcCr7r8r{r)r*r*r+depart_citation`r:z!TexinfoTranslator.depart_citationcCrIrrr)r*r*r+visit_citation_referencecrMz*TexinfoTranslator.visit_citation_referencecCrIrrr)r*r*r+depart_citation_referencefrMz+TexinfoTranslator.depart_citation_referencecCs |dd}|jd|dS)Nbullet*z @itemize %s rrgr%)rNrrr*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}|jd|dS) NenumtypearabicrCaA)r loweralpha upperalphastartz @enumerate %s r)rNrenumstartersrr*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 rr)r*r*r+visit_list_itemrMz!TexinfoTranslator.visit_list_itemcCr0r/r*r)r*r*r+depart_list_itemr2z"TexinfoTranslator.depart_list_itemcCrI)Nz @table @option rr)r*r*r+visit_option_listrMz#TexinfoTranslator.visit_option_listcCrrNz @end table rsr)r*r*r+depart_option_listruz$TexinfoTranslator.depart_option_listcCr0r/r*r)r*r*r+visit_option_list_itemr2z(TexinfoTranslator.visit_option_list_itemcCr0r/r*r)r*r*r+depart_option_list_itemr2z)TexinfoTranslator.depart_option_list_itemcC d|_dSNz@item at_item_xr)r*r*r+visit_option_group z$TexinfoTranslator.visit_option_groupcCr0r/r*r)r*r*r+depart_option_groupr2z%TexinfoTranslator.depart_option_groupcCs*|jd7_|jd|jd|_dS)Nrr=@itemx)rrgr%rr)r*r*r+ visit_options zTexinfoTranslator.visit_optioncCr7r8)rr)r*r*r+ depart_optionr:zTexinfoTranslator.depart_optioncCr0r/r*r)r*r*r+visit_option_stringr2z%TexinfoTranslator.visit_option_stringcCr0r/r*r)r*r*r+depart_option_stringr2z&TexinfoTranslator.depart_option_stringcCs|j|dddS)N delimiterr5)rgr%rr)r*r*r+visit_option_argumentsz'TexinfoTranslator.visit_option_argumentcCr0r/r*r)r*r*r+depart_option_argumentr2z(TexinfoTranslator.depart_option_argumentcCrIrnrr)r*r*r+visit_descriptionrMz#TexinfoTranslator.visit_descriptioncCr0r/r*r)r*r*r+depart_descriptionr2z$TexinfoTranslator.depart_descriptioncCrI)Nz @table @asis rr)r*r*r+visit_definition_listrMz'TexinfoTranslator.visit_definition_listcCrrrrsr)r*r*r+depart_definition_listruz(TexinfoTranslator.depart_definition_listcCrrrr)r*r*r+visit_definition_list_itemrz,TexinfoTranslator.visit_definition_list_itemcCr0r/r*r)r*r*r+depart_definition_list_itemr2z-TexinfoTranslator.depart_definition_list_itemcCsp|dD]}|||q|ddD]}t|tjtjfr)||||q|j d|j d|_ dS)Nr3r=r) rr&r$rrrtargetrUremovergr%r)rNrrrr*r*r+ visit_terms   zTexinfoTranslator.visit_termcCr0r/r*r)r*r*r+ depart_termr2zTexinfoTranslator.depart_termcCrI)Nz : rr)r*r*r+visit_classifierrMz"TexinfoTranslator.visit_classifiercCr0r/r*r)r*r*r+depart_classifierr2z#TexinfoTranslator.depart_classifiercCrIrnrr)r*r*r+visit_definitionrMz"TexinfoTranslator.visit_definitioncCr0r/r*r)r*r*r+depart_definitionr2z#TexinfoTranslator.depart_definitioncCrr entry_sepr)r*r*r+ visit_tablerzTexinfoTranslator.visit_tablecCrI)Nz @end multitable rr)r*r*r+ depart_tablerMzTexinfoTranslator.depart_tablecCr0r/r*r)r*r*r+visit_tabular_col_specr2z(TexinfoTranslator.visit_tabular_col_speccCr0r/r*r)r*r*r+depart_tabular_col_specr2z)TexinfoTranslator.depart_tabular_col_speccCs`|j|dt|j|jkrdS|jdt|jD]\}}|jdd|dqdS)Ncolwidthz @multitable z{%s} r2r)rr%rn_colsrgr7)rNrr<rr*r*r+ visit_colspecs zTexinfoTranslator.visit_colspeccCr0r/r*r)r*r*r+depart_colspecr2z TexinfoTranslator.depart_colspeccCsg|_|d|_dS)Ncols)rrr)r*r*r+ visit_tgroupszTexinfoTranslator.visit_tgroupcCr0r/r*r)r*r*r+ depart_tgroupr2zTexinfoTranslator.depart_tgroupcCr)Nz @headitemrr)r*r*r+ visit_theadrzTexinfoTranslator.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_rowcCrrrr)r*r*r+ depart_row rzTexinfoTranslator.depart_rowcCs|jd|jd|_dS)Nz %s z@tab)rgr%rr)r*r*r+ visit_entrys zTexinfoTranslator.visit_entrycCs&t|ddD]}|jdqdS)Nmorecolsrz @tab )rangerrgr%)rNrr<r*r*r+ depart_entryszTexinfoTranslator.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_listcCrIrnrr)r*r*r+ visit_field rMzTexinfoTranslator.visit_fieldcCrIrnrr)r*r*r+ depart_field#rMzTexinfoTranslator.depart_fieldcCrr)Nz@*rsr)r*r*r+visit_field_name&ruz"TexinfoTranslator.visit_field_namecCrI)Nz: rr)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}||}|jd|dS)Nr @cartouche @quotation %s )rrrqrrrgr%)rNrrrqr*r*r+visit_admonition5sz"TexinfoTranslator.visit_admonitioncCst|j}|jd|dS)Nr)rtagnamergr%)rNrrr*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_admonitioncCrr/rr)r*r*r+ visit_docinfoYrzTexinfoTranslator.visit_docinfocCrr/rr)r*r*r+visit_generated\rz!TexinfoTranslator.visit_generatedcCrr/rr)r*r*r+ visit_header_rzTexinfoTranslator.visit_headercCrr/rr)r*r*r+ visit_footerbrzTexinfoTranslator.visit_footercC|dr |jddSdS)N literal_blockz @float LiteralBlock rr)r*r*r+visit_containere z!TexinfoTranslator.visit_containercCr)Nr @end float rr)r*r*r+depart_containerirz"TexinfoTranslator.depart_containercCr0r/r*r)r*r*r+visit_decorationmr2z"TexinfoTranslator.visit_decorationcCr0r/r*r)r*r*r+depart_decorationpr2z#TexinfoTranslator.depart_decorationcCsXd|dgvr tjttj|d}|||jd|| | |dS)Ncontentsclassesrz%s ) rrr>rrqrErgr%rrrQ)rNrrqr*r*r+ visit_topicss  zTexinfoTranslator.visit_topiccCr0r/r*r)r*r*r+ depart_topic|r2zTexinfoTranslator.depart_topiccCs|jdddS)Nz %s B__________________________________________________________________rr)r*r*r+visit_transitionsz"TexinfoTranslator.visit_transitioncCr0r/r*r)r*r*r+depart_transitionr2z#TexinfoTranslator.depart_transitioncCrI)Nz @center --- rr)r*r*r+visit_attributionrMz#TexinfoTranslator.visit_attributioncCrIrJrr)r*r*r+depart_attributionrMz$TexinfoTranslator.depart_attributioncCs6|dd}d|vsd|vr|j|tj)NformatrCr@rA)rr6rgr%rrr>)rNrr r*r*r+ visit_rawszTexinfoTranslator.visit_rawcCrI)Nz @float Figure rr)r*r*r+ visit_figurerMzTexinfoTranslator.visit_figurecCrI)Nrrr)r*r*r+ depart_figurerMzTexinfoTranslator.depart_figurecCsNt|jtjst|jtjr|jdr|jddStj t d|ddS)Nrz @caption{zcaption not inside a figure.r;) r$rrfigure containerrrgr%rCrDrr)r*r*r+ visit_captions    zTexinfoTranslator.visit_captioncCs@t|jtjst|jtjr|jdr|jddSdSdS)Nrz} )r$rrrrrrgr%r)r*r*r+depart_captions  z TexinfoTranslator.depart_captionc Cs|d|jjvr|jj|d}n |jrdS|d}|ddkr#dSt|\}}||dd}||dd}||dd}d|j d dd |f}|j d |||||d dfdS) Nrez://rrrCheightaltz %s-figures/%srlz @image{%s,%s,%s,%s,%s} r) rKimagesignore_missing_imagesrcrsplitextrrrrrgr%) rNrrerextrrrrlr*r*r+ visit_images zTexinfoTranslator.visit_imagecCr0r/r*r)r*r*r+ depart_imager2zTexinfoTranslator.depart_imagecCr0r/r*r)r*r*r+visit_compoundr2z TexinfoTranslator.visit_compoundcCr0r/r*r)r*r*r+depart_compoundr2z!TexinfoTranslator.depart_compoundcC||dSr/)rr)r*r*r+ visit_sidebarzTexinfoTranslator.visit_sidebarcCrr/)rr)r*r*r+depart_sidebarrz TexinfoTranslator.depart_sidebarcCrI)Nz@w{(rr)r*r*r+ visit_labelrMzTexinfoTranslator.visit_labelcCrI)Nz)} rr)r*r*r+ depart_labelrMzTexinfoTranslator.depart_labelcCr0r/r*r)r*r*r+ visit_legendr2zTexinfoTranslator.visit_legendcCr0r/r*r)r*r*r+ depart_legendr2zTexinfoTranslator.depart_legendcCr0r/r*r)r*r*r+visit_substitution_referencer2z.TexinfoTranslator.visit_substitution_referencecCr0r/r*r)r*r*r+depart_substitution_referencer2z/TexinfoTranslator.depart_substitution_referencecCrr/rr)r*r*r+visit_substitution_definitionrz/TexinfoTranslator.visit_substitution_definitioncCs|jd|tj)Nz. @verbatim @end verbatim )rgr%rrr>r)r*r*r+visit_system_messagesz&TexinfoTranslator.visit_system_messagecCs4|jd|D] }|jd|q tj)Nrz@c %s )rgr%r splitlinesrr>)rNrliner*r*r+ visit_comments zTexinfoTranslator.visit_commentcCrI)Nz>>rr)r*r*r+visit_problematicrMz#TexinfoTranslator.visit_problematiccCrI)Nz<.r3z ::=z%s r5r)rvrrr productionr%rrr&ljustrgrrrwrr>)rNrnamesproductionlistr5maxlenrr,r*r*r+visit_productionlists   z&TexinfoTranslator.visit_productionlistcCr0r/r*r)r*r*r+visit_productionr2z"TexinfoTranslator.visit_productioncCr0r/r*r)r*r*r+depart_productionr2z#TexinfoTranslator.depart_productioncCrIrrr)r*r*r+visit_literal_emphasisrMz(TexinfoTranslator.visit_literal_emphasiscCrIrrr)r*r*r+depart_literal_emphasisrMz)TexinfoTranslator.depart_literal_emphasiscCrIrrr)r*r*r+visit_literal_strongrMz&TexinfoTranslator.visit_literal_strongcCrIrrr)r*r*r+depart_literal_strongrMz'TexinfoTranslator.depart_literal_strongcCs^t|jtjr |n|jd|dD]}|\}}}}}||}|jd|qdS)Nrrz @geindex %s )r$rr paragraphrrgr%r)rNrrtyprktidtext2key_r*r*r+ visit_index"s    zTexinfoTranslator.visit_indexcCrIrnrr)r*r*r+visit_versionmodified-rMz'TexinfoTranslator.visit_versionmodifiedcCrIrnrr)r*r*r+depart_versionmodified0rMz(TexinfoTranslator.depart_versionmodifiedcCs2|jd|j|d|j||dS)Nr(r)rrrr%rr!r)r*r*r+visit_start_of_file3s z%TexinfoTranslator.visit_start_of_filecCr+r/)rrrr)r*r*r+depart_start_of_file9r-z&TexinfoTranslator.depart_start_of_filecCs$||}|jd|tj)Nz @center %s )rrrgr%rr>rNrtxtr*r*r+visit_centered=sz TexinfoTranslator.visit_centeredcCs|jdtddS)Nz @subsubheading %s seealso)rgr%rr)r*r*r+ visit_seealsoBs zTexinfoTranslator.visit_seealsocCrIrnrr)r*r*r+depart_seealsoFrMz TexinfoTranslator.depart_seealsocCrr/rr)r*r*r+ visit_metaIrzTexinfoTranslator.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|}|jd|jddd|Dd|jdtj)NrrK, csr.r/)r)r1rr*r*r+r3Vr4z/TexinfoTranslator.visit_acks..r) rr bullet_listr list_itemrgr%r:r>)rNrrU list_itemsr*r*r+ visit_acksRs    zTexinfoTranslator.visit_ackscCs|j|d|_dS)Nz@deffn)rr% at_deffnxr)r*r*r+ visit_desca  zTexinfoTranslator.visit_desccCs"|j||jddS)Nz @end deffn )rrrrgr%r)r*r*r+ depart_desces zTexinfoTranslator.depart_descc Cs|jd7_|jd}|dkr|dD]}|||qz|jj|jd}||j||j j |j k}Wn t t fyE|}Ynw|t|}|jd|j|fd|_||_dS)Nrobjtypedescriber3rz %s {%s} z@deffnx)rrrr&rKr r get_type_name object_typesrprimary_domainrr"rrr>rgr%rYdesc_type_name)rNrr]rrrcategoryr*r*r+visit_desc_signaturejs"    z&TexinfoTranslator.visit_desc_signaturecCs$|jd|jd8_d|_dS)Nrr)rgr%rrbr)r*r*r+depart_desc_signature}s  z'TexinfoTranslator.depart_desc_signaturecCr0r/r*r)r*r*r+visit_desc_signature_liner2z+TexinfoTranslator.visit_desc_signature_linecCr0r/r*r)r*r*r+depart_desc_signature_liner2z,TexinfoTranslator.depart_desc_signature_linecCr0r/r*r)r*r*r+visit_desc_contentr2z$TexinfoTranslator.visit_desc_contentcCr0r/r*r)r*r*r+depart_desc_contentr2z%TexinfoTranslator.depart_desc_contentcCr0r/r*r)r*r*r+visit_desc_inliner2z#TexinfoTranslator.visit_desc_inlinecCr0r/r*r)r*r*r+depart_desc_inliner2z$TexinfoTranslator.depart_desc_inlinecCr0r/r*r)r*r*r+visit_desc_namer2z!TexinfoTranslator.visit_desc_namecCr0r/r*r)r*r*r+depart_desc_namer2z"TexinfoTranslator.depart_desc_namecCr0r/r*r)r*r*r+visit_desc_addnamer2z$TexinfoTranslator.visit_desc_addnamecCr0r/r*r)r*r*r+depart_desc_addnamer2z%TexinfoTranslator.depart_desc_addnamecCr0r/r*r)r*r*r+visit_desc_typer2z!TexinfoTranslator.visit_desc_typecCr0r/r*r)r*r*r+depart_desc_typer2z"TexinfoTranslator.depart_desc_typecCrI)Nz -> rr)r*r*r+visit_desc_returnsrMz$TexinfoTranslator.visit_desc_returnscCr0r/r*r)r*r*r+depart_desc_returnsr2z%TexinfoTranslator.depart_desc_returnscCs|jdd|_dS)Nz (r)rgr% first_paramr)r*r*r+visit_desc_parameterlistr[z*TexinfoTranslator.visit_desc_parameterlistcCrI)N)rr)r*r*r+depart_desc_parameterlistrMz+TexinfoTranslator.depart_desc_parameterlistcCsF|js |jdnd|_||}|dd}|j|tj)NrTr z@w{ })rtrgr%rrrrr>rjr*r*r+visit_desc_parameters  z&TexinfoTranslator.visit_desc_parametercCrI)N[rr)r*r*r+visit_desc_optionalrMz%TexinfoTranslator.visit_desc_optionalcCrI)N]rr)r*r*r+depart_desc_optionalrMz&TexinfoTranslator.depart_desc_optionalcCsF|}|jr||jddks|jr||jvr!tjdSdS)Nrr])rrrrbr6rr>rKr*r*r+visit_desc_annotations z'TexinfoTranslator.visit_desc_annotationcCr0r/r*r)r*r*r+depart_desc_annotationr2z(TexinfoTranslator.depart_desc_annotationcCr0r/r*r)r*r*r+ visit_inliner2zTexinfoTranslator.visit_inlinecCr0r/r*r)r*r*r+ depart_inliner2zTexinfoTranslator.depart_inlinecCsb|}|jd|dr)||jvr)|jd||d|j|dS|jddS)Nz@abbr{ explanationz,%s}r)rrgr%hasattrrrrr)rNrabbrr*r*r+visit_abbreviations  z$TexinfoTranslator.visit_abbreviationcCs|j|jdSr/)rgr%rrr)r*r*r+depart_abbreviationsz%TexinfoTranslator.depart_abbreviationcC ||Sr/)r=r)r*r*r+ visit_manpagerzTexinfoTranslator.visit_manpagecCrr/)r>r)r*r*r+depart_manpagerz TexinfoTranslator.depart_manpagecCr0r/r*r)r*r*r+visit_download_referencer2z*TexinfoTranslator.visit_download_referencecCr0r/r*r)r*r*r+depart_download_referencer2z+TexinfoTranslator.depart_download_referencecCrr/)rr)r*r*r+ visit_hlistrzTexinfoTranslator.visit_hlistcCrr/)rr)r*r*r+ depart_hlistrzTexinfoTranslator.depart_hlistcCr0r/r*r)r*r*r+visit_hlistcolr2z TexinfoTranslator.visit_hlistcolcCr0r/r*r)r*r*r+depart_hlistcolr2z!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$|jd||dtj)Nz@math{r)rgr%rrrr>r)r*r*r+ visit_mathszTexinfoTranslator.visit_mathcCs:|dr ||d||jd||tj)Nrz @example %s @end example )rr&rgr%rrrr>r)r*r*r+visit_math_block s  z"TexinfoTranslator.visit_math_blockcCs$tdtt|jr|jdSdS)Nz!TexinfoWriter.desc is deprecated.r)warningswarnrrrrr*r*r+rs   zTexinfoTranslator.descr\)rC(r]r^r_rKrcrrrrRrMrVrrr|r}r~rbrrrrrrrcompilerr rrrr{rrr r rr!rrr&r'r*r,rr/r1r6r9rFrOrHrLrErQrSrTrZr[rhrirlrmrorprqrtrvrwvisit_doctest_blockdepart_doctest_blockryrzr|r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrvisit_attentiondepart_attention visit_cautiondepart_caution visit_danger depart_danger visit_error depart_error visit_hint depart_hintvisit_importantdepart_important visit_note depart_note visit_tip depart_tip visit_warningdepart_warningrrrrrrrrrrrrrr r r r rrrrrrrr r!r"r#r$r%r&r'r(r+r,r-r0r2r3r:r;r<r=r>r?r@rFrGrHrIrJrMrOrPrQrRrSrXrrrZr\rdrerfrgrhrirjrkrlrmrnrorprqrrrsrurwryr{r}r~rrrrrrrrrrrrrrrrrpropertyr rdr*r*rOr+rSs  !  *  !      &'     ?         &rSr/)?r`rrrosrtypingrrrrrrr r r r r rdocutilsrrdocutils.nodesrrrsphinxrrsphinx.deprecationrsphinx.domainsrsphinx.domains.indexr sphinx.errorsr sphinx.localerrr sphinx.utilrsphinx.util.docutilsrsphinx.util.i18nrsphinx.writers.latexr sphinx.builders.texinfor! getLoggerr]rCrrr"r'rbr>Writerr?rSr*r*r*r+s>  8           -