Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

How to use the resulting SVG on GitHub markdown #61

Closed
ahmetb opened this issue Aug 15, 2018 · 4 comments
Closed

How to use the resulting SVG on GitHub markdown #61

ahmetb opened this issue Aug 15, 2018 · 4 comments

Comments

@ahmetb
Copy link

ahmetb commented Aug 15, 2018

It looks like the SVG in the README of termtosvg uses github.io to host the SVG.

When the ![](./img/foo.svg) syntax used, the rendered GitHub HTML does not actually animate the SVG. :(

It seems like Github is restricting this ––but not when you do <p><img src='//example.com/foo.svg'></p>?

@nbedos
Copy link
Owner

nbedos commented Aug 15, 2018

Yeah, it's weird that it does not work when the image is inside the repository... The easiest way around this is to either use https://rawgit.com/ or setup a GitHub pages website for you repository and host the animation there.

@nnist
Copy link
Contributor

nnist commented Aug 15, 2018

I ran into the same problem, see this stackoverflow post for a more detailed explanation (and multiple ways to get around it). Apparently it's disabled due to potential cross site scripting vulnerabilities.

github.io is the preferred workaround.

@ahmetb
Copy link
Author

ahmetb commented Aug 16, 2018

Thanks for the answers. Closing this since it's not actionable. Feel free to add a note to README as you see fit.

@nbedos
Copy link
Owner

nbedos commented Oct 15, 2019

This issue is getting many more views than others so I'm temporarily reopening it to add that since #86 was resolved, SVG animations produced by termtosvg can be included in a markdown file simply like so:

![Example](./docs/examples/awesome_window_frame.svg)

You just have to have the mardown file and the SVG in the same repository. This is exactly how it's done in README.md : https://github.com/nbedos/termtosvg/blame/0.9.0/README.md#L8

Please open an issue if you still can not use the animations the way you'd like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants