文件操作 - sphinxdoc.cpython-311.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/traitlets/config/__pycache__/sphinxdoc.cpython-311.pyc
编辑文件内容
� �UcB � �` � d Z ddlmZ ddlmZ ddlmZ ddlmZ d� Z d� Z d� Zd � Zd � Z d d�ZdS )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`. � )�defaultdict)�dedent)� Undefined)�indentc �@ � | � ddd�� � ddd�}|S )z�Registers the Sphinx extension. You shouldn't need to call this directly; configure Sphinx to use this module instead. �configtraitz Config option)�objnameT)�parallel_read_safe�parallel_write_safe)�add_object_type)�app�metadatas �</usr/lib/python3/dist-packages/traitlets/config/sphinxdoc.py�setupr * s1 � � ��� �}�o��N�N�N�&*�4�H�H�H��O� c � � | � | t u rdS t | t t t t t f� � rt | � � S dS )NFT)r � isinstance�str�list�tuple�dict�set�bool)�dvs r �interesting_default_valuer 5 sA � � � ��i����u��"�s�D�%��s�3�4�4� ��B�x�x���4r c � � g }| D ]4}t |� � dk rdnd}|� d|� |� d�� � �5d� |� � S )N� �-z--z``�, )�len�append�join)�aliases�fmted�a�dashess r �format_aliasesr'