-
Notifications
You must be signed in to change notification settings - Fork 436
Introducing SVG animation templates #53
Comments
I think you can avoid using getAttribute and setAttribute and simply use the property, for example: Is there a PR that I can add comments on each line? |
Thanks for taking a look. Yes, I've just created #54 |
Prefer to not hardcode locations, even if they're backed by environments like I wouldn't even hardcode any templates whatsoever in the code. Otherwise this sounds like a great simple and general solution. |
I would like to provide something that just works. Currently (well, the code is in the feature/animation_UI branch for now) termtosvg creates That's also why color themes are included in the configuration file: You get a bunch of color themes so that you can pick one and easily alter it if needed. Would you rather not have a default configuration directory for termtosvg and provide the theme and template yourself? |
Yeah, I think having The usual way this problem is solved is to have the project (typically) provide a I'm not entirely convinced a simple tool like this needs to bloat itself with "just works" features (which often don't "just work" in my experience due to the additional failure points the complexity brings). Personally Edit: PS: In my experience user-friendly ideals tend to become the most anti-user approaches in the long run because it hijacks their agency to find solutions via unintended means. See http://contemporary-home-computing.org/turing-complete-user/ |
Thanks for the thoughtful reply and the interesting essay!
Yes, placing templates in a location such as
You're right, the configuration file does not seem to be that useful and I could probably remove it. Now that termtosvg works with templates I'm thinking that I could also replace themes by CSS classes defined inside the template. The
Agreed! |
The placement of these files would usually be done as part of distribution packaging. |
I've just released version 0.5.0. Hope you'll enjoy it! |
Cool! |
Nicely done, the loss of dependencies like svgwrite is very welcome, imo. I'm not sure what you're going to do with the manuals but I've converted (I have also done it in mandoc here, but I wouldn't recommend mandoc. You might as well just use a proper semantic mark up if you choose that path.) |
I agree, and lxml is much better suited to my needs anyway.
Thanks, I'll include this page! I'll try to convert temtosvg-template.md too. At first I wanted to use Sphinx to get the manual pages in both groff and HTML or Markdown but I could not get a manual page that looked right in both formats, so I quit using Sphinx and just wrote it in Markdown. I hope we'll see clever uses of templates. For example, people using rare fonts could encode them in base64 and embed them in a style sheet in the template. It's not a solution for #14 yet but it's a start! |
While I prefer *roff (because like latex, it's a proper typesetter) I do appreciate the need for a more flexible, or at least modern format. youtube-dl uses markdown (generated from its README) which is then passed through pandoc to generate the man page: https://github.com/rg3/youtube-dl/blob/master/Makefile#L90-L93 $(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md
pandoc -s -f $(MARKDOWN) -t man youtube-dl.1.temp.md -o youtube-dl.1
rm -f youtube-dl.1.temp.md While pandoc itself is a pretty heavy dependency it is pretty much the best document conversion tool available. Writing the |
There is a little bug with the window_frame_js the play/pause status gets broken if you resume play clicking anywhere on the window (instead of play/pause button). This gorgeous otherwise. |
I'm currently adding support for SVG templates. Basically a template is a skeleton SVG file where termtosvg will embed the animation it produces. Templates make it possible to add a window frame to the animation, or to add custom Javascript code to control the animation (think play, pause, seek...).
Here's an example of an animation rendered with a template : https://cdn.rawgit.com/nbedos/termtosvg/43a7d461fa7eef86207759515cfe7d8f8897b48a/examples/awesome_js.svg
Usage is as simple as
termtosvg --template my_template
wheremy_template
refers to a SVG file located in~/.config/termtosvg/templates
.I have a question and a request:
Question: What templates would you like to see included in termtosvg? Right now I'm thinking:
Any other ideas? Maybe some neat terminal UI you'd like to see included?
Request: I suck at Javascript, so I'd be grateful if someone could review the script portion of this file.
Thanks!
Pinging @ylmrx @styfle @marcelo477 @leonklingele @knktc @vuuv @kaushalmodi @andyone @Earnestly @PetterS @zac-garby @bjd2385 @stevepeak
The text was updated successfully, but these errors were encountered: