The reason I built this was that I was unable to find a tool to convert Windows Terminal's output to SVG (not a animated SVG, just a screenshot).
Since one can copy Windows Terminal's output as HTML code, I tried to find some tools to convert HTML to SVG. But I can't find any either.
By the way, Asciinema can record CLI output in its own format, and it can save its recordings as 'raw' format, in which I guess are some escape sequences. Maybe one can choose to convert those sequence to SVG.
Update: I found something that might be seful:
Anyway, I wrote a stupid Python script, which may convert the HTML code copied from Windows Terminal, to a SVG format.
One may install Beautiful Soup and
lxml
to run the script.
The input should be like:
<p>First Line</p>
<p>Second line <span style="color: rgb(122, 122, 122);">with some styled text in it.</span> </p>
And the output should be like:
<svg width="720" height="120" xmlns="http://www.w3.org/2000/svg">
<style>text { font-family: Consolas,"Courier New",monospace; font-weight: 400; font-size: 20px; fill: #CCCCCC; }</style>
<rect x="0" y="0" width="720" height="120" fill="#222A35"/>
<text x="25" y="50">First Line</text>
<text x="25" y="75">Second line <tspan style="fill: rgb(122, 122, 122);">with some styled text in it.</tspan> </text>
</svg>