Comments (11)
My use case is much simpler, all I want is a static SVG screenshot of a terminal (that will scale nice vs an ordinary SVG) for the docs of a CLI I am writing. I don't need a play button, nor an animated recording. Is it possible to do that?
The only way I can see this be included in termtosvg is under the form of an option that would dump all the frames of the animations in SVG format into a directory. You would then have to pick the one you want. How does that sound?
from termtosvg.
I've implemented a new CLI option to enable rendering of individual frames: 6ea3f67
It works like this:
(.venv) nico ~/termtosvg $ termtosvg -s
Recording started, enter "exit" command or Control-D to end
nico ~/termtosvg $ echo "my super cool recording"
my super cool recording
nico ~/termtosvg $ exit
exit
Rendering ended, SVG frames are located at /tmp/termtosvg_bfezf0lw
(.venv) nico ~/termtosvg $ ls /tmp/termtosvg_bfezf0lw
termtosvg_00000.svg termtosvg_00013.svg termtosvg_00026.svg
termtosvg_00001.svg termtosvg_00014.svg termtosvg_00027.svg
termtosvg_00002.svg termtosvg_00015.svg termtosvg_00028.svg
termtosvg_00003.svg termtosvg_00016.svg termtosvg_00029.svg
termtosvg_00004.svg termtosvg_00017.svg termtosvg_00030.svg
termtosvg_00005.svg termtosvg_00018.svg termtosvg_00031.svg
termtosvg_00006.svg termtosvg_00019.svg termtosvg_00032.svg
termtosvg_00007.svg termtosvg_00020.svg termtosvg_00033.svg
termtosvg_00008.svg termtosvg_00021.svg termtosvg_00034.svg
termtosvg_00009.svg termtosvg_00022.svg termtosvg_00035.svg
termtosvg_00010.svg termtosvg_00023.svg termtosvg_00036.svg
termtosvg_00011.svg termtosvg_00024.svg termtosvg_00037.svg
termtosvg_00012.svg termtosvg_00025.svg termtosvg_00038.svg
(.venv) nico ~/termtosvg $
Basically you get all frames of the animation stored in a directory. If you specify the -s
flag you only get still frames though, no animated SVG. If you want both an animated SVG and still frames you'll have to do it in three steps:
termtosvg record recording.cast
termtosvg render recording.cast animation.svg
termtosvg render recording.cast still_frames/ -s
I've added a new template with a play button in the middle of the screen: https://github.com/nbedos/termtosvg/blob/6ea3f6790d07ecb0090e5daa38abfc207f279659/termtosvg/data/templates/gjm8_play.svg
So those of you that wanted to add a play button to a screenshot just have to specify the right template with the -t
switch : termtosvg -s -t gjm8_play
. I'll probably make similar templates for other color schemes.
Let me know what you all think.
from termtosvg.
Thanks for the (detailed!) feature request.
There probably should be a way to dump every frame of the animation in SVG format so that you can get a "screenshot", I agree with you on that.
I'm not sure about the "play button" though, but I'll definitely consider it. Overlaying a triangle on an SVG image is quite easy to do by hand, so is it worth adding a way to do this with termtosvg? I get that not everyone wants to spend time fiddling with SVG code and that having a tool that just works is great, but it is a very specific feature.
Maybe we could find a feature that would cover this use case but also many others? Would overlaying a random image on a still capture of the animation be useful? It could be used to overlay an image with the logo of your own app and a play button on top of the first frame of the animation? Of course it means the user provides the SVG image themselves.
from termtosvg.
Overlaying a triangle on an SVG image is quite easy to do by hand, so is it worth adding a way to do this with termtosvg?
It was just a suggestion as I am not familiar with svg syntax. If you can suggest an add-on miniscript to do this in a Wiki or even this issue, that would be great!
Would overlaying a random image on a still capture of the animation be useful?
That would be useful. I just wonder how that would deal with arbitrary terminal sizes? If that unnecessary complicates your job just for this one request, you can skip the overlaying portion of this request.
Summary:
- Have termtosvg output a "screenshot" image (probably a random frame from the whole recording?)
- Optionally provide user-instructions to overlay that "screenshot" with play button, or may be user-defined text like "Click this image to see the animation".
- Optionally support overlaying user-provided svg.. though I am not sure how that will work with arbitary terminal sizes.
from termtosvg.
My use case is much simpler, all I want is a static SVG screenshot of a terminal (that will scale nice vs an ordinary SVG) for the docs of a CLI I am writing. I don't need a play button, nor an animated recording. Is it possible to do that?
from termtosvg.
It would also be great if that static SVG worked in browsers too that don't support SVG animations (i.e. Edge)
from termtosvg.
The only way I can see this be included in termtosvg is under the form of an option that would dump all the frames of the animations in SVG format into a directory. You would then have to pick the one you want.
That sounds reasonable.
from termtosvg.
This would be very useful, including play button.
Rational: I don't want to distract the reader of my README, so play only when one clicks on it. I think this should even be default setting.
from termtosvg.
Feature released as part of 0.8.0.
from termtosvg.
/tmp > termtosvg render recording.cast -s still_frames/
usage: termtosvg render input_file [output_path] [-m MIN_DURATION]
[-M MAX_DURATION] [-s] [-t TEMPLATE] [-h]
termtosvg: error: unrecognized arguments: still_frames/
Edit: Works if you use the positioning shown by the usage information.
from termtosvg.
@polyzen Thanks for pointing this out. The usage information is correct, I've edited my comment.
from termtosvg.
Related Issues (20)
- With CSS animation one frame can bleed into the previous frame HOT 3
- Generate ligature glyphs. HOT 1
- Optimize SVG output HOT 2
- Suggestion: Width 100% HOT 2
- Color issues and configuration HOT 12
- Remove "exit" from svg animation HOT 8
- Color issues in bold text in version 1.0.0
- Add support for ttyrec recording format
- jerky frames when viewing with Safari HOT 4
- Allow invocation through runpy HOT 1
- homepage svg doesn't play on safari HOT 6
- Firefox: slider in window_frame_js template misplaced and moving to the wrong direction, when SVG is in an HTML file HOT 1
- JavaScript themes without JavaScript enabled
- Cutting frames from resulting SVG
- Template window_frame_js does not work in GitHub HOT 1
- Can I install TermToSVG on Windows?
- Blink does not blink
- Idle timeout expected as int, but is float HOT 3
- Capture and preserve xterm title sequences. HOT 1
- build standalone binary HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termtosvg.