
    k7i                     f    S SK r S SKrS SKJr  S SKJr  S SKJr  S rS r	S r
\S:X  a  \
" 5         gg)	    N)Console)RestructuredText)TerminalThemec                 
    XU4$ )z
Function to represent color in RGB format.

Parameters
----------
r : int
    Red color value.
g : int
    Green color value.
b : int
    Blue color value.

Returns
-------
tuple
    A tuple representing the RGB color.
 )rgbs      K/home/james-whalen/.local/lib/python3.13/site-packages/rich_rst/__main__.pyrgbr      s    $ !9    c            	      T   [         R                  " SS9n U R                  SSSS9  U R                  SSS	S
SSS9  U R                  SSS[        SSS9  U R                  SS[        SSSS9  U R                  SS[        SSSS9  U R                  SSS [        S!S"S9  U R                  S#S$[        S%S&S'S9  U R                  S(S)S*S
S&S+S9  U R                  S,S-S
S.S&S/S09  U R                  S1S2S
S3S&S4S09  U R                  S5S6[        S7S8S9S9  U R                  S:S;S
S<S&S=S09  U R                  5       $ )>zParse command line arguments.z4Render reStructuredText to the console with rich-rst)descriptionpathPATHzpath to file, or - for stdin)metavarhelpz-cz--force-colorforce_color
store_trueNzforce color for non-terminals)destactiondefaultr   z-ez
--encodingencodingzutf-8z"encoding for file (default: utf-8))r   typer   r   z-wz--widthwidthz*width of output (default will auto-detect))r   r   r   r   z-hwz--html-width
html_width1675pxz&width of html output (default: 1675px)z-tz--code-theme
code_thememonokaizpygments code themez-htmlz--save-htmlhtml_filenameFzsave to htmlz-rz--wrap	word_wrapzword wrap long linesz-sz--soft-wrap	soft_wrapzenable soft wrapping mode)r   r   r   r   z-glz--guess-lexerguess_lexerzEWhether to guess the lexer for code blocks without specified languagez-dlz--default-lexerdefault_lexerpythonzbThe default lexer for code blocks without specified language if no lexer could be guessed or foundz-hez--hide-errorshide_errorszWhether to hide errors or not)argparseArgumentParseradd_argumentstrint
parse_args)parsers    r   parse_argumentsr.      s   $$1ghF
5ST
oM,`d  lK  L
l#w  ^B  C
ic  UA  B
~ClT\  dL  M
n<cS\cxy
SX]drs
h[W\cyz
mL{\a  iD  E
|-af  nu  v
0sZb  jN  O
|-af  nM  Nr   c                  R   [        5       n [        [        SSS5      [        SSS5      [        SSS5      [        SSS5      [        SS	S
5      [        SS	S5      [        SSS5      [        SSS5      [        SSS5      [        SSS5      /[        SSS5      [        SSS5      [        SS	S
5      [        SS	S5      [        SSS5      [        SSS5      [        SSS5      [        SSS5      /5      nSU R                   S3n[	        U R
                  U R                  [        U R                  5      S9nU R                  S:X  a  [        R                  R                  5       O,[        U R                  SU R                  S9R                  5       n[        UU R                   U R"                  U R$                  U R&                  (       + U R                  S:w  a  U R                  OSS9nUR)                  XPR*                  S9  U R                  (       a  UR-                  U R                  XS9  gg) zThe main function.(   *   6            U   P      {                  y               z    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    <style>
    {stylesheet}
    body {
        color: {foreground};
        background-color: {background};
        max-width: a  
    }
    pre {
        white-space: pre-wrap;       /* Since CSS 2.1 */
        white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
        white-space: -pre-wrap;      /* Opera 4-6 */
        white-space: -o-pre-wrap;    /* Opera 7 */
        word-wrap: break-word;       /* Internet Explorer 5.5+ */
    }
    ::-moz-selection { /* Code for Firefox */
      background: #44475a;
    }
    ::selection {
      background: #44475a;
    }
    </style>
    </head>
    <html>
    <body>
        <code>
            <pre style="font-family:ui-monospace,'Fira Code',Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
        </code>
    </body>
    </html>
    )force_terminalr   record-rt)r   z<stdin>)r   r#   r$   show_errorsfilename)r"   )themecode_formatN)r.   r   r   r   r   r   r   boolr    r   sysstdinreadopenr   r   r   r#   r$   r&   printr"   	save_html)argsDRACULA_TERMINAL_THEMECONSOLE_HTML_FORMATconsolecodersts         r   mainrY   ,   s   D*BBCcBORCS#S#S#S#S#		
 BORCS#S#S#S#S#		
0	 OO$ %!D T%5%5TZZPTUYUgUgPhiG#yyC/399>>T$))TTXTaTa5b5g5g5iD
??$$((((("ii3.IC MM#M0$,,4Jl r   __main__)r'   rM   rich.consoler   rich_rstr   rich.terminal_themer   r   r.   rY   __name__r   r   r   <module>r_      s:     
   % -("ImV zF r   