Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_export_format.py77 linesDownload Raw Back to rich
1CONSOLE_HTML_FORMAT = """\2<!DOCTYPE html>3<html>4<head>5<meta charset="UTF-8">6<style>7{stylesheet}8body {{9    color: {foreground};10    background-color: {background};11}}12</style>13</head>14<body>15    <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"><code style="font-family:inherit">{code}</code></pre>16</body>17</html>18"""19 20CONSOLE_SVG_FORMAT = """\21<svg class="rich-terminal" viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg">22    <!-- Generated with Rich https://www.textualize.io -->23    <style>24 25    @font-face {{26        font-family: "Fira Code";27        src: local("FiraCode-Regular"),28                url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2") format("woff2"),29                url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff") format("woff");30        font-style: normal;31        font-weight: 400;32    }}33    @font-face {{34        font-family: "Fira Code";35        src: local("FiraCode-Bold"),36                url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2") format("woff2"),37                url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff") format("woff");38        font-style: bold;39        font-weight: 700;40    }}41 42    .{unique_id}-matrix {{43        font-family: Fira Code, monospace;44        font-size: {char_height}px;45        line-height: {line_height}px;46        font-variant-east-asian: full-width;47    }}48 49    .{unique_id}-title {{50        font-size: 18px;51        font-weight: bold;52        font-family: arial;53    }}54 55    {styles}56    </style>57 58    <defs>59    <clipPath id="{unique_id}-clip-terminal">60      <rect x="0" y="0" width="{terminal_width}" height="{terminal_height}" />61    </clipPath>62    {lines}63    </defs>64 65    {chrome}66    <g transform="translate({terminal_x}, {terminal_y})" clip-path="url(#{unique_id}-clip-terminal)">67    {backgrounds}68    <g class="{unique_id}-matrix">69    {matrix}70    </g>71    </g>72</svg>73"""74 75_SVG_FONT_FAMILY = "Rich Fira Code"76_SVG_CLASSES_PREFIX = "rich-svg"77 
codekingpro/portable-devtools · Team Ai