
    k7iF                         S r SSKJr  SSKJrJr  SSKJr  \(       a  SSKJ	r	   SS\
\   SSS	\S
\S\S\SS4S jjrSr        SSSS\S	\S\S\S\S-  S\
\   S-  S\S\S\4S jjrg)z0HTML documentation generation for cyclopts apps.    )TYPE_CHECKING)escape_htmlextract_text)BaseDocGenerator)Applinesappr   include_hiddenapp_nameprefixdepthreturnNc           
         UR                   (       d  g[        R                  " X5       H  u  pgU(       a  U U 3OUnU SUR                  SS5       3R	                  5       n	SUS-   -  n
U R                  U
 SU	 SU S35        UR                   (       a<  U R                  U
 S	35        [        XX#U S3US-   5        U R                  U
 S
35        U R                  U
 S35        M     g)z,Recursively generate HTML table of contents.N- z     z<li><a href="#z"><code>z</code></a>z  <ul>z  </ul>z</li>)	_commandsr   iterate_commandsreplacelowerappend_generate_html_toc)r   r	   r
   r   r   r   namesubappdisplay_name	full_pathindents              L/home/james-whalen/.local/lib/python3.13/site-packages/cyclopts/docs/html.pyr   r      s     ==(99#N,2&$(j,"6"6sC"@!ABHHJ	#x~i[kRSLLF86*+un<.XYHZ\ade\efLLF87+,xu%& O    a=  
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --code-bg: #f5f5f5;
    --link-color: #0066cc;
    --header-bg: #f8f9fa;
    --required-color: #d73027;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 2em; border-bottom: 2px solid var(--border-color); padding-bottom: 0.3em; }
h2 { font-size: 1.5em; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }

code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
}

pre code {
    background: none;
    padding: 0;
}

.usage-block {
    margin: 16px 0;
}

.usage {
    background: #f8f9fa;
    border-left: 4px solid #0066cc;
}

.description, .app-description, .command-description {
    margin: 16px 0;
    color: var(--text-color);
}

.panel-description {
    margin: 12px 0;
    color: #666;
}

.help-panel {
    margin: 24px 0;
}

/* List styles for commands and parameters */
.commands-list, .parameters-list {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

.commands-list li, .parameters-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.commands-list li:last-child, .parameters-list li:last-child {
    border-bottom: none;
}

.commands-list code, .parameters-list code {
    font-weight: 600;
}

/* Metadata styling */
.parameter-metadata {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.metadata-item {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.85em;
    border-radius: 4px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
}

.metadata-required {
    background: #fee;
    border-color: #fcc;
    color: #c00;
    font-weight: 600;
}

.metadata-default {
    background: #f0f8ff;
    border-color: #d0e8ff;
    color: #0066cc;
}

.metadata-env {
    background: #f0fff0;
    border-color: #d0ffd0;
    color: #080;
}

.metadata-choices {
    background: #fffaf0;
    border-color: #ffd0a0;
    color: #840;
}

.metadata-label {
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    font-size: 0.9em;
}

/* Table of Contents */
.table-of-contents {
    background: var(--header-bg);
    border-radius: 6px;
    padding: 16px;
    margin: 24px 0;
}

.table-of-contents h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.table-of-contents ul {
    margin: 8px 0;
    padding-left: 24px;
}

.table-of-contents li {
    margin: 4px 0;
}

.table-of-contents a {
    color: var(--link-color);
    text-decoration: none;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

/* General link styles */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.commands-list a code {
    color: var(--link-color);
}

/* Back to top link */
.back-to-top {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9em;
    opacity: 0.7;
}

.back-to-top:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .commands-list, .parameters-list {
        font-size: 0.9em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e1e1e;
        --text-color: #e0e0e0;
        --border-color: #444;
        --code-bg: #2d2d2d;
        --link-color: #66b3ff;
        --header-bg: #2d2d2d;
    }

    .usage {
        background: #2d2d2d;
        border-left-color: #66b3ff;
    }

    .table-of-contents {
        background: #2d2d2d;
    }

    .metadata-required {
        background: #4a2020;
        border-color: #6a3030;
        color: #ff9999;
    }

    .metadata-default {
        background: #20304a;
        border-color: #304060;
        color: #99ccff;
    }

    .metadata-env {
        background: #204a20;
        border-color: #306030;
        color: #99ff99;
    }

    .metadata-choices {
        background: #4a3020;
        border-color: #604030;
        color: #ffcc99;
    }
}

/* Command sections */
.command-section {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

.command-section:first-child {
    border-top: none;
}
	recursiveheading_level
standalone
custom_csscommand_chaingenerate_tocflatten_commandsc	                    SSK Jn	  Uc  / n/ n
U(       d  U(       d  U
R                  S5        U(       d/  U R                  S   nUnUnU
R                  SU SU SU S35        OU(       a  US   OU R                  S   nS	R	                  U5      nU S
S
R	                  USS 5       3nUR                  5       R                  S	S
5      nU
R                  S5        U
R                  SU SU S[        U5       SU S3	5        U R                  R                  SSS9n[        R                  " X5      nU(       a1  [        US5      nU(       a  U
R                  S[        U5       S35        U(       a{  U(       dt  U R                  (       ac  U
R                  S5        U
R                  S5        U
R                  S5        [        XX+SS5        U
R                  S5        U
R                  S5        [        R                  " U 5      nU(       a  U
R                  SUS-    SUS-    S35        U
R                  S5        [!        U["        5      (       a  UnO[        US5      n[        R$                  " UUSS9nU
R                  S[        U5       S35        U
R                  S5        U R'                  / U5      nU	" US-   UUUS 9nUR)                  5         U Hg  u  nnU(       d  U(       a  UR*                  (       d  M'  U(       d  [        R,                  " UU5      Ul        UR.                  (       d  M]  U" SSU5        Mi     UR1                  5       R3                  5       nU(       a  U
R                  U5        U R                  (       Ga  [        R4                  " X5       GH  u  nn[        R6                  " UUU5      nU(       a  UnOUS-   nU
R                  S5        [9        U5      S:  a'  U S
S
R	                  USS 5       3R                  5       OU S
U 3R                  5       nU
R                  SU SU S[        S	R	                  U5      5       SU S3	5        UR                  U/5         UR                  R                  SUS9n[        R                  " UU5      nU(       a1  [        US5      nU(       a  U
R                  S![        U5       S35        [        R                  " U5      n U (       a  U(       a  US-   n!OUS"-   n!U
R                  SU! SU! S35        U
R                  S5        [!        U ["        5      (       a  U n"O[        U S5      n"[        R$                  " U"USS9n"U
R                  S[        U"5       S35        U
R                  S5        U(       Ga
  UR'                  / U5      n#U(       a  US-   n$OUS"-   n$U	" U$UUUS 9n%U# H  u  n&n'U(       d  U&(       a  U&R*                  (       d  M'  U(       dV  U'R.                   V(s/ s H9  n(U(R:                  (       a#  [=        S# U(R:                   5       5      (       a  M7  U(PM;     sn(U'l        U'R.                  (       d  M  U%" SSU'5        M     U%R1                  5       R3                  5       n)U)(       a  U
R                  U)5        U(       a{  UR                  (       aj  [        R4                  " UU5       HO  u  n*n+[        R6                  " UU*U5      n,U(       a  Un-OUS"-   n-[?        U+UUU-S$SU,S$US%9	n.U
R                  U.5        MQ     SSS5        U(       a  U
R                  S&5        U
R                  S'5        GM     U(       a  U
R                  S'5        U(       d  U(       d  U
R                  S5        S(R	                  U
5      n/U(       a&  U(       a  UO[@        n0S)[        U5       S*U0 S+U/ S,3n1U1$ U/$ s  sn(f ! , (       d  f       N= f)-a  Generate HTML documentation for a CLI application.

Parameters
----------
app : App
    The cyclopts App instance to document.
recursive : bool
    If True, generate documentation for all subcommands recursively.
    Default is True.
include_hidden : bool
    If True, include hidden commands/parameters in documentation.
    Default is False.
heading_level : int
    Starting heading level for the main application title.
    Default is 1.
standalone : bool
    If True, generate a complete HTML document with <html>, <head>, etc.
    If False, generate only the body content. Default is True.
custom_css : str
    Custom CSS to use instead of the default styles.
command_chain : list[str]
    Internal parameter to track command hierarchy.
    Default is None.
generate_toc : bool
    If True, generate a table of contents for multi-command apps.
    Default is True.
flatten_commands : bool
    If True, generate all commands at the same heading level instead of nested.
    Default is False.

Returns
-------
str
    The generated HTML documentation.
r   )HtmlFormatterNz<div class="cli-documentation">z<hz class="app-title">z</h>r   r   r   z!<section class="command-section">z id="z" class="command-title"><code>z
</code></hhelp_formatrestructuredtext)fallbackz<div class="app-description">z</div>z<div class="table-of-contents">z<h2>Table of Contents</h2>z<ul> z</ul>z	>Usage</hz<div class="usage-block">$)r   z<pre class="usage">z</pre>)r!   r
   r   r$   z!<div class="command-description">   c              3      #    U  H:  nUR                  S 5      =(       d    UR                  S5      =(       d    US:H  v   M<     g7f)z--helpz	--versionz-hN)
startswith).0ns     r   	<genexpr>%generate_html_docs.<locals>.<genexpr>  s=      ,&18A )*X(>(h!,,{B[(h_`dh_h(h18s   AAF)r    r
   r!   r"   r#   r$   r%   r&   u6   <a href="#top" class="back-to-top">↑ Back to top</a>z
</section>
z<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>z) - CLI Documentation</title>
    <style>
z&
    </style>
</head>
<body id="top">
z
</body>
</html>)!cyclopts.help.formatters.htmlr(   r   r   joinr   r   r   	app_stackresolver   extract_descriptionr   r   r   extract_usage
isinstancestrformat_usage_line_assemble_help_panelsresetshowfilter_help_entriesentries
get_outputstripr   build_command_chainlennamesallgenerate_html_docsDEFAULT_CSS)2r	   r    r
   r!   r"   r#   r$   r%   r&   r(   r   r   full_commandtitle	anchor_idr*   description	desc_textusage
usage_texthelp_panels_with_groups	formattergrouppanel
panel_docsr   r   sub_command_chainsub_heading_levelsub_help_formatsub_descriptionsub_desc_text	sub_usageusage_heading_levelsub_usage_text
sub_panelspanel_heading_levelsub_formatter	sub_group	sub_panelesub_panel_docsnested_name
nested_appnested_chainnested_heading_levelnested_docsbody_contentcssdocs2                                                     r   rK   rK   ?  s   \ <  E 67 88A;r-(;E7#m_TUVW (5=##((1+xx.j#((=+<"=!>?	OO%--c37	89uYK/MkZfNgMhhr  tA  sB  BC  D	

 --''@R'SK"66sHK d3	LL8Y9O8PPVWX Mcmm6712V5~QGWX **3/Er-!+,Ima6G5HJK01eS!!J%eT2J%77
MZ]^
*;z+B*C6JKX "77KH #a'%#	I OO/u%

,@@WEM===dD%( 0 %%'--/JZ  }}},==cRLD& 0 D D]TXZb c  $1!$1A$5! LL<= ()A- *Achh'8'<=>?EEG z4&)//1 
 LL&'uYK7UVabebjbjk|b}V~U  @J  K\  J]  ]^  _
 !!6(+"("2"2":":=S^":"_"2"F"Fv"_"$0$$GM$'HUbIcHddj%kl -::6B	'.;a.?+.;a.?+LL2&9%:)DWCXXY!Z[LL!<=!)S11)2)5i)F%5%G%GXiru%vNLL#6{>7R6SSY!Z[LL* !'!=!=b/!RJ (.;a.?+.;a.?+$1&9'5!)&7	%M 1;,	9-)INN$- *3):):
1):A$%GG(+ ,&12,& )&	 !"):
1I- %,,,)$i@# 1;& &3%=%=%?%E%E%GN%^4 !1!13C3T3TU[]k3l/Z'7'K'KL]_jlt'u+3@03@13D0&8&&/+9*>','+*6).-=
' [1) 4mE ,r UVLL&e Sj \" X 99U#L &jK
 !" #    
[
1] ,+s,   *F_6_
_
_#C__
_)	)r   )TFr   TNNTF)__doc__typingr   cyclopts._markupr   r   cyclopts.docs.baser   cyclopts.corer   listr>   boolintr   rL   rK    r   r   <module>ry      s   6   6 /! '9'	' ' 	'
 ' ' 
'8Tr  !&*"Z	ZZ Z 	Z
 Z d
Z 9t#Z Z Z 	Zr   