403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/sphinx/builders/latex/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/builders/latex/__pycache__/transforms.cpython-39.pyc
a

�ab�P�@s�dZddlmZmZmZmZmZmZddlm	Z	ddl
mZmZddl
mZddlmZddlmZddlmZmZmZmZmZdd	lmZdd
lmZddlmZddlm Z d
Z!Gdd�de�Z"Gdd�de�Z#Gdd�de�Z$Gdd�de	j%�Z&Gdd�de�Z'Gdd�de	j%�Z(Gdd�de�Z)Gdd�de�Z*Gdd�de�Z+Gd d!�d!e�Z,Gd"d#�d#e�Z-Gd$d%�d%e�Z.eee/efd&�d'd(�Z0d)S)*z�
    sphinx.builders.latex.transforms
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Transforms for LaTeX builder.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�Any�Dict�List�Set�Tuple�cast)�nodes)�Element�Node)�
Substitutions)�addnodes)�Sphinx)�captioned_literal_block�footnotemark�footnotetext�math_reference�thebibliography)�CitationDomain)�SphinxTransform)�SphinxPostTransform)�NodeMatcher)�mailto:zhttp:zhttps:zftp:c@s0eZdZdZdZejejfZe	dd�dd�Z
dS)�FootnoteDocnameUpdaterz5Add docname to footnote and footnote_reference nodes.i�N��kwargs�returncKs,t|j�}|j�|�D]}|jj|d<qdS)N�docname)r�TARGET_NODES�document�findall�envr)�selfr�matcher�node�r$�D/usr/lib/python3.9/site-packages/sphinx/builders/latex/transforms.py�apply"s
zFootnoteDocnameUpdater.apply)�__name__�
__module__�__qualname__�__doc__�default_priorityr�footnote�footnote_referencerrr&r$r$r$r%rsrc@s.eZdZdZejdZdZedd�dd�ZdS)�SubstitutionDefinitionsRemoverz4Remove ``substitution_definition node from doctrees.��ZlatexNrcKs(t|j�tj��D]}|j�|�qdS�N)�listrrrZsubstitution_definition�parent�remove)r!rr#r$r$r%�run/sz"SubstitutionDefinitionsRemover.run)	r'r(r)r*rr+�formatsrr5r$r$r$r%r.(s
r.c@sveZdZdZdZdZdZedd�dd�Zdd	�d
d�Z	e
ed�d
d�Zeee
ejejfd�dd�Zdd	�dd�ZdS)�ShowUrlsTransformz�Expand references to inline text or footnotes.

    For more information, see :confval:`latex_show_urls`.

    .. note:: This transform is used for integrated doctree
    �r0FNrcKsBz4|jj}|j}d|_|��|jr,|��W||_n||_0dS)N�	show_urls)r�settings�	id_prefix�expand_show_urls�expanded�renumber_footnotes)r!rr:r;r$r$r%r5As
zShowUrlsTransform.run)rc	Cs�|jj}|dus|dkrdSt|j�tj��D]�}|�dd�}|�t	�r.|�d�r^|dd�}|�
�|kr.|j�|�}|�
|�}|dkr�|�||�\}}|j�|d|�|j�|d	|�d
|_q.t�d|�}|j�|d|�q.dS)NF�no�refuri�r�r,r/�Tz (%s))ZconfigZlatex_show_urlsr2rrr�	reference�get�
startswith�URI_SCHEMES�astextr3�index�get_docname_for_node�create_footnote�insertr=�Text)	r!r9r#�urirIr�fnZfnrefZtextnoder$r$r%r<Os$


z"ShowUrlsTransform.expand_show_urls�r#rcCs@|r<t|tj�r |j�|d�St|tj�r4|dS|j}qdS)N�sourcer)�
isinstancerrr Zpath2docr�
start_of_filer3�r!r#r$r$r%rJfsz&ShowUrlsTransform.get_docname_for_node)rNrrcCs�tjdt�|�|dd�}tj|d|d�}|d�d�|t�dd�7}|t�dd|�7}|j�|�tj	dd|d	d
|d�}|t�d�7}|j�
|�|�|d	d
�||fS)NrAT)r@Z	nolinkurlr/)�autor�names�#z[#]_�idsr)rU�refidr)rrDrMr,�append�labelZ	paragraphrZnote_autofootnoter-Znote_autofootnote_refZadd_backref)r!rNrrDr,Zfootnote_refr$r$r%rKqs�z!ShowUrlsTransform.create_footnotecCs�t|j�}|j�|�d}|jD]�}|d7}t|�|jvr$q>q$ttj|d�}|�	t�dt|���||dvr�|d�
|���|d�t|��|d}|j
D]D}||dkr�|dd|dkr�|�
|d�|t�t|��7}q�q dS)Nrr/rArVrrXrY)�FootnoteCollectorr�	walkabout�auto_footnotes�str�used_footnote_numbersrrr[�replace_selfr4rHrZ�
footnote_refsrM)r!Z	collectorZnumr,Z	old_labelr�refr$r$r%r>�s"


 z$ShowUrlsTransform.renumber_footnotes)r'r(r)r*r+r6r=rr5r<r
r_rJrrr,r-rKr>r$r$r$r%r74sr7csneZdZdZejdd��fdd�Zedd�dd�Zedd�d	d
�Z	ej
dd�dd�Zejdd�d
d�Z
�ZS)r\z9Collect footnotes and footnote references on the documentN)rrcs$g|_t�|_g|_t��|�dSr1)r^�setr`rb�super�__init__)r!r��	__class__r$r%rf�szFootnoteCollector.__init__rPcCsdSr1r$rTr$r$r%�
unknown_visit�szFootnoteCollector.unknown_visitcCsdSr1r$rTr$r$r%�unknown_departure�sz#FootnoteCollector.unknown_departurecCs6|�d�r|j�|�n|dD]}|j�|�q dS)NrUrV)rEr^rZr`�add)r!r#�namer$r$r%�visit_footnote�s
z FootnoteCollector.visit_footnotecCs|j�|�dSr1)rbrZrTr$r$r%�visit_footnote_reference�sz*FootnoteCollector.visit_footnote_reference)r'r(r)r*rrrfr
rirjr,rmr-rn�
__classcell__r$r$rgr%r\�sr\c@s(eZdZdZdZdZedd�dd�ZdS)�LaTeXFootnoteTransformaTConvert footnote definitions and references to appropriate form to LaTeX.

    * Replace footnotes on restricted zone (e.g. headings) by footnotemark node.
      In addition, append a footnotetext node after the zone.

      Before::

          <section>
              <title>
                  headings having footnotes
                  <footnote_reference>
                      1
              <footnote ids="id1">
                  <label>
                      1
                  <paragraph>
                      footnote body

      After::

          <section>
              <title>
                  headings having footnotes
                  <footnotemark refid="id1">
                      1
              <footnotetext ids="id1">
                  <label>
                      1
                  <paragraph>
                      footnote body

    * Integrate footnote definitions and footnote references to single footnote node

      Before::

          blah blah blah
          <footnote_reference refid="id1">
              1
          blah blah blah ...

          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  footnote body

      After::

          blah blah blah
          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  footnote body
          blah blah blah ...

    * Replace second and subsequent footnote references which refers same footnote definition
      by footnotemark node.

      Before::

          blah blah blah
          <footnote_reference refid="id1">
              1
          blah blah blah
          <footnote_reference refid="id1">
              1
          blah blah blah ...

          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  footnote body

      After::

          blah blah blah
          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  footnote body
          blah blah blah
          <footnotemark refid="id1">
              1
          blah blah blah ...

    * Remove unreferenced footnotes

      Before::

          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  Unreferenced footnote!

      After::

          <!-- nothing! -->

    * Move footnotes in a title of table or thead to head of tbody

      Before::

          <table>
              <title>
                  title having footnote_reference
                  <footnote_reference refid="id1">
                      1
              <tgroup>
                  <thead>
                      <row>
                          <entry>
                              header having footnote_reference
                              <footnote_reference refid="id2">
                                  2
                  <tbody>
                      <row>
                      ...

          <footnote ids="id1">
              <label>
                  1
              <paragraph>
                  footnote body

          <footnote ids="id2">
              <label>
                  2
              <paragraph>
                  footnote body

      After::

          <table>
              <title>
                  title having footnote_reference
                  <footnotemark refid="id1">
                      1
              <tgroup>
                  <thead>
                      <row>
                          <entry>
                              header having footnote_reference
                              <footnotemark refid="id2">
                                  2
                  <tbody>
                      <footnotetext ids="id1">
                          <label>
                              1
                          <paragraph>
                              footnote body

                      <footnotetext ids="id2">
                          <label>
                              2
                          <paragraph>
                              footnote body
                      <row>
                      ...
    iXr0NrcKsDt|j�tj��}|D]}|j�|�qt|j|�}|j�|�dSr1)	r2rrrr,r3r4�LaTeXFootnoteVisitorr])r!r�	footnotesr#Zvisitorr$r$r%r5^s
zLaTeXFootnoteTransform.run�r'r(r)r*r+r6rr5r$r$r$r%rp�s
%rpcs~eZdZejeejdd��fdd�Zedd�dd�Z	edd�dd	�Z
edd�d
d�Zedd�dd
�Z
ejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�dd�Zejdd�d d!�Zejdd�d"d#�Zejdd�d$d%�Zejdd�d&d'�Z ej!dd�d(d)�Z"ej!ejd�d*d+�Z#�Z$S),rqN)rrrrcs0t�|_||_g|_g|_d|_t��|�dSr1)rd�appearedrr�pendings�table_footnotes�
restrictedrerf)r!rrrrgr$r%rfhszLaTeXFootnoteVisitor.__init__rPcCsdSr1r$rTr$r$r%ripsz"LaTeXFootnoteVisitor.unknown_visitcCsdSr1r$rTr$r$r%rjssz&LaTeXFootnoteVisitor.unknown_departurecCs|jdur||_dSr1)rwrTr$r$r%�restrictvs
zLaTeXFootnoteVisitor.restrictcCsl|j|krhd|_|j�|�}t|j�D]:\}}tdg|j�Rd|di�}|j�||d|�q&g|_dS)NrArXr/)rwr3rI�	enumeraterur�childrenrL)r!r#�pos�ir,�fntextr$r$r%�
unrestrictzs
zLaTeXFootnoteVisitor.unrestrictcCs|�|�dSr1�rxrTr$r$r%�visit_figure�sz!LaTeXFootnoteVisitor.visit_figurecCs|�|�dSr1�r~rTr$r$r%�
depart_figure�sz"LaTeXFootnoteVisitor.depart_figurecCs|�|�dSr1rrTr$r$r%�
visit_term�szLaTeXFootnoteVisitor.visit_termcCs|�|�dSr1r�rTr$r$r%�depart_term�sz LaTeXFootnoteVisitor.depart_termcCs|�|�dSr1rrTr$r$r%�
visit_caption�sz"LaTeXFootnoteVisitor.visit_captioncCs|�|�dSr1r�rTr$r$r%�depart_caption�sz#LaTeXFootnoteVisitor.depart_captioncCs"t|jtjtjf�r|�|�dSr1)rRr3r�section�tablerxrTr$r$r%�visit_title�sz LaTeXFootnoteVisitor.visit_titlecCsLt|jtj�r|�|�n.t|jtj�rH|j|j7_g|_|�|�dSr1)rRr3rr�r~r�rvrurTr$r$r%�depart_title�sz!LaTeXFootnoteVisitor.depart_titlecCs|�|�dSr1rrTr$r$r%�visit_thead�sz LaTeXFootnoteVisitor.visit_theadcCs$|j|j7_g|_|�|�dSr1)rvrur~rTr$r$r%�depart_thead�sz!LaTeXFootnoteVisitor.depart_theadcCsRt|�tj��}t|j�D],}tdg|j�Rd|di�}|�d|�qg|_dS)NrArXr)	�nextrr�tbody�reversedrvrrzrL)r!r#r�r,r}r$r$r%�depart_table�s
z!LaTeXFootnoteVisitor.depart_tablecCs|�|�dSr1rrTr$r$r%rm�sz#LaTeXFootnoteVisitor.visit_footnotecCs|�|�dSr1r�rTr$r$r%�depart_footnote�sz$LaTeXFootnoteVisitor.depart_footnotecCs�|����}|d}|jr\td||dd�}|�|�||f|jvr�|�|�}|j�|�nV||f|jvr�td||dd�}|�|�n*|�|�}|j	�
|�|�|�|�|�|j�||f�t
j�dS)NrrArY)rY)rH�striprwrrart�get_footnote_by_referencerurZrrr4r]rkrZSkipNode)r!r#ZnumberrZmarkr,r$r$r%rn�s"




z-LaTeXFootnoteVisitor.visit_footnote_referencecCs@|d}|jD],}||dkr|dd|dkr|SqdS)NrrXrrY)rr)r!r#rr,r$r$r%r��s

 
z.LaTeXFootnoteVisitor.get_footnote_by_reference)%r'r(r)rrrr,rfr
rirjr	rxr~Zfigurer�r�Ztermr�r�Zcaptionr�r��titler�r�Ztheadr�r�r�r�rmr�r-rnr�ror$r$rgr%rqgs(	rqc@s(eZdZdZdZdZedd�dd�ZdS)�BibliographyTransformaNGather bibliography entries to tail of document.

    Before::

        <document>
            <paragraph>
                blah blah blah
            <citation>
                ...
            <paragraph>
                blah blah blah
            <citation>
                ...
            ...

    After::

        <document>
            <paragraph>
                blah blah blah
            <paragraph>
                blah blah blah
            ...
            <thebibliography>
                <citation>
                    ...
                <citation>
                    ...
    i�r0NrcKsPt�}t|j�tj��D]}|j�|�||7}qt|�dkrL|j|7_dS)Nr)	rr2rrr�citationr3r4�len)r!r�	citationsr#r$r$r%r5�s
zBibliographyTransform.runrsr$r$r$r%r��sr�c@s(eZdZdZdZdZedd�dd�ZdS)�CitationReferenceTransformz�Replace pending_xref nodes for citation by citation_reference.

    To handle citation reference easily on LaTeX writer, this converts
    pending_xref nodes to citation_reference.
    �r0Nrc	Ks|tt|j�d��}ttjddd�}|j�|�D]H}|j	�
|dd�\}}}|r.tjddg|j
�R||d��}|�|�q.dS)Nr�rc)�	refdomain�reftype�	reftarget)rArArrA)rZrefname)rrr �
get_domainrr�pending_xrefrrr�rErZcitation_referencerzra)	r!r�domainr"r#rZlabelid�_Zcitation_refr$r$r%r5	s�zCitationReferenceTransform.runrsr$r$r$r%r�sr�c@s(eZdZdZdZdZedd�dd�ZdS)�MathReferenceTransformz�Replace pending_xref nodes for math by math_reference.

    To handle math reference easily on LaTeX writer, this converts pending_xref
    nodes to math_reference.
    r�r0NrcKsv|j�d�jd}|j�tj�D]P}|ddkr |ddvr |�|dd�\}}|r td||dd	�}|�	|�q dS)
NZmathZobjectsr�r�)�eqZnumrefr�)NNrA)r�target)
r r��datarrrr�rErra)r!rZ	equationsr#rr�Zrefnoder$r$r%r5szMathReferenceTransform.runrsr$r$r$r%r�sr�c@s(eZdZdZdZdZedd�dd�ZdS)�LiteralBlockTransformzEReplace container nodes for literal_block by captioned_literal_block.r8r0NrcKsHttjdd�}|j�|�D](}tdg|j�Ri|j��}|�|�qdS)NT)Z
literal_blockrA)	rr�	containerrrrrzZ
attributesra)r!rr"r#Znewnoder$r$r%r5,szLiteralBlockTransform.runrsr$r$r$r%r�'sr�c@s(eZdZdZdZdZedd�dd�ZdS)�DocumentTargetTransformz5Add :doc label to the first section of each document.r8r0NrcKs6|j�tj�D]"}|�tj�}|r|d�d�qdS)NrXz:doc)rrrrSZ	next_noderr�rZ)r!rr#r�r$r$r%r58szDocumentTargetTransform.runrsr$r$r$r%r�3sr�c@s(eZdZdZdZdZedd�dd�ZdS)�IndexInSectionTitleTransforma�Move index nodes in section title to outside of the title.

    LaTeX index macro is not compatible with some handling of section titles
    such as uppercasing done on LaTeX side (cf. fncychap handling of ``\chapter``).
    Moving the index node to after the title node fixes that.

    Before::

        <section>
            <title>
                blah blah <index entries=[...]/>blah
            <paragraph>
                blah blah blah
            ...

    After::

        <section>
            <title>
                blah blah blah
            <index entries=[...]/>
            <paragraph>
                blah blah blah
            ...
    r8r0NrcKs`t|j�tj��D]H}t|jtj�rt|�t	j
��D]$\}}|�|�|j�|d|�q4qdS)Nr/)
r2rrrr�rRr3r�ryrrIr4rL)r!rr#r|rIr$r$r%r5\s

z IndexInSectionTitleTransform.runrsr$r$r$r%r�?sr�)�apprcCsp|�t�|�t�|�t�|�t�|�t�|�t�|�t�|�t	�|�t
�|�t�dddd�S)NZbuiltinT)�versionZparallel_read_safeZparallel_write_safe)Z
add_transformrZadd_post_transformr.r�r�r�r�rpr�r�r7)r�r$r$r%�setupes









�r�N)1r*�typingrrrrrrZdocutilsrZdocutils.nodesr	r
Zdocutils.transforms.referencesrZsphinxrZsphinx.applicationr
Zsphinx.builders.latex.nodesrrrrrZsphinx.domains.citationrZsphinx.transformsrZ!sphinx.transforms.post_transformsrZsphinx.util.nodesrrGrr.r7ZNodeVisitorr\rprqr�r�r�r�r�r�r_r�r$r$r$r%�<module>s4
 h2n+&

Youez - 2016 - github.com/yon3zu
LinuXploit