
    Ki                     d    d dl Z d dlZd dlmZ d dlmZ d dlmZ d Zd Z	d Z
edk(  r e
        yy)	    N)Console)RestructuredText)TerminalThemec                     | ||fS )a  
    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      ]/home/jay/workspace/scripts/.codegraph-venv/lib/python3.12/site-packages/rich_rst/__main__.pyrgbr      s    $ q!9    c                     t        j                  d      } | j                  ddd       | j                  ddd	d
dd       | j                  dddt        dd       | j                  ddt        ddd       | j                  ddt        ddd       | j                  ddd t        d!d"       | j                  d#d$t        d%d&d'       | j                  d(d)d*d
d&d+       | j                  d,d-d
d.d&d/0       | j                  d1d2d
d3d&d40       | j                  d5d6t        d7d8d9       | j                  d:d;d
d<d&d=0       | j                         S )>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                  ^   t               } t        t        ddd      t        ddd      t        ddd      t        ddd      t        dd	d
      t        dd	d      t        ddd      t        ddd      t        ddd      t        ddd      gt        ddd      t        ddd      t        dd	d
      t        dd	d      t        ddd      t        ddd      t        ddd      t        ddd      g      }d| j                   d}t	        | j
                  | j                  t        | j                              }| j                  dk(  rt        j                  j                         n/t        | j                  d| j                        j                         }t        || j                   | j"                  | j$                  | j&                   | j                  dk7  r| j                  nd      }|j)                  || j*                         | j                  r|j-                  | j                  ||       yy) 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$,,4JXk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   