{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Yartsu","text":"<p> yartsu, another rich terminal screenshot utility </p> <p> Documentation </p> <p></p> <p> </p> <p>NOTE: this is a currently in a beta release and the API is subject to change (feedback welcome)</p> <p>Inspired by recent commits in the wonderful library <code>rich</code> I decided to write <code>yartsu</code>.</p> <p>I needed to programmatically generate screenshots for documentation purposes. The new <code>export_svg</code> methods in <code>rich</code> were a godsend. So I wanted to try to make this feature a little more generalizable to program output outside of <code>rich</code>/<code>python</code>. Hopefully, you find it useful.</p> <p>If you come across anything unexpected please submit an issue.</p>"},{"location":"#install","title":"Install","text":"<pre><code>pipx install yartsu\n# OR\npip install yartsu\n</code></pre>"},{"location":"#releases","title":"Releases","text":"<p>There is a standalone binary available for linux in the releases (Support for additional platforms is planned).</p> <p>Optionally install with <code>eget</code>:</p> <pre><code>eget daylinmorgan/yartsu\n</code></pre> <p>Otherwise you can download an extract manually to somewhere on your path.</p>"},{"location":"#usage","title":"Usage","text":"<p>Getting a properly formatted output from a terminal screenshot is challenging.</p> <p>There are three options for generating a screenshot.</p> <p>If one of the below option causes you any headaches consider first trying a different option.</p>"},{"location":"#option-1-pipes","title":"Option 1: Pipes","text":"<p>Many tools that color output (i.e. <code>grep</code> or <code>ls</code>) additionally allow you to force ANSI color codes to be included even when piping output.</p> <p>In these cases you can simply pipe the output directly into <code>yartsu</code></p> <pre><code>ls --color=always | yartsu -w 50 -o assets/ls_color.svg\n</code></pre>"},{"location":"#option-2-subprocesspty","title":"Option 2: Subprocess/Pty","text":"<p>With this option <code>yartsu</code> will deploy a <code>subprocess</code> and <code>pty</code> to run your command for you in an attempt to preserve ANSI.</p> <p>Note with this option you need to separate the command you want to run with <code>yartsu</code> args using <code>--</code>.</p> <pre><code>yartsu -w 50 -o assets/ls_color.svg -- ls --color /\n</code></pre>"},{"location":"#option-3-text-file","title":"Option 3: Text File","text":"<p>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 <code>yartsu</code>.</p> <pre><code>ls --color > ls.txt\nyartsu -w 50 -i ls.txt -o assets/ls_color.svg\n</code></pre> <p>By default svgs will be saved at <code>./capture.svg</code>.</p> <p>Additionally, for options 1 and 3 you may want to define your own title with <code>-t/--title</code>. For option 2 the title will by default be the cmd ran by <code>yartsu</code>.</p>"},{"location":"#themes","title":"Themes","text":"<p>There are a number of themes you can use to style output. Use <code>yartsu --list-themes</code> to see the available options. Then you can specify the theme you want with <code>--theme</code>, i.e. <code>yartsu --theme rich_default</code>. You may also use the environment variable <code>YARTSU_THEME</code>.</p> <p>See here a preview of the available themes</p>"},{"location":"#differences-from-rich","title":"Differences from <code>Rich</code>","text":"<p>For both practical and stylistic reasons the underlying code used to generate the SVG is slightly different than <code>rich</code>'s default <code>save_svg</code> method. See here for the current deviation between the latest releases of each respective release.</p>"},{"location":"rich-diff/","title":"Deviation From Rich","text":""},{"location":"rich-diff/#versions","title":"Versions","text":"<ul> <li>Rich: 13.3.5</li> <li>Yartsu: 23.5.1b2.dev30+gf5ae41d</li> </ul>"},{"location":"rich-diff/#cons