+
    ~vi                        R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt R R	 ltR
 R ltR R ltR R ltR R ltRR R lltR# )a  Machinery for documenting traitlets config options with Sphinx.

This includes:

- A Sphinx extension defining directives and roles for config options.
- A function to generate an rst file given an Application instance.

To make this documentation, first set this module as an extension in Sphinx's
conf.py::

    extensions = [
        # ...
        'traitlets.config.sphinxdoc',
    ]

Autogenerate the config documentation by running code like this before
Sphinx builds::

    from traitlets.config.sphinxdoc import write_doc
    from myapp import MyApplication

    writedoc('config/options.rst',    # File to write
             'MyApp config options',  # Title
             MyApplication()
            )

The generated rST syntax looks like this::

    .. configtrait:: Application.log_datefmt

        Description goes here.

    Cross reference like this: :configtrait:`Application.log_datefmt`.
)annotationsN)defaultdict)dedent)	HasTraits	Undefined)Application)indentc                    V ^8  d   QhRRRR/# )   appt.Anyreturndict[str, t.Any] )formats   "</usr/lib/python3/dist-packages/traitlets/config/sphinxdoc.py__annotate__r   .   s     E Eu E) E    c                6    V P                  RRRR7       RRRR/# )zxRegisters the Sphinx extension.

You shouldn't need to call this directly; configure Sphinx to use this
module instead.
configtraitzConfig option)objnameparallel_read_safeTparallel_write_safe)add_object_type)r   s   &r   setupr   .   s)     }oN $(=tDDr   c                    V ^8  d   QhRRRR/# )r
   dvr   r   boolr   )r   s   "r   r   r   8   s      % D r   c                    V e   V \         J d   R# \        V \        \        \        \
        \        34      '       d   \        V 4      # R# )NFT)r   
isinstancestrlisttupledictsetr   )r   s   &r   interesting_default_valuer%   8   s4    

i"sD%s344Bxr   c                    V ^8  d   QhRRRR/# )r
   aliasesz	list[str]r   r    r   )r   s   "r   r   r   @   s      I # r   c                    . pV  F.  p\        V4      ^8X  d   RMRpVP                  RV V R24       K0  	  RP                  V4      # )   -z--z``, )lenappendjoin)r'   fmtedadashess   &   r   format_aliasesr2   @   sL    EA!r&!B'(  99Ur   c               $    V ^8  d   QhRRRRRR/# )r
   clsztype[HasTraits]trait_aliasesr   r   r    r   )r   s   "r   r   r   H   s#     - -o ->N -SV -r   c           
     ~   . pV P                   p\        V P                  RR7      P                  4       4       EF  w  rEVP                  P                   pVR,           VP
                  ;'       g    R,           pVRV,           R.,          pVP                  P                  4       ;'       g    RpVP                  \        \        V4      4      R,           4       RV9   dC   VP                  \        R	R
P                  R VP                   4       4      ,           4      4       M!VP                  \        RV,           4      4       \        VP                  4      '       di    VP                  4       p	V	eT   \#        V	4      ^@8  d   V	R,          R,           p	V	P%                  RR4      p	VP                  \        RV	,          4      4       W,          '       d3   \'        W,          4      p
VP                  \        RV
,           4      4       VP                  R4       EK  	  RP                  V4      #   \          d    Rp	 Li ; i)zgGenerate rST documentation for this class' config options.

Excludes traits defined on parent classes.
T)config. z.. configtrait:: zNo description
Enumz
:options: r+   c              3  4   "   T F  pR V,          x  K  	  R# 5i)z``%r``Nr   ).0xs   & r   	<genexpr>'class_config_rst_doc.<locals>.<genexpr>[   s     8\|!A|s   z:trait type: N:N=   Nz...z\nz\\nz:default: ``%s``z:CLI option: )__name__sortedclass_traitsitems	__class__namehelprstripr-   r   r   r.   valuesr%   default_valuedefault_value_repr	Exceptionr,   replacer2   )r4   r5   lines	classname_traitttypefullnamerH   dvrfmt_aliasess   &&         r   class_config_rst_docrW   H   s   
 EI3++4+8>>@A((s?ejj&6&6B7%0"55zz  "66&6VF4L)D01 U?LLtyy8\u||8\/\ \]^LL% 789 %U%8%899..0 s8b=c(U*Ckk%1V$6$<=> ""()@AKLL+ =>? 	RI BL 99U#  s   H,,H<;H<c                    V ^8  d   QhRRRR/# )r
   r   r   r   zdict[str, list[str]]r   )r   s   "r   r   r   x   s       )= r   c                   \        \        4      pV P                  P                  4        F  w  r#W,          P	                  V4       K  	  V P
                  P                  4        F  w  pw  rV\        V4      ^8X  g   K  \        \        V4      4      pWW,          p\        V4      ^8X  g   KH  \        \        V4      4      p	W,          RJ g   Kj  WR,           V	,           ,          P	                  V4       K  	  V# )zBProduce a mapping of trait names to lists of command line aliases.Tr8   )	r   r!   r'   rE   r-   flagsr,   nextiter)
r   resaliasrR   flagcfgrQ   rP   cls_cfg	traitnames
   &         r   reverse_aliasesrc   x   s    
d
C))+
%  ,
 ))//+hss8q=T#YInG7|q  g/	%-C)34;;DA , Jr   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r
   pathr    titler   r   preamblez
str | Noner   Noner   )r   s   "r   r   r      s0      C  +  W[ r   c           	        \        V4      p\        V R4      ;_uu_ 4       pVP                  VR,           4       VP                  R\        V4      ,          R,           4       VP                  R4       Ve   VP                  VR,           4       VP	                  4        F.  pVP                  \        Wd4      4       VP                  R4       K0  	  RRR4       R#   + '       g   i     R# ; i)aa  Write a rst file documenting config options for a traitlets application.

Parameters
----------
path : str
    The file to be written
title : str
    The human-readable title of the document
app : traitlets.config.Application
    An instance of the application class to be documented
preamble : str
    Extra text to add just after the title (optional)
wr:   =Nz

)rc   openwriter,   _classes_inc_parentsrW   )re   rf   r   rg   r5   fcs   &&&&   r   	write_docrq      s     $C(M	dCA		s5z!T)*	GGHv%&))+AGG(:;GGDM , 
s   B0CC+	)N)__doc__
__future__r   typingtcollectionsr   textwrapr   	traitletsr   r   traitlets.config.applicationr   traitlets.utils.textr   r   r%   r2   rW   rc   rq   r   r   r   <module>r{      sG   !D #  #  * 4 'E-`( r   