B
    d\                 @   sD  d Z ddlZddlZddlZddlZddlmZmZ ddlm	Z	m
Z
mZmZmZmZmZmZmZmZmZ ddlmZmZ ddlmZmZ ddlmZ ddlmZ dd	lmZm Z  dd
l!m"Z" e	rddl#m$Z$ G dd dZ%G dd dZ&G dd dej'Z'dZ(dZ)e(fe*e+e
ee* dddZ,G dd dej-Z.G dd de"Z/dS )z&Custom docutils writer for plain text.    N)chaingroupby)TYPE_CHECKINGAnyDict	GeneratorIterableListOptionalSetTupleUnioncast)nodeswriters)ElementText)column_width)addnodes)_admonitionlabels)SphinxTranslator)TextBuilderc               @   sR   e Zd ZdZdeeeddddZedd	d
ZedddZeddddZ	dS )CellzVRepresents a cell in a table.
    It can span multiple columns or multiple lines.
        N)textrowspancolspanreturnc             C   s(   || _ g | _|| _|| _d | _d | _d S )N)r   wrappedr   r   colrow)selfr   r   r    r$   `/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/sphinx/writers/text.py__init__   s    zCell.__init__)r   c             C   s   d | j| j| j| j| jS )Nz<Cell {!r} {}v{}/{}>{}>)formatr   r"   r   r!   r   )r#   r$   r$   r%   __repr__"   s    zCell.__repr__c             C   s   t | j| jfS )N)hashr!   r"   )r#   r$   r$   r%   __hash__'   s    zCell.__hash__)widthr   c             C   s   t | j|| _d S )N)my_wrapr   r    )r#   r+   r$   r$   r%   wrap*   s    z	Cell.wrap)r   r   r   )
__name__
__module____qualname____doc__strintr&   r(   r*   r-   r$   r$   r$   r%   r      s
   r   c               @   s  e Zd ZdZd'ee ddddZddddZddd	d
Ze	ddddZ
eeef e	dddZeeef e	ddddZeddddZeddddZedddZe	ee edddZeee	ddf ddd Zddd!d"Zee	 edd#d$Zedd%d&ZdS )(Tableaj  Represents a table, handling cells that can span multiple lines
    or rows, like::

       +-----------+-----+
       | AAA       | BBB |
       +-----+-----+     |
       |     | XXX |     |
       |     +-----+-----+
       | DDD | CCC       |
       +-----+-----------+

    This class can be used in two ways, either:

    - With absolute positions: call ``table[line, col] = Cell(...)``,
      this overwrites any existing cell(s) at these positions.

    - With relative positions: call the ``add_row()`` and
      ``add_cell(Cell(...))`` as needed.

    Cells spanning multiple rows or multiple columns (having a
    colspan or rowspan greater than one) are automatically referenced
    by all the table cells they cover. This is a useful
    representation as we can simply check
    ``if self[x, y] is self[x, y+1]`` to recognize a rowspan.

    Colwidth is not automatically computed, it has to be given, either
    at construction time, or during the table construction.

    Example usage::

       table = Table([6, 6])
       table.add_cell(Cell("foo"))
       table.add_cell(Cell("bar"))
       table.set_separator()
       table.add_row()
       table.add_cell(Cell("FOO"))
       table.add_cell(Cell("BAR"))
       print(table)
       +--------+--------+
       | foo    | bar    |
       |========|========|
       | FOO    | BAR    |
       +--------+--------+

    N)colwidthr   c             C   s.   g | _ d| _|d k	r|ng | _d| _d| _d S )Nr   )lines	separatorr5   current_linecurrent_col)r#   r5   r$   r$   r%   r&   \   s
    zTable.__init__)r   c             C   s   |  j d7  _ d| _dS )zAdd a row to the table, to use with ``add_cell()``.  It is not needed
        to call ``add_row()`` before the first ``add_cell()``.
        r   r   N)r8   r9   )r#   r$   r$   r%   add_rowc   s    zTable.add_rowc             C   s   t | j| _dS )z*Sets the separator below the current line.N)lenr6   r7   )r#   r$   r$   r%   set_separatorj   s    zTable.set_separator)cellr   c             C   sH   x"| | j | jf r"|  jd7  _qW || | j | jf< |  j|j7  _dS )zAdd a cell to the current line, to use with ``add_row()``.  To add
        a cell spanning multiple lines or rows, simply set the
        ``cell.colspan`` or ``cell.rowspan`` BEFORE inserting it into
        the table.
        r   N)r8   r9   r   )r#   r=   r$   r$   r%   add_celln   s    zTable.add_cell)posr   c             C   s2   |\}}|  |d  | |d  | j| | S )Nr   )_ensure_has_line_ensure_has_columnr6   )r#   r?   liner!   r$   r$   r%   __getitem__y   s    zTable.__getitem__)r?   r=   r   c             C   sv   |\}}|  ||j  | ||j  xHt|jD ]:}x4t|jD ]&}|| j||  || < ||_||_qDW q4W d S )N)r@   r   rA   r   ranger6   r"   r!   )r#   r?   r=   rB   r!   ZdlineZdcolr$   r$   r%   __setitem__   s    zTable.__setitem__)rB   r   c             C   s$   xt | j|k r| jg  qW d S )N)r;   r6   append)r#   rB   r$   r$   r%   r@      s    zTable._ensure_has_line)r!   r   c             C   s0   x*| j D ] }xt||k r&|d  qW qW d S )N)r6   r;   rF   )r#   r!   rB   r$   r$   r%   rA      s    zTable._ensure_has_columnc             C   s   d dd | jD S )N
c             s   s   | ]}t |V  qd S )N)repr).0rB   r$   r$   r%   	<genexpr>   s    z!Table.__repr__.<locals>.<genexpr>)joinr6   )r#   r$   r$   r%   r(      s    zTable.__repr__)r=   sourcer   c             C   sH   d}x0t | |j|jf jD ]}|||j|  7 }qW ||jd d  S )zGive the cell width, according to the given source (either
        ``self.colwidth`` or ``self.measured_widths``).
        This takes into account cells spanning multiple columns.
        r   r      )rD   r"   r!   r   )r#   r=   rL   r+   ir$   r$   r%   
cell_width   s    zTable.cell_widthc             c   sD   t  }x8| jD ].}x(|D ] }|r||kr|V  || qW qW d S )N)setr6   add)r#   seenrB   r=   r$   r$   r%   cells   s    
zTable.cellsc             C   s   | j dd | _x| jD ]v}|j| || j d |js:qttdd |jD |j	 }x2t
|j|j|j	 D ]}t| j| || j|< qpW qW dS )zCall ``cell.wrap()`` on all cells, and measure each column width
        after wrapping (result written in ``self.measured_widths``).
        N)r+   c             s   s   | ]}t |V  qd S )N)r   )rI   xr$   r$   r%   rJ      s    zTable.rewrap.<locals>.<genexpr>)r5   measured_widthsrS   r-   rO   r    mathceilmaxr   rD   r!   )r#   r=   r+   r!   r$   r$   r%   rewrap   s     zTable.rewrapc             C   s&   d}x|D ]}t |t|j}q
W |S )zfFor a given line, compute the number of physical lines it spans
        due to text wrapping.
        r   )rX   r;   r    )r#   rB   Zphysical_linesr=   r$   r$   r%   physical_lines_for_line   s    
zTable.physical_lines_for_linec                sD  g }    dttt td fdd}x t jD ]\}} jr`| jkr`||d| n||d| xt 	|D ]}dg}xt|D ]|\}}|j
|krq||jkrd}	n|t|jkrd}	n
|j| }	t|	t|	 }
|d|	 | jd	 |
  d  qW |d| qW q6W ||d d
|S )N-)charlinenor   c                s   g }xht  jD ]Z\}}|dk	rX|dkrX ||f  |d |f krX|d|d   q|| |d   qW |d d dkrdnd}|d	 d dkrdnd}d
d t||dd D }|| |dtt|| S )zfCalled on the line *before* lineno.
            Called with no *lineno* for the last sep.
            Nr   r       r[   +|c             S   s0   g | ](\}}|d  dks$|d  dkr(dndqS )r   r[   r`   ra   r$   )rI   leftrightr$   r$   r%   
<listcomp>   s   z3Table.__str__.<locals>.writesep.<locals>.<listcomp>r   )	enumeraterU   rF   ziprK   r   from_iterable)r\   r]   outcolnor+   headtailZglue)r#   r$   r%   writesep   s    
zTable.__str__.<locals>.writesep=ra   r   r^   r   rG   )r[   N)rY   r2   r
   r3   rf   r6   r7   rF   rD   rZ   r!   r"   r;   r    r   ljustrO   rU   rK   )r#   ri   rm   r]   rB   Zphysical_lineZlinestrrj   r=   Zphysical_textZ
adjust_lenr$   )r#   r%   __str__   s.    


*zTable.__str__)N)r.   r/   r0   r1   r	   r3   r&   r:   r<   r   r>   r   rC   rE   r@   rA   r2   r(   rO   propertyr   rS   rY   rZ   rp   r$   r$   r$   r%   r4   .   s    -

	r4   c                   s   e Zd ZdZedZee ee dddZ	ee
eeef dddZeee d	 fd
dZee ee e
e
ddddZ  ZS )TextWrapperz;Custom subclass that uses a different word separator regex.zf(\s+|(?<=\s)(?::[a-z-]+:)?`\S+|[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w)))chunksr   c             C   s  g }| j dkrtd| j  |  x|rg }d}|r@| j}n| j}| j t| }| jrt|d  dkrt|rt|d= x:|rt|d }|| |kr||	  ||7 }qvP qvW |rt|d |kr| 
|||| | jr|r|d  dkr|d= |r&||d|  q&W |S )z_wrap_chunks(chunks : [string]) -> [string]

        The original _wrap_chunks uses len() to calculate width.
        This method respects wide/fullwidth characters for width adjustment.
        r   zinvalid width %r (must be > 0)rb   r   )r+   
ValueErrorreversesubsequent_indentinitial_indentr   drop_whitespacestriprF   pop_handle_long_wordrK   )r#   rs   r6   cur_linecur_lenindentr+   lr$   r$   r%   _wrap_chunks   s4    

zTextWrapper._wrap_chunks)word
space_leftr   c             C   sV   d}xHt |D ]<\}}|t|7 }||kr|d|d  ||d d fS qW |dfS )z_break_word(word : string, space_left : int) -> (string, string)

        Break line by unicode width instead of len(word).
        r   Nr   r   )rf   r   )r#   r   r   totalrN   cr$   r$   r%   _break_word-  s    $zTextWrapper._break_word)r   r   c                sx   t tt  d fdd}g }xT||D ]H}xBt|tD ]4\}}|dkr^||d| q8|t| q8W q(W |S )z_split(text : string) -> [string]

        Override original method that only split by 'wordsep_re'.
        This '_split' splits wide-characters into chunks by one character.
        )tr   c                s   t t| S )N)superrr   _split)r   )	__class__r#   r$   r%   split?  s    z!TextWrapper._split.<locals>.splitr   r   )r2   r	   r   r   extendrK   list)r#   r   r   rs   chunkwg)r   )r#   r%   r   9  s    zTextWrapper._splitN)reversed_chunksr|   r}   r+   r   c             C   sR   t || d}| jr<| |d |\}}|| ||d< n|sN||  dS )z_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Override original method for using self._break_word() instead of slice.
        r   rb   N)rX   break_long_wordsr   rF   rz   )r#   r   r|   r}   r+   r   r   rr$   r$   r%   r{   J  s    

zTextWrapper._handle_long_word)r.   r/   r0   r1   recompile
wordsep_rer	   r2   r   r3   r   r   r   r{   __classcell__r$   r$   )r   r%   rr      s   /rr   F   rM   )r   r+   kwargsr   c             K   s   t f d|i|}|| S )Nr+   )rr   r-   )r   r+   r   r   r$   r$   r%   r,   `  s    r,   c                   sT   e Zd ZU dZdZi Zeed< dZe	ed< ddd fdd	Z
dd
ddZ  ZS )
TextWriter)r   )zNo options here.r   r$   settings_defaultsNoutputr   )builderr   c                s   t    || _d S )N)r   r&   r   )r#   r   )r   r$   r%   r&   l  s    
zTextWriter.__init__)r   c             C   s0   | j | j| j }| j| tt|j| _d S )N)r   Zcreate_translatordocumentZ	walkaboutr   TextTranslatorbodyr   )r#   visitorr$   r$   r%   	translatep  s    zTextWriter.translate)r.   r/   r0   	supportedZsettings_specr   r   __annotations__r   r2   r&   r   r   r$   r$   )r   r%   r   e  s   
r   c                   s  e Zd ZU dZded< ejddd fddZedddd	Z	e
fedd
ddZddgdfeee eddddZeddddZeddddZeddddZeddddZeddddZeddddZeZeZedddd Zeddd!d"Zeddd#d$Zeddd%d&Zeddd'd(Zeddd)d*Zeddd+d,Zeedd-d.Z eddd/d0Z!eddd1d2Z"eddd3d4Z#eddd5d6Z$eddd7d8Z%eddd9d:Z&eddd;d<Z'eddd=d>Z(eddd?d@Z)edddAdBZ*edddCdDZ+edddEdFZ,edddGdHZ-edddIdJZ.edddKdLZ/edddMdNZ0edddOdPZ1edddQdRZ2edddSdTZ3edddUdVZ4edddWdXZ5edddYdZZ6eddd[d\Z7eddd]d^Z8eddd_d`Z9edddadbZ:edddcddZ;edddedfZ<edddgdhZ=edddidjZ>edddkdlZ?edddmdnZ@edddodpZAedddqdrZBedddsdtZCedddudvZDedddwdxZEedddydzZFeddd{d|ZGeddd}d~ZHeddddZIeddddZJeddddZKeddddZLeddddZMeddddZNeddddZOeddddZPeddddZQeddddZReddddZSeddddZTeddddZUeddddZVeddddZWeddddZXeddddZYeddddZZeddddZ[eddddZ\eddddZ]eddddZ^eddddZ_eddddZ`eddddZaeddddZbeddddZceddddZdeddddZeeddddZfeddddZgeddddZheddddZieddddZjeddddĄZkeddddƄZleddddȄZmeddddʄZnedddd̄Zoedddd΄ZpeddddЄZqedddd҄ZreddddԄZseddddքZtedddd؄ZueddddڄZvedddd܄ZweddddބZxeddddZyeddddZzeddddZ{eddddZ|eddddZ}eddddZ~eddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZedddd ZeddddZeddddZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeddddZeddddZeddd	d
ZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZedddd Zeddd!d"Zeddd#d$Zeddd%d&Zeddd'd(Zeddd)d*Zeddd+d,Zeddd-d.Zeddd/d0Zeddd1d2Zeddd3d4Zeddd5d6Zeddd7d8Zeddd9d:Zeddd;d<Zeddd=d>Zeddd?d@ZedddAdBZedddCdDZedddEdFZedddGdHZedddIdJZedddKdLZedddMdNZedddOdPZedddQdRZedddSdTZedddUdVZedddWdXZedddYdZZeddd[d\Zeddd]d^Zeddd_d`ZedddadbZedddcddZedddedfZedddgdhZedddidjZedddkdlZedddmdnZedddodpZedddqdrZedddsdtZedddudvZedddwdxZedddydzZeddd{d|Zeddd}d~ZeddddZeddddZeddddZeddddZeddddZeddddZ  ZS (  r   Nr   r   )r   r   r   c                s   t  || | jj}|dkr&d| _n|dkr8tj| _nd| _| jj| _| jj	| _
| jj| _g g| _dg| _g | _d| _d| _d | _d S )Nwindowsz
nativerG   r   )r   r&   configZtext_newlinesnloslinesepZtext_sectioncharssectioncharsZtext_add_secnumbersadd_secnumbersZtext_secnumber_suffixsecnumber_suffixstatesstateindentlist_countersectionlevellineblockleveltable)r#   r   r   newlines)r   r$   r%   r&   y  s     



zTextTranslator.__init__)r   r   c             C   s   | j d d|f d S )Nrb   )r   rF   )r#   r   r$   r$   r%   add_text  s    zTextTranslator.add_text)r~   r   c             C   s   | j g  | j| d S )N)r   rF   r   )r#   r~   r$   r$   r%   	new_state  s    zTextTranslator.new_stateTr   )r-   endfirstr   c       
         s  | j  }t| j| j g g d d fdd}x@|D ]8\}}|dkrd| qH|  | |f g qHW |  |d k	rrd d  }d d dgkr̈d||gf n(|d d d }	d||	gf | j d  d S )N)r   c                 sP   sd S r$t dt d} nd }  r>|  7 } | f d S )Nr   )r+   )r,   rK   MAXWIDTH
splitlinesrF   )res)r   r~   	maxindentresulttoformatr-   r$   r%   	do_format  s    z+TextTranslator.end_state.<locals>.do_formatrb   r   r   r   )r   rz   sumr   rF   insertr   )
r#   r-   r   r   contentr   Z
itemindentitemZ	newindentr   r$   )r   r~   r   r   r   r-   r%   	end_state  s(    



zTextTranslator.end_state)noder   c             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_document  s    zTextTranslator.visit_documentc             C   s*   |    | jdd | jd D | _d S )Nc             s   s,   | ]$\}}|D ]}|o d | | V  qqdS )r^   Nr$   )rI   r~   r6   rB   r$   r$   r%   rJ     s   z1TextTranslator.depart_document.<locals>.<genexpr>r   )r   r   rK   r   r   )r#   r   r$   r$   r%   depart_document  s    zTextTranslator.depart_documentc             C   s    | j | j | _|  jd7  _d S )Nr   )r   r   _title_char)r#   r   r$   r$   r%   visit_section  s    zTextTranslator.visit_sectionc             C   s   |  j d8  _ d S )Nr   )r   )r#   r   r$   r$   r%   depart_section  s    zTextTranslator.depart_sectionc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_topic  s    zTextTranslator.visit_topicc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_topic  s    zTextTranslator.depart_topicc             C   s   |  d | d d S )Nr   z-[ )r   r   )r#   r   r$   r$   r%   visit_rubric  s    
zTextTranslator.visit_rubricc             C   s   |  d |   d S )Nz ]-)r   r   )r#   r   r$   r$   r%   depart_rubric  s    
zTextTranslator.depart_rubricc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_compound  s    zTextTranslator.visit_compoundc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_compound  s    zTextTranslator.depart_compoundc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_glossary  s    zTextTranslator.visit_glossaryc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_glossary  s    zTextTranslator.depart_glossaryc             C   s4   t |jtjr&| | d  tj| d d S )Nz: r   )
isinstanceparentr   
Admonitionr   astextSkipNoder   )r#   r   r$   r$   r%   visit_title  s    zTextTranslator.visit_titlec             C   sf   t |jtjrbd|jd d  }| jj|}|d krD| jjd}|d k	rbdtt	|| j
 S dS )N#Zidsr   r   .)r   r   r   sectionr   Z
secnumbersgetrK   mapr2   r   )r#   r   Z
anchornamenumbersr$   r$   r%   get_section_number_string  s    z(TextTranslator.get_section_number_stringc             C   s   t |jtjr| j}nd}d}ddd | j D }| jrL| 	|| }| j
  d|d|t|  dg}t| jdkrt| jd dkr|d | jd d|f d S )	N^r   c             s   s"   | ]}|d  dkr|d V  qdS )r   rb   r   Nr$   )rI   rT   r$   r$   r%   rJ     s    z.TextTranslator.depart_title.<locals>.<genexpr>z%sr_   rb   r   )r   r   r   r   r   rK   r   rz   r   r   r   r   r;   rF   )r#   r   r\   r   titler$   r$   r%   depart_title  s    
 
zTextTranslator.depart_titlec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_subtitle  s    zTextTranslator.visit_subtitlec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_subtitle	  s    zTextTranslator.depart_subtitlec             C   s   |  d d S )Nz-- )r   )r#   r   r$   r$   r%   visit_attribution  s    z TextTranslator.visit_attributionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_attribution  s    z!TextTranslator.depart_attributionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   
visit_desc  s    zTextTranslator.visit_descc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc  s    zTextTranslator.depart_descc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_desc_signature  s    z#TextTranslator.visit_desc_signaturec             C   s   | j dd d d S )NF)r-   r   )r   )r#   r   r$   r$   r%   depart_desc_signature"  s    z$TextTranslator.depart_desc_signaturec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_signature_line&  s    z(TextTranslator.visit_desc_signature_linec             C   s   |  d d S )NrG   )r   )r#   r   r$   r$   r%   depart_desc_signature_line)  s    z)TextTranslator.depart_desc_signature_linec             C   s   |    | | j d S )N)r   r   r   )r#   r   r$   r$   r%   visit_desc_content,  s    z!TextTranslator.visit_desc_contentc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_desc_content0  s    z"TextTranslator.depart_desc_contentc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_inline3  s    z TextTranslator.visit_desc_inlinec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_inline6  s    z!TextTranslator.depart_desc_inlinec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_name<  s    zTextTranslator.visit_desc_namec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_name?  s    zTextTranslator.depart_desc_namec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_addnameB  s    z!TextTranslator.visit_desc_addnamec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_addnameE  s    z"TextTranslator.depart_desc_addnamec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_typeH  s    zTextTranslator.visit_desc_typec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_typeK  s    zTextTranslator.depart_desc_typec             C   s   |  d d S )Nz -> )r   )r#   r   r$   r$   r%   visit_desc_returnsN  s    z!TextTranslator.visit_desc_returnsc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_returnsQ  s    z"TextTranslator.depart_desc_returnsc             C   s   |  d d| _d S )N(r   )r   first_param)r#   r   r$   r$   r%   visit_desc_parameterlistT  s    
z'TextTranslator.visit_desc_parameterlistc             C   s   |  d d S )N))r   )r#   r   r$   r$   r%   depart_desc_parameterlistX  s    z(TextTranslator.depart_desc_parameterlistc             C   s0   | j s| d nd| _ | |  tjd S )Nz, r   )r   r   r   r   r   )r#   r   r$   r$   r%   visit_desc_parameter[  s
    z#TextTranslator.visit_desc_parameterc             C   s   |  d d S )N[)r   )r#   r   r$   r$   r%   visit_desc_optionalc  s    z"TextTranslator.visit_desc_optionalc             C   s   |  d d S )N])r   )r#   r   r$   r$   r%   depart_desc_optionalf  s    z#TextTranslator.depart_desc_optionalc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_desc_annotationi  s    z$TextTranslator.visit_desc_annotationc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_desc_annotationl  s    z%TextTranslator.depart_desc_annotationc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_figureq  s    zTextTranslator.visit_figurec             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_figuret  s    zTextTranslator.depart_figurec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_captionw  s    zTextTranslator.visit_captionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_captionz  s    zTextTranslator.depart_captionc             C   s   |    g }tttj |}x|D ]}||d  q"W tdd |D }d }xh|D ]`}|d r| |d |d  |d }n|d k	r| ddt	|   | |
 | j  qTW | jdd tjd S )	NZ	tokennamec             s   s   | ]}t |V  qd S )N)r;   )rI   namer$   r$   r%   rJ     s    z6TextTranslator.visit_productionlist.<locals>.<genexpr>z ::=z%s    r^   F)r-   )r   r   r   r   
productionrF   rX   r   ro   r;   r   r   r   r   r   )r#   r   namesZproductionlistr	  maxlenlastnamer$   r$   r%   visit_productionlist}  s     


z#TextTranslator.visit_productionlistc             C   s6   t tj|d }|  | _| t| jd  d S )Nr   rM   )r   r   labelr   ry   	_footnoter   r;   )r#   r   r  r$   r$   r%   visit_footnote  s    zTextTranslator.visit_footnotec             C   s   | j d| j d d S )Nz[%s] )r   )r   r  )r#   r   r$   r$   r%   depart_footnote  s    zTextTranslator.depart_footnotec             C   sF   t |r(t|d tjr(|d  | _nd| _| t | jd  d S )Nr   r   rM   )r;   r   r   r  r   	_citlabelr   )r#   r   r$   r$   r%   visit_citation  s    zTextTranslator.visit_citationc             C   s   | j d| j d d S )Nz[%s] )r   )r   r  )r#   r   r$   r$   r%   depart_citation  s    zTextTranslator.depart_citationc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_label  s    zTextTranslator.visit_labelc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_legend  s    zTextTranslator.visit_legendc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_legend  s    zTextTranslator.depart_legendc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_option_list  s    z TextTranslator.visit_option_listc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_option_list  s    z!TextTranslator.depart_option_listc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_option_list_item  s    z%TextTranslator.visit_option_list_itemc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_option_list_item  s    z&TextTranslator.depart_option_list_itemc             C   s
   d| _ d S )NT)_firstoption)r#   r   r$   r$   r%   visit_option_group  s    z!TextTranslator.visit_option_groupc             C   s   |  d d S )Nz     )r   )r#   r   r$   r$   r%   depart_option_group  s    z"TextTranslator.depart_option_groupc             C   s   | j rd| _ n
| d d S )NFz, )r  r   )r#   r   r$   r$   r%   visit_option  s    zTextTranslator.visit_optionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_option  s    zTextTranslator.depart_optionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_option_string  s    z"TextTranslator.visit_option_stringc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_option_string  s    z#TextTranslator.depart_option_stringc             C   s   |  |d  d S )N	delimiter)r   )r#   r   r$   r$   r%   visit_option_argument  s    z$TextTranslator.visit_option_argumentc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_option_argument  s    z%TextTranslator.depart_option_argumentc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_description  s    z TextTranslator.visit_descriptionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_description  s    z!TextTranslator.depart_descriptionc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_tabular_col_spec  s    z%TextTranslator.visit_tabular_col_specc             C   s   | j j|d  tjd S )Nr5   )r   r5   rF   r   r   )r#   r   r$   r$   r%   visit_colspec  s    zTextTranslator.visit_colspecc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_tgroup  s    zTextTranslator.visit_tgroupc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_tgroup  s    zTextTranslator.depart_tgroupc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_thead  s    zTextTranslator.visit_theadc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_thead  s    zTextTranslator.depart_theadc             C   s   | j   d S )N)r   r<   )r#   r   r$   r$   r%   visit_tbody  s    zTextTranslator.visit_tbodyc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_tbody  s    zTextTranslator.depart_tbodyc             C   s   | j jr| j   d S )N)r   r6   r:   )r#   r   r$   r$   r%   	visit_row  s    zTextTranslator.visit_rowc             C   s   d S )Nr$   )r#   r   r$   r$   r%   
depart_row  s    zTextTranslator.depart_rowc             C   s4   t |ddd |ddd d| _| d d S )NZmorerowsr   r   Zmorecols)r   r   )r   r   entryr   )r#   r   r$   r$   r%   visit_entry  s    $zTextTranslator.visit_entryc                sJ    j  fdd j D } j  | j_ j j d  _d S )Nc             3   s   | ]} j |d  V  qdS )r   N)r   rK   )rI   rT   )r#   r$   r%   rJ      s    z.TextTranslator.depart_entry.<locals>.<genexpr>)	r   rK   r   rz   r   r2  r   r   r>   )r#   r   r   r$   )r#   r%   depart_entry  s
     
zTextTranslator.depart_entryc             C   s$   | j rtd| d t | _ d S )Nz Nested tables are not supported.r   )r   NotImplementedErrorr   r4   )r#   r   r$   r$   r%   visit_table  s    
zTextTranslator.visit_tablec             C   s&   |  t| j d | _| jdd d S )NF)r-   )r   r2   r   r   )r#   r   r$   r$   r%   depart_table  s    zTextTranslator.depart_tablec             C   sZ   t tj|d }t ttj |}| d | ddd |D d  |   tj	d S )Nr   z, c             s   s   | ]}|  V  qd S )N)r   )rI   nr$   r$   r%   rJ     s    z,TextTranslator.visit_acks.<locals>.<genexpr>r   )
r   r   bullet_listr   Z	list_itemr   r   rK   r   r   )r#   r   r9  Z
list_itemsr$   r$   r%   
visit_acks  s    
zTextTranslator.visit_acksc             C   s8   d|j kr | td|d   | td tjd S )NZaltz[image: %s]z[image])
attributesr   r   r   r   )r#   r   r$   r$   r%   visit_image  s    
zTextTranslator.visit_imagec             C   s8   t | j}| d | dt|   |   tjd S )Nr   rn   )r   r   r   r   r   r   r   r   )r#   r   r~   r$   r$   r%   visit_transition  s
    

zTextTranslator.visit_transitionc             C   s   | j d d S )Nrb   )r   rF   )r#   r   r$   r$   r%   visit_bullet_list&  s    z TextTranslator.visit_bullet_listc             C   s   | j   d S )N)r   rz   )r#   r   r$   r$   r%   depart_bullet_list)  s    z!TextTranslator.depart_bullet_listc             C   s   | j |ddd  d S )Nstartr   )r   rF   r   )r#   r   r$   r$   r%   visit_enumerated_list,  s    z$TextTranslator.visit_enumerated_listc             C   s   | j   d S )N)r   rz   )r#   r   r$   r$   r%   depart_enumerated_list/  s    z%TextTranslator.depart_enumerated_listc             C   s   | j d d S )N)r   rF   )r#   r   r$   r$   r%   visit_definition_list2  s    z$TextTranslator.visit_definition_listc             C   s   | j   d S )N)r   rz   )r#   r   r$   r$   r%   depart_definition_list5  s    z%TextTranslator.depart_definition_listc             C   s\   | j d dkr| d n>| j d dkr*n.| j d  d7  < | tt| j d d  d S )Nrb   r_   rC  r   )r   r   r;   r2   )r#   r   r$   r$   r%   visit_list_item8  s    zTextTranslator.visit_list_itemc             C   sF   | j d dkr| jdd n&| j d dkr,n| jd| j d  d d S )Nrb   z* )r   rC  z%s. )r   r   )r#   r   r$   r$   r%   depart_list_itemD  s
    zTextTranslator.depart_list_itemc             C   s   t t|tj| _d S )N)r;   r   findallr   
classifier_classifier_count_in_li)r#   r   r$   r$   r%   visit_definition_list_itemL  s    z)TextTranslator.visit_definition_list_itemc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_definition_list_itemO  s    z*TextTranslator.depart_definition_list_itemc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   
visit_termR  s    zTextTranslator.visit_termc             C   s   | j s| jd d d S )N)r   )rJ  r   )r#   r   r$   r$   r%   depart_termU  s    zTextTranslator.depart_termc             C   s   |  d d S )Nz : )r   )r#   r   r$   r$   r%   visit_classifierY  s    zTextTranslator.visit_classifierc             C   s$   |  j d8  _ | j s | jd d d S )Nr   )r   )rJ  r   )r#   r   r$   r$   r%   depart_classifier\  s    z TextTranslator.depart_classifierc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_definitiona  s    zTextTranslator.visit_definitionc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_definitiond  s    z TextTranslator.depart_definitionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_field_listg  s    zTextTranslator.visit_field_listc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_field_listj  s    z TextTranslator.depart_field_listc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_fieldm  s    zTextTranslator.visit_fieldc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_fieldp  s    zTextTranslator.depart_fieldc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_field_names  s    zTextTranslator.visit_field_namec             C   s   |  d | jd d d S )N:)r   )r   r   )r#   r   r$   r$   r%   depart_field_namev  s    
z TextTranslator.depart_field_namec             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_field_bodyz  s    zTextTranslator.visit_field_bodyc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_field_body}  s    z TextTranslator.depart_field_bodyc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_centered  s    zTextTranslator.visit_centeredc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_centered  s    zTextTranslator.depart_centeredc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_hlist  s    zTextTranslator.visit_hlistc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_hlist  s    zTextTranslator.depart_hlistc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_hlistcol  s    zTextTranslator.visit_hlistcolc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_hlistcol  s    zTextTranslator.depart_hlistcolc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_admonition  s    zTextTranslator.visit_admonitionc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_admonition  s    z TextTranslator.depart_admonitionc             C   s   |  d d S )Nr_   )r   )r#   r   r$   r$   r%   _visit_admonition  s    z TextTranslator._visit_admonitionc             C   s   t |j }t| jt| }t| jd dkr| jd d d dkrt| tdd | jd d d D kr| jd  t|7  < | j|d d n*| jd dd| j	gf | j|d d d S )	Nrb   r   r   c             s   s   | ]}t |V  qd S )N)r;   )rI   sr$   r$   r%   rJ     s    z4TextTranslator._depart_admonition.<locals>.<genexpr>z: )r   rX  )
r   tagnamer   r   r;   r   r   r   r   r   )r#   r   r  r~   r$   r$   r%   _depart_admonition  s    
(z!TextTranslator._depart_admonitionc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_versionmodified  s    z$TextTranslator.visit_versionmodifiedc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_versionmodified  s    z%TextTranslator.depart_versionmodifiedc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_literal_block  s    z"TextTranslator.visit_literal_blockc             C   s   | j dd d S )NF)r-   )r   )r#   r   r$   r$   r%   depart_literal_block  s    z#TextTranslator.depart_literal_blockc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_doctest_block  s    z"TextTranslator.visit_doctest_blockc             C   s   | j dd d S )NF)r-   )r   )r#   r   r$   r$   r%   depart_doctest_block  s    z#TextTranslator.depart_doctest_blockc             C   s   |    |  jd7  _d S )Nr   )r   r   )r#   r   r$   r$   r%   visit_line_block  s    zTextTranslator.visit_line_blockc             C   s0   |  j d8  _ | jdd d | j s,| d d S )Nr   F)r-   r   rG   )r   r   r   )r#   r   r$   r$   r%   depart_line_block  s    z TextTranslator.depart_line_blockc             C   s   d S )Nr$   )r#   r   r$   r$   r%   
visit_line  s    zTextTranslator.visit_linec             C   s   |  d d S )NrG   )r   )r#   r   r$   r$   r%   depart_line  s    zTextTranslator.depart_linec             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_block_quote  s    z TextTranslator.visit_block_quotec             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_block_quote  s    z!TextTranslator.depart_block_quotec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_compact_paragraph  s    z&TextTranslator.visit_compact_paragraphc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_compact_paragraph  s    z'TextTranslator.depart_compact_paragraphc             C   s*   t |jtjrt |jtjr&| d d S )Nr   )r   r   r   r   r   seealsor   )r#   r   r$   r$   r%   visit_paragraph  s    zTextTranslator.visit_paragraphc             C   s(   t |jtjrt |jtjr$|   d S )N)r   r   r   r   r   rv  r   )r#   r   r$   r$   r%   depart_paragraph  s    zTextTranslator.depart_paragraphc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_target  s    zTextTranslator.visit_targetc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_index  s    zTextTranslator.visit_indexc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_toctree  s    zTextTranslator.visit_toctreec             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_substitution_definition  s    z,TextTranslator.visit_substitution_definitionc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_pending_xref  s    z!TextTranslator.visit_pending_xrefc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_pending_xref  s    z"TextTranslator.depart_pending_xrefc             C   s8   | j r4|d}|d k	r4| dtt|| j  d S )NZ	secnumberr   )r   r   r   rK   r   r2   r   )r#   r   r   r$   r$   r%   visit_reference  s    
zTextTranslator.visit_referencec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_reference  s    zTextTranslator.depart_referencec             C   s&   t |dd}| | t jd S )Nr   r   )r   r   r   
visit_Textr   )r#   r   r   r$   r$   r%   visit_number_reference  s    
z%TextTranslator.visit_number_referencec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_download_reference  s    z'TextTranslator.visit_download_referencec             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_download_reference  s    z(TextTranslator.depart_download_referencec             C   s   |  d d S )N*)r   )r#   r   r$   r$   r%   visit_emphasis  s    zTextTranslator.visit_emphasisc             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   depart_emphasis  s    zTextTranslator.depart_emphasisc             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   visit_literal_emphasis"  s    z%TextTranslator.visit_literal_emphasisc             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   depart_literal_emphasis%  s    z&TextTranslator.depart_literal_emphasisc             C   s   |  d d S )Nz**)r   )r#   r   r$   r$   r%   visit_strong(  s    zTextTranslator.visit_strongc             C   s   |  d d S )Nz**)r   )r#   r   r$   r$   r%   depart_strong+  s    zTextTranslator.depart_strongc             C   s   |  d d S )Nz**)r   )r#   r   r$   r$   r%   visit_literal_strong.  s    z#TextTranslator.visit_literal_strongc             C   s   |  d d S )Nz**)r   )r#   r   r$   r$   r%   depart_literal_strong1  s    z$TextTranslator.depart_literal_strongc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_abbreviation4  s    z!TextTranslator.visit_abbreviationc             C   s    | dr| d|d   d S )NZexplanationz (%s))hasattrr   )r#   r   r$   r$   r%   depart_abbreviation7  s    
z"TextTranslator.depart_abbreviationc             C   s
   |  |S )N)r  )r#   r   r$   r$   r%   visit_manpage;  s    zTextTranslator.visit_manpagec             C   s
   |  |S )N)r  )r#   r   r$   r$   r%   depart_manpage>  s    zTextTranslator.depart_manpagec             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   visit_title_referenceA  s    z$TextTranslator.visit_title_referencec             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   depart_title_referenceD  s    z%TextTranslator.depart_title_referencec             C   s   |  d d S )N")r   )r#   r   r$   r$   r%   visit_literalG  s    zTextTranslator.visit_literalc             C   s   |  d d S )Nr  )r   )r#   r   r$   r$   r%   depart_literalJ  s    zTextTranslator.depart_literalc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_subscriptM  s    zTextTranslator.visit_subscriptc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_subscriptP  s    zTextTranslator.depart_subscriptc             C   s   |  d d S )Nr   )r   )r#   r   r$   r$   r%   visit_superscriptS  s    z TextTranslator.visit_superscriptc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_superscriptV  s    z!TextTranslator.depart_superscriptc             C   s   |  d|   tjd S )Nz[%s])r   r   r   r   )r#   r   r$   r$   r%   visit_footnote_referenceY  s    z'TextTranslator.visit_footnote_referencec             C   s   |  d|   tjd S )Nz[%s])r   r   r   r   )r#   r   r$   r$   r%   visit_citation_reference]  s    z'TextTranslator.visit_citation_referencec             C   s   |  |  d S )N)r   r   )r#   r   r$   r$   r%   r  a  s    zTextTranslator.visit_Textc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_Textd  s    zTextTranslator.depart_Textc             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_generatedg  s    zTextTranslator.visit_generatedc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_generatedj  s    zTextTranslator.depart_generatedc             C   s&   d|d ksd|d kr"|  d d S )Nxrefclassestermr  )r   )r#   r   r$   r$   r%   visit_inlinem  s    zTextTranslator.visit_inlinec             C   s&   d|d ksd|d kr"|  d d S )Nr  r  r  r  )r   )r#   r   r$   r$   r%   depart_inlineq  s    zTextTranslator.depart_inlinec             C   s   d S )Nr$   )r#   r   r$   r$   r%   visit_containeru  s    zTextTranslator.visit_containerc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_containerx  s    zTextTranslator.depart_containerc             C   s   |  d d S )Nz>>)r   )r#   r   r$   r$   r%   visit_problematic{  s    z TextTranslator.visit_problematicc             C   s   |  d d S )Nz<<)r   )r#   r   r$   r$   r%   depart_problematic~  s    z!TextTranslator.depart_problematicc             C   s.   |  d | d|   |   tjd S )Nr   z<SYSTEM MESSAGE: %s>)r   r   r   r   r   r   )r#   r   r$   r$   r%   visit_system_message  s    
z#TextTranslator.visit_system_messagec             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   visit_comment  s    zTextTranslator.visit_commentc             C   s
   t jd S )N)r   r   )r#   r   r$   r$   r%   
visit_meta  s    zTextTranslator.visit_metac             C   sB   d| dd kr8| d | |  | jdd tjd S )Nr   r'   r   r   F)r-   )r   r   r   r   r   r   r   r   )r#   r   r$   r$   r%   	visit_raw  s
    
zTextTranslator.visit_rawc             C   s   d S )Nr$   )r#   r   r$   r$   r%   
visit_math  s    zTextTranslator.visit_mathc             C   s   d S )Nr$   )r#   r   r$   r$   r%   depart_math  s    zTextTranslator.depart_mathc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   visit_math_block  s    zTextTranslator.visit_math_blockc             C   s   |    d S )N)r   )r#   r   r$   r$   r%   depart_math_block  s    z TextTranslator.depart_math_block)r.   r/   r0   r   r   r   r   r&   r2   r   	STDINDENTr3   r   boolr	   r   r   r   r   r   r   r   r   Zvisit_sidebarZdepart_sidebarr   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/  r0  r1  r3  r4  r6  r7  r:  r<  r=  r>  r?  rA  rB  rD  rE  rF  rG  rK  rL  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rY  rZ  r[  r\  r]  r^  r_  r`  ra  rb  rc  rd  rg  Zvisit_attentionZdepart_attentionZvisit_cautionZdepart_cautionZvisit_dangerZdepart_dangerZvisit_errorZdepart_errorZ
visit_hintZdepart_hintZvisit_importantZdepart_importantZ
visit_noteZdepart_noteZ	visit_tipZ
depart_tipZvisit_warningZdepart_warningZvisit_seealsoZdepart_seealsorh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rw  rx  ry  rz  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   v  s  
"$

r   )0r1   rV   r   r   textwrap	itertoolsr   r   typingr   r   r   r   r   r	   r
   r   r   r   r   Zdocutilsr   r   Zdocutils.nodesr   r   Zdocutils.utilsr   Zsphinxr   Zsphinx.localer   r   Zsphinx.util.docutilsr   Zsphinx.builders.textr   r   r4   rr   r   r  r2   r3   r,   Writerr   r   r$   r$   r$   r%   <module>   s.   4 Hg