Files
OrbbecSDK_ROS2/docs/_ext/__pycache__/section_search.cpython-310.pyc
T

40 lines
3.1 KiB
Plaintext
Raw Normal View History

o
¨ïåi¸ã@s¢dZddlmZddlZddlZddlmZddlmZdZ dZ
e  d¡Z ee
ƒ ¡jZed Zed
Zd d „Zd
d„Zdd„Zddd„Zddd„Zd dd„ZdS)!zABuild a section-level JSON index for custom documentation search.é)Ú annotationsN)ÚPath)Únodeszsection-search-index.jsonzsection-search-index.jsz\s+ÚstaticÚ templatescCs,| dt¡| dt¡| d¡dddœS)Nz
config-initedzbuild-finishedzsection_search.jsz0.1T)ÚversionÚparallel_read_safe)ÚconnectÚconfigure_assetsÚwrite_section_search_indexÚ add_js_file)Úapp©rúY/home/yalian/work/camera/ROS2_v2main_doc/OrbbecSDK_ROS2/docs/en/../_ext/section_search.pyÚsetups  

rcCsDttƒ}ttƒ}||jvr|j |¡||jvr |j |¡dSdS)N)ÚstrÚ
STATIC_DIRÚ
TEMPLATES_DIRÚhtml_static_pathÚappendÚtemplates_path)r
ÚconfigÚ
static_dirÚ
templates_dirrrrr
s
 
ÿr
c CsŒ|dus
|jjdkr dSg}|jj}t|jƒD]s}|dvrq| |¡}|j |¡}||jvr7t|j|  ¡ƒn|}t
|ƒ}|sA|rM|  d||d||dœ¡|  t
j¡D]6} t| ƒ}
t
| ƒ} |  dg¡} | ri| dnd}
|
rt|›d|
›�n|}|
s{| s{qS|  d |
p�|||
|| dœ¡qSq|jjp�d
|d œ}t|jƒd }|jd
d
d�|tjtj|ddd�dd�|tjdtj|ddd�ddd�dS)NÚhtml>ÚsearchÚgenindexÚdocumentÚ)ÚkindÚtitleÚ
page_titleÚanchorÚurlÚtextÚidsrú#ÚsectionÚen)ÚlanguageÚentriesÚ_staticT)ÚparentsÚexist_okF)ú,ú:)Ú ensure_asciiÚ
separatorszutf-8)Úencodingzwindow.SECTION_SEARCH_INDEX = ú;)ÚbuilderÚformatÚenvÚsortedÚ
found_docsÚ get_doctreeÚget_target_uriÚtitlesÚnormalize_textÚastextÚcollect_direct_textrÚfindallrr'Úget_section_titleÚgetrr)rÚoutdirÚmkdirÚINDEX_FILENAMEÚ
write_textÚjsonÚdumpsÚINDEX_SCRIPT_FILENAME)r
Ú exceptionr*r6ÚdocnameÚdoctreeÚ
target_urir!Ú
document_textr'r r$Ú section_idsr"r#ÚpayloadÚ
output_dirrrrr %sp