
    !<iF                         d Z ddlmZ ddlmZmZ ddlmZ erddlm	Z	 	 dde
e         ddd	ed
edededdfdZdZ	 	 	 	 	 	 	 	 dddded	ededededz  de
e         dz  dededefdZdS )z0HTML documentation generation for cyclopts apps.    )TYPE_CHECKING)escape_htmlextract_text)BaseDocGenerator)Applinesappr   include_hiddenapp_nameprefixdepthreturnNc           
         |j         sdS t          j        ||          D ]\  }}|r| | n|}| d|                    dd                                           }	d|dz   z  }
|                     |
 d|	 d| d           |j         rJ|                     |
 d	           t          | |||| d|dz              |                     |
 d
           |                     |
 d           dS )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              /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/cyclopts/docs/html.pyr   r      sF    = (9#~NN ' 'f,2<&($(((BB,"6"6sC"@"@BBHHJJ	#RRiRRRRRSSS 	-LLF***+++ufnh<HZHZHZ\ade\efffLLF+++,,,%%%&&&&' '    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;
}
TFr   	recursiveheading_level
standalone
custom_csscommand_chaingenerate_tocflatten_commandsc	                 T   ddl m}	 |g }g }
|s|s|
                    d           |s1| j        d         }|}|}|
                    d| d| d| d           n|r|d         n| j        d         }d	                    |          }| d
d
                    |dd                    }|                                                    d	d
          }|
                    d           |
                    d| d| dt          |           d| d	           | j        	                    dd          }t          j        | |          }|r8t          |d          }|r&|
                    dt          |           d           |r|s| j        r}|
                    d           |
                    d           |
                    d           t          |
| ||dd           |
                    d           |
                    d           t          j        |           }|r|
                    d|dz    d|dz    d           |
                    d           t!          |t"                    r|}nt          |d          }t          j        ||d          }|
                    dt          |           d           |
                    d           |                     g |          } |	|dz   |||           }|                                 |D ]A\  }}|s
|r|j        s|st          j        ||          |_        |j        r |dd|           B|                                                                }|r|
                    |           | j        rt          j        | |          D ]\  }}t          j        |||          }|r|}n|dz   }|
                    d           t9          |          dk    r4| d
d
                    |dd                                                    n| d
|                                 }|
                    d| d| dt          d	                    |                     d| d	           |                    |g          5  |j        	                    d|          }t          j        ||          }|r8t          |d          }|r&|
                    d!t          |           d           t          j        |          } | r|r|dz   }!n|d"z   }!|
                    d|! d|! d           |
                    d           t!          | t"                    r| }"nt          | d          }"t          j        |"|d          }"|
                    dt          |"           d           |
                    d           |r|                    g |          }#|r|dz   }$n|d"z   }$ |	|$|||           }%|#D ]=\  }&}'|s
|&r|&j        s|sd# |'j        D             |'_        |'j        r |%dd|'           >|%                                                                }(|(r|
                    |(           |ro|j        rht          j        ||          D ]R\  })}*t          j        ||)|          }+|r|},n|d"z   },t;          |*|||,d$d|+d$|%	  	        }-|
                    |-           Sddd           n# 1 swxY w Y   |r|
                    d&           |
                    d'           |r|
                    d'           |s|s|
                    d           d(                    |
          }.|r&|r|nt<          }/d)t          |           d*|/ d+|. d,}0|0S |.S )-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                 \    g | ])}|j         rt          d  |j         D                       '|*S )c              3   v   K   | ]4}|                     d           p|                     d          p|dk    V  5dS )z--helpz	--versionz-hN)
startswith).0ns     r   	<genexpr>z0generate_html_docs.<locals>.<listcomp>.<genexpr>  s_       ,& ,&,- )*X(>(>(h!,,{B[B[(h_`dh_h,& ,& ,& ,& ,& ,&r   )namesall)r3   es     r   
<listcomp>z&generate_html_docs.<locals>.<listcomp>  sb     
1 
1 
1$%$%G	
1
 ), ,& ,&12,& ,& ,& )& )&
1 !
1 
1 
1r   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generate_html_docsDEFAULT_CSS)1r	   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sub_panel_docsnested_name
nested_appnested_chainnested_heading_levelnested_docsbody_contentcssdocs1                                                    r   rM   rM   ?  s`
   \ <;;;;;  E  8 86777  
8A;V-VVEVVmVVVWWWW (5E=###(1+xx..??#((=+<"="=??	OO%%--c377	8999 D  D  DY  D  DkZfNgNg  D  D  tA  D  D  D	
 	
 	

 -''@R'SSK"6sKHHK Y d33	 	YLLWY9O9OWWWXXX  M cm 67771222V5#~xQGGGWX *3//E 	J-!+JJma6GJJJKKK0111eS!! 	3JJ%eT22J%7
MZ]^^^
J;z+B+BJJJKKKX "77KHH #a'%#	  I OO/ ) )u 	% 	
 	 	X,@WWEM= 	)IdD%(((%%''--//J !Z    } t',=c>RR r	' r	'LD& 0 D]TXZb c c   6$1!!$1A$5! LL<=== ())A-- ??chh'8'<==??EEGGG ))4))//11 
 LL _&  _  _Y  _  _Vabebjbjk|b}b}V~V~  _  _  K\  _  _  _  
 !!6(++ V2 V2"("2":":=S^":"_"_"2"Fv"_"_" m$0$$G$GM$ m%kUbIcIc%k%k%klll -:6BB	 +' @.;a.?++.;a.?+LL!Z&9!Z!ZDW!Z!Z!Z[[[LL!<===!)S11 G)2)5i)F)F%5%GXiru%v%v%vNLL!Z{>7R7R!Z!Z!Z[[[LL***  $5!'!=!=b/!R!RJ ( @.;a.?++.;a.?+$1M&9'5!)&7	% % %M 1; A A,	9- %) %IN %$- 
1 
1)2):
1 
1 
1I- %, A)M$i@@@%2%=%=%?%?%E%E%G%GN% 5^444  2!1 23C3TU[]k3l3l 2 2/Z'7'KL]_jlt'u'u+ E3@003@13D0&8&&/+9*>','+*6).-=
' 
' 
' [1111mV2 V2 V2 V2 V2 V2 V2 V2 V2 V2 V2 V2 V2 V2 V2r  WUVVVLL&&&&  #\"""   X 99U##L  &7jjK
 !!       
s   I\\		\	)r   )TFr   TNNTF)__doc__typingr   cyclopts._markupr   r   cyclopts.docs.baser   cyclopts.corer   listrB   boolintr   rN   rM    r   r   <module>rz      s   6 6             6 6 6 6 6 6 6 6 / / / / / / "!!!!!! ' '9'	' ' 	'
 ' ' 
' ' ' '8Tr  !&*"Z Z	ZZ Z 	Z
 Z d
Z 9t#Z Z Z 	Z Z Z Z Z Zr   