From 655d5c76ba5cb82de4b0d4a0126344cf762a5584 Mon Sep 17 00:00:00 2001 From: daylinmorgan Date: Mon, 15 May 2023 01:29:41 +0000 Subject: [PATCH] deploy: ce8ea8c1731dcbaad062207f25fd094edf7ca9f3 --- index.html | 15 ----- rich-diff/index.html | 25 ++------ search/search_index.json | 2 +- sitemap.xml | 6 +- sitemap.xml.gz | Bin 226 -> 226 bytes themes/index.html | 15 ----- themes/list.svg | 128 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 137 insertions(+), 54 deletions(-) create mode 100644 themes/list.svg diff --git a/index.html b/index.html index 95dfc47..4f4819b 100644 --- a/index.html +++ b/index.html @@ -571,21 +571,6 @@ You may also use the environment variable YARTSU_THEME.

For both practical and stylistic reasons the underlying code used to generate the SVG is slightly different than rich's default save_svg method. See here for the current deviation between the latest releases of each respective release.

-
-
- - - Last update: - May 14, 2023 - -
- Created: - June 14, 2022 - - -
-
- diff --git a/rich-diff/index.html b/rich-diff/index.html index 0874d88..db676cd 100644 --- a/rich-diff/index.html +++ b/rich-diff/index.html @@ -405,11 +405,11 @@

Versions

CONSOLE_SVG_FORMAT Diff

-
--- 
-+++ 
+
---
++++
 @@ -1,5 +1,5 @@
 -<svg class="rich-terminal" viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg">
 -    <!-- Generated with Rich https://www.textualize.io -->
@@ -440,8 +440,8 @@
      {matrix}
 

Console.export_svg Diff

-
--- 
-+++ 
+
---
++++
 @@ -70,9 +70,9 @@
          line_height = char_height * 1.22
 
@@ -469,21 +469,6 @@
 

AUTO-GENERATED by scripts/rich-diff

-
-
- - - Last update: - May 14, 2023 - -
- Created: - June 15, 2022 - - -
-
- diff --git a/search/search_index.json b/search/search_index.json index a3ee111..6d33abe 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Yartsu","text":"

yartsu, another rich terminal screenshot utility

Documentation

NOTE: this is a currently in a beta release and the API is subject to change (feedback welcome)

Inspired by recent commits in the wonderful library rich I decided to write yartsu.

I needed to programmatically generate screenshots for documentation purposes. The new export_svg methods in rich were a godsend. So I wanted to try to make this feature a little more generalizable to program output outside of rich/python. Hopefully, you find it useful.

If you come across anything unexpected please submit an issue.

"},{"location":"#install","title":"Install","text":"
pipx install yartsu\n# OR\npip install yartsu\n
"},{"location":"#releases","title":"Releases","text":"

There is a standalone binary available for linux in the releases (Support for additional platforms is planned).

Optionally install with eget:

eget daylinmorgan/yartsu\n

Otherwise you can download an extract manually to somewhere on your path.

"},{"location":"#usage","title":"Usage","text":"

Getting a properly formatted output from a terminal screenshot is challenging.

There are three options for generating a screenshot.

If one of the below option causes you any headaches consider first trying a different option.

"},{"location":"#option-1-pipes","title":"Option 1: Pipes","text":"

Many tools that color output (i.e. grep or ls) additionally allow you to force ANSI color codes to be included even when piping output.

In these cases you can simply pipe the output directly into yartsu

ls --color=always | yartsu -w 50 -o assets/ls_color.svg\n
"},{"location":"#option-2-subprocesspty","title":"Option 2: Subprocess/Pty","text":"

With this option yartsu will deploy a subprocess and pty to run your command for you in an attempt to preserve ANSI.

Note with this option you need to separate the command you want to run with yartsu args using --.

yartsu -w 50 -o assets/ls_color.svg -- ls --color /\n
"},{"location":"#option-3-text-file","title":"Option 3: Text File","text":"

Finally, if you neither of the above options work and you can manage to preserve the codes in a plain text file you can pass this as input to yartsu.

ls --color > ls.txt\nyartsu -w 50 -i ls.txt -o assets/ls_color.svg\n

By default svgs will be saved at ./capture.svg.

Additionally, for options 1 and 3 you may want to define your own title with -t/--title. For option 2 the title will by default be the cmd ran by yartsu.

"},{"location":"#themes","title":"Themes","text":"

There are a number of themes you can use to style output. Use yartsu --list-themes to see the available options. Then you can specify the theme you want with --theme, i.e. yartsu --theme rich_default. You may also use the environment variable YARTSU_THEME.

See here a preview of the available themes

"},{"location":"#differences-from-rich","title":"Differences from Rich","text":"

For both practical and stylistic reasons the underlying code used to generate the SVG is slightly different than rich's default save_svg method. See here for the current deviation between the latest releases of each respective release.

"},{"location":"rich-diff/","title":"Deviation From Rich","text":""},{"location":"rich-diff/#versions","title":"Versions","text":"
  • Rich: 13.3.5
  • Yartsu: 23.5.1b2.dev27+g7598db8
"},{"location":"rich-diff/#console_svg_format-diff","title":"CONSOLE_SVG_FORMAT Diff","text":"
--- \n+++ \n@@ -1,5 +1,5 @@\n-<svg class=\"rich-terminal\" viewBox=\"0 0 {width} {height}\" xmlns=\"http://www.w3.org/2000/svg\">\n-    <!-- Generated with Rich https://www.textualize.io -->\n+<svg class=\"rich-terminal shadow\" viewBox=\"0 0 {width} {height}\" xmlns=\"http://www.w3.org/2000/svg\">\n+    <!-- Generated with Rich https://www.textualize.io & yartsu https://github.com/daylinmorgan/yartsu -->\n    <style>\n\n    @font-face {{\n@@ -32,6 +32,10 @@\n        font-family: arial;\n     }}\n\n+    .shadow {{\n+        -webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));\n+        filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));\n+    }}\n    {styles}\n     </style>\n\n@@ -43,7 +47,7 @@\n    </defs>\n\n    {chrome}\n-    <g transform=\"translate({terminal_x}, {terminal_y})\" clip-path=\"url(#{unique_id}-clip-terminal)\">\n+    <g transform=\"translate({terminal_x}, {terminal_y}) scale(.95)\" clip-path=\"url(#{unique_id}-clip-terminal)\">\n    {backgrounds}\n     <g class=\"{unique_id}-matrix\">\n     {matrix}\n
"},{"location":"rich-diff/#consoleexport_svg-diff","title":"Console.export_svg Diff","text":"
--- \n+++ \n@@ -70,9 +70,9 @@\n        line_height = char_height * 1.22\n\n        margin_top = 1\n-        margin_right = 1\n-        margin_bottom = 1\n-        margin_left = 1\n+        margin_right = char_width * 5 / 6\n+        margin_bottom = 20 * 5 / 3\n+        margin_left = char_width * 5 / 6\n        padding_top = 40\n         padding_right = 8\n@@ -222,8 +222,8 @@\n                x=terminal_width // 2,\n                 y=margin_top + char_height + 6,\n             )\n-        chrome += f\"\"\"\n-            <g transform=\"translate(26,22)\">\n+        chrome += \"\"\"\n+            <g transform=\"translate(32,22)\">\n            <circle cx=\"0\" cy=\"0\" r=\"7\" fill=\"#ff5f57\"/>\n             <circle cx=\"22\" cy=\"0\" r=\"7\" fill=\"#febc2e\"/>\n             <circle cx=\"44\" cy=\"0\" r=\"7\" fill=\"#28c840\"/>\n

AUTO-GENERATED by scripts/rich-diff

"},{"location":"themes/","title":"Themes","text":"

See below for example outputs of each.

cat-mochacat-macchiatocat-frappecat-lattedraculagruvbox-darkgruvbox-lightnorddimmed_monokaimonokainight-owlishrich-default

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Yartsu","text":"

yartsu, another rich terminal screenshot utility

Documentation

NOTE: this is a currently in a beta release and the API is subject to change (feedback welcome)

Inspired by recent commits in the wonderful library rich I decided to write yartsu.

I needed to programmatically generate screenshots for documentation purposes. The new export_svg methods in rich were a godsend. So I wanted to try to make this feature a little more generalizable to program output outside of rich/python. Hopefully, you find it useful.

If you come across anything unexpected please submit an issue.

"},{"location":"#install","title":"Install","text":"
pipx install yartsu\n# OR\npip install yartsu\n
"},{"location":"#releases","title":"Releases","text":"

There is a standalone binary available for linux in the releases (Support for additional platforms is planned).

Optionally install with eget:

eget daylinmorgan/yartsu\n

Otherwise you can download an extract manually to somewhere on your path.

"},{"location":"#usage","title":"Usage","text":"

Getting a properly formatted output from a terminal screenshot is challenging.

There are three options for generating a screenshot.

If one of the below option causes you any headaches consider first trying a different option.

"},{"location":"#option-1-pipes","title":"Option 1: Pipes","text":"

Many tools that color output (i.e. grep or ls) additionally allow you to force ANSI color codes to be included even when piping output.

In these cases you can simply pipe the output directly into yartsu

ls --color=always | yartsu -w 50 -o assets/ls_color.svg\n
"},{"location":"#option-2-subprocesspty","title":"Option 2: Subprocess/Pty","text":"

With this option yartsu will deploy a subprocess and pty to run your command for you in an attempt to preserve ANSI.

Note with this option you need to separate the command you want to run with yartsu args using --.

yartsu -w 50 -o assets/ls_color.svg -- ls --color /\n
"},{"location":"#option-3-text-file","title":"Option 3: Text File","text":"

Finally, if you neither of the above options work and you can manage to preserve the codes in a plain text file you can pass this as input to yartsu.

ls --color > ls.txt\nyartsu -w 50 -i ls.txt -o assets/ls_color.svg\n

By default svgs will be saved at ./capture.svg.

Additionally, for options 1 and 3 you may want to define your own title with -t/--title. For option 2 the title will by default be the cmd ran by yartsu.

"},{"location":"#themes","title":"Themes","text":"

There are a number of themes you can use to style output. Use yartsu --list-themes to see the available options. Then you can specify the theme you want with --theme, i.e. yartsu --theme rich_default. You may also use the environment variable YARTSU_THEME.

See here a preview of the available themes

"},{"location":"#differences-from-rich","title":"Differences from Rich","text":"

For both practical and stylistic reasons the underlying code used to generate the SVG is slightly different than rich's default save_svg method. See here for the current deviation between the latest releases of each respective release.

"},{"location":"rich-diff/","title":"Deviation From Rich","text":""},{"location":"rich-diff/#versions","title":"Versions","text":"
  • Rich: 13.3.5
  • Yartsu: 23.5.1b2.dev30+gf5ae41d
"},{"location":"rich-diff/#console_svg_format-diff","title":"CONSOLE_SVG_FORMAT Diff","text":"
---\n+++\n@@ -1,5 +1,5 @@\n-<svg class=\"rich-terminal\" viewBox=\"0 0 {width} {height}\" xmlns=\"http://www.w3.org/2000/svg\">\n-    <!-- Generated with Rich https://www.textualize.io -->\n+<svg class=\"rich-terminal shadow\" viewBox=\"0 0 {width} {height}\" xmlns=\"http://www.w3.org/2000/svg\">\n+    <!-- Generated with Rich https://www.textualize.io & yartsu https://github.com/daylinmorgan/yartsu -->\n    <style>\n\n    @font-face {{\n@@ -32,6 +32,10 @@\n        font-family: arial;\n     }}\n\n+    .shadow {{\n+        -webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));\n+        filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));\n+    }}\n    {styles}\n     </style>\n\n@@ -43,7 +47,7 @@\n    </defs>\n\n    {chrome}\n-    <g transform=\"translate({terminal_x}, {terminal_y})\" clip-path=\"url(#{unique_id}-clip-terminal)\">\n+    <g transform=\"translate({terminal_x}, {terminal_y}) scale(.95)\" clip-path=\"url(#{unique_id}-clip-terminal)\">\n    {backgrounds}\n     <g class=\"{unique_id}-matrix\">\n     {matrix}\n
"},{"location":"rich-diff/#consoleexport_svg-diff","title":"Console.export_svg Diff","text":"
---\n+++\n@@ -70,9 +70,9 @@\n        line_height = char_height * 1.22\n\n        margin_top = 1\n-        margin_right = 1\n-        margin_bottom = 1\n-        margin_left = 1\n+        margin_right = char_width * 5 / 6\n+        margin_bottom = 20 * 5 / 3\n+        margin_left = char_width * 5 / 6\n        padding_top = 40\n         padding_right = 8\n@@ -222,8 +222,8 @@\n                x=terminal_width // 2,\n                 y=margin_top + char_height + 6,\n             )\n-        chrome += f\"\"\"\n-            <g transform=\"translate(26,22)\">\n+        chrome += \"\"\"\n+            <g transform=\"translate(32,22)\">\n            <circle cx=\"0\" cy=\"0\" r=\"7\" fill=\"#ff5f57\"/>\n             <circle cx=\"22\" cy=\"0\" r=\"7\" fill=\"#febc2e\"/>\n             <circle cx=\"44\" cy=\"0\" r=\"7\" fill=\"#28c840\"/>\n

AUTO-GENERATED by scripts/rich-diff

"},{"location":"themes/","title":"Themes","text":"

See below for example outputs of each.

cat-mochacat-macchiatocat-frappecat-lattedraculagruvbox-darkgruvbox-lightnorddimmed_monokaimonokainight-owlishrich-default

"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index e7f9eba..8b52e25 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,17 +2,17 @@ https://gh.dayl.in/yartsu/ - 2023-05-14 + 2023-05-15 daily https://gh.dayl.in/yartsu/rich-diff/ - 2023-05-14 + 2023-05-15 daily https://gh.dayl.in/yartsu/themes/ - 2023-05-14 + 2023-05-15 daily \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index fe851129240e6c254a5882404e891cd6fdd2e4c0..e088cdfbaf791235b67234a3984d5705f5a51171 100644 GIT binary patch literal 226 zcmV<803H7yiwFn=i(zB}|8r?{Wo=<_E_iKh0L_v?4#FT1MfaYfVPB?dOw>@^c>+BE z0a{2XR0gfRy;P0q)`f|G1M~U$d6~ct_s$hJ9nl6~lO?T4p}h>s`nD$L)3Mx=17EOf zbf{C2!yap5QtI~r!!S^^Nq3@08e$75O&$>5CRB7s_@c;~3SPITm@Qm^8w-x{3P2m9TDPFmqlU@B#S_DOzbt cWt-+7;Zk0^#@~}YkNgk#184KobTH7QAjxF&88sTQJwOhAJ^Q zYCQ}hCcFZJ@qHQ>n7W|&qFOA=YF*A(Ir8=Qvbrbc4D`DNhVB)+u-~;jP c$~MhE!lk@+jlU;*9{C^e2a-eKi8lfO0N4&^WB>pF diff --git a/themes/index.html b/themes/index.html index 3d4cdea..9891bc7 100644 --- a/themes/index.html +++ b/themes/index.html @@ -372,21 +372,6 @@
-
-
- - - Last update: - May 14, 2023 - -
- Created: - June 14, 2022 - - -
-
- diff --git a/themes/list.svg b/themes/list.svg new file mode 100644 index 0000000..4348780 --- /dev/null +++ b/themes/list.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yartsu --list-themes + + + + + + + + + +      Available Themes       +                 ╷          +name          source +╶────────────────┼────────╴ +  cat-mocha      │ yartsu   +  cat-macchiato  │ yartsu   +  cat-frappe     │ yartsu   +  cat-latte      │ yartsu   +  dracula        │ yartsu   +  gruvbox-dark   │ yartsu   +  gruvbox-light  │ yartsu   +  nord           │ yartsu   +  dimmed_monokai │ rich     +  monokai        │ rich     +  night-owlish   │ rich     +  rich-default   │ rich     +                 ╵          + + + +