Live data from Hacker News

Show HN: Termtosvg – Record terminal sessions as SVG animations

github.com

71–80 of 84 posts

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#71
post #32

Earlier quoted context omitted.

W3C should have a rule that a web browser which does not intend to support the standard may not call itself a "web browser".

I'm pretty sure no browser supports 100% of SVG spec.

The least to say. SVG support is abysmal in many browsers. PDF support in browsers seems to be much more complete, even though it's much more complex.

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#72
post #31
post #21

This is pretty awesome. I'm a big fan of both SVG animations and terminal recorders, so this is right up my alley. I previously built a small library called svganimator for creating smooth animations between static SVG images [1], used generated SVG animations to help design the Wayback Machine loading animation [2], and also put together a fairly comprehensive comparison of terminal recording solutions [3]. I'll nee…

OP here. Sadly, SVG file size is not as small as I'd want it to be. The main problem is that a few attributes (x, y and lengthAdjust) have to be repeated on each text tag to position each character at the right place. I can't use CSS for this since those attributes are not styling attributes. Using SVG definitions efficiently to avoid duplication is also not as easy as I thought it would be. I have a few ideas on how…

it's actually possible to reduce duplication in this case with the element, see this example;

https://jsfiddle.net/2kc6tqy1/2/

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#73
post #13

What're people using tools like this for? I see the usage surely when demonstrating something in the terminal - and many times used for showcasing projects and tools. Are you using the recordings for other purposes, like to document work and share progress with your team + manager for instance for work you're doing during a sprint (good for demo'ing things at the end of the sprint too).

The most obvious example is small videos of terminal. That is to say, better quality than GIF and smaller size than MP4 and the like. SVG is also lossless.

One thing you could do with this is making SVGs from applications such as htop (or _any_ terminal application), and then serving those over WWW. You can then view those in a web browser by going to a certain date (some HTML/JS would be used to neatly organize them in a good UI, or allowing things such as looping and going forward or backward, but you could also use data analysis on the SVGs).

Sure, you could export log data and then use MRTG/RRDTool or something like that and it'd work just as well. My point is that you need support for that (via e.g. SNMP); with Termtosvg you abstract all terminal applications.

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#74
post #56
post #21

This is pretty awesome. I'm a big fan of both SVG animations and terminal recorders, so this is right up my alley. I previously built a small library called svganimator for creating smooth animations between static SVG images [1], used generated SVG animations to help design the Wayback Machine loading animation [2], and also put together a fairly comprehensive comparison of terminal recording solutions [3]. I'll nee…

My first thought was "this seems neat", and my second thought was: how hard would it be to write a small js script to play back "script"[s] output? Or, to take script output, convert it to some pre-tags and add js animation on top of that... I suppose the main barrier would be lack of recorded timing information in script logs, so either pre-procesding or pause for input (say 50ms/keystroke + 200ms pr return/line-fee…

I did that in another way: write a demo script, and make it execute in another terminal. Snippet on GitLab [1].

Simply call it with "shell-demo DEMO_SCRIPT", and follow the instructions.

Demo scripts examples are given aside the snippet.

[1]: https://gitlab.com/snippets/1730340

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#75
Sadly, I will not replace asciinema+svg-term-cli by termtosvg, because termtosvg takes the terminal size into account when recording, not when rendering. It means that I have to resize my terminal before recording, and that I will not be able to resize it differently for rendering. So if lines are wrapped, I cannot change the width to de-wrap them in the resulting SVG.

Asciinema does not care about your terminal size when recording. In fact you can even reduce it or hide it (if you automate the input). Then you render it with svg-term-cli with the width you feel it is best.

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#76
post #26

Earlier quoted context omitted.

Jesus, it's 2018 and they still can't even figure out how to implement animated PNGs? Real browsers had this 10 years ago. What the hell is wrong with Microsoft? Are they really just so incompetent, or is there a more insidious business reason why they don't want more animated formats on the web?

SMIL is something quite different and much more complex, than "animated PNGs"

I know. I just saw APNG when scrolling down in that list and was surprised to see it still not figured out.

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#77
post #26

The primary casualty of using SVG animations is IE/Edge support; SMIL is not currently planned: https://developer.microsoft.com/en-us/microsoft-edge/platfor... . It would be good to adjust the failure mode so that if SMIL is not supported then at least a meaningful frame (probably the last, though scrolling makes it difficult to decide!) is shown, rather than just a blank rectangle.

Jesus, it's 2018 and they still can't even figure out how to implement animated PNGs? Real browsers had this 10 years ago. What the hell is wrong with Microsoft? Are they really just so incompetent, or is there a more insidious business reason why they don't want more animated formats on the web?

Firefox had (and pioneered) APNG ten years ago. Safari added APNG support four years ago. Chrome only got APNG just over a year ago.

Re: Show HN: Termtosvg – Record terminal sessions as SVG animations

#79
post #78

You could differentiate more from asciinema by building editing tools around the recording (like cutting or embedding the recording in stock frames like in https://shotsnapp.com )

Have a look here also: https://github.com/cirocosta/asciinema-edit
Post reply on HN