I'm trying to create an SVG that works much like the Travis CI build status icon.
Looking at the url:
https://travis-ci.org/ddavison/sublime-tabs.svg?branch=master
The URL points to an SVG, but the SVG seems to be able to pull information from another source, hence the "passing" or "failing" message.. How can I replicate this?
I've tried faking the browser by making it a <script>
, and just generating an SVG, but that doesn't seem to work. It just renders XML on the page. Is it possible that Travis has a rule that parses .svg
as some other script file?
How can I execute JavaScript before i actually render the SVG to the user?
I've figured it out. Per @DJDavid98 's comment, I ended up generating the image server side.
Here's an example:
I ended up using Ruby to generate it as JavaScript actually is not allowed on a GitHub Readme!
Try it yourself! Generate some buttons for people to star/fork your repo on github:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments