Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

SAVAGE

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

SAVAGE

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SAVAGE

Intro

Savage is a graphics language layered on top of SVG, in the spirit of Sass and Haml.

Usage

  1. clone repo
  2. bundle
  3. bundle exec ruby compiler.rb < test.svge > test.svg
  4. View test.svg in a web browser or other SVG renderer.

Example

// Set dimensions of your graphic (width x height).
400 x 300

// Draw a circle of radius 100 at (200,150).
(100) @ 200,150

// Draw an ellipse with x-radius 50 and y-radius 40 at 10,10.
(50,40) @ 10,10

// Draw a square of side length 10.
[10] @ 100,200

// Draw a rectangle of width 50, height 30.
[50,30] @ 300,0

// Draw a line from (20,30) to (40,50), then to (50,60).
-
  @ 20,30
  @ 40,50
  @ 50,60

// Draw an arrow.
~
  M 100,225
  L 100,115
  L 130,115
  L 70,15
  L 10,115
  L 40,115
  L 40,225
  z

// Style using Sass.
:sass
  .dot
    fill: red

  #point
    fill: blue

[15].dot @ 300,250

[15].dot @ 350,270

(15)#point @ 360, 230

License

Apache 2.0. See LICENSE.txt.

Credits

Marc-André Cournoyer for writing http://createyourproglang.com/, which got this project off the ground. The authors of Haml, Sass, and Coffeescript, for demonstrating that we need not be content with the languages W3C gives us.

FAQs

Package last updated on 18 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc