inloop / svg2android

SVG to Android VectorDrawable XML resource file
http://inloop.github.io/svg2android
Apache License 2.0
1.71k stars 355 forks source link

Add NodeJS support #15

Open yuraj11 opened 9 years ago

yuraj11 commented 9 years ago

automate svg2android from CLI

victorhaggqvist commented 9 years ago

This would be awesome

yuraj11 commented 9 years ago

There's support for drag & drop multiple svg at once.

victorhaggqvist commented 9 years ago

Yeah sure, but kind of inconvenient for several hundred icons multiple times. Having it part of a build script would be handy.

Ashraf-Ali-aa commented 8 years ago

:+1:

yuraj11 commented 8 years ago

I will appreciate If someone could implement this - I do not plan implementing this feature. After research this would need a huge code rewrite.

snowdream commented 8 years ago

:+1:

bhargavms commented 7 years ago

I would love to pick this up, if you could provide some hints on how to get started since I am a Javscript newbie here :)

serv-inc commented 7 years ago

@bhargavms: it seems as though the main method is generateCode. It seems to also need flatten.js and svg_shape_converter.js (and jQuery for the xml parsing). You would also need some way to set the command-line arguments that are offered by the web interface, f.ex.bakeTransforms (look for localStorage). @yuraj11 : thanks for the SW, it was the only one that worked for me. Please have a look at the outline and correct if anything is wrong or could be done better.

Summary:

simple:

  1. read svg from command line to data structure (from stdin, file name, pick one)
  2. apply generateCode, see which methods etc are needed
  3. write result to output (stdout, file, pick one)

enhanced: