GithubHelp home page GithubHelp logo

xml2tss's Introduction

xml2tss

Build an empty tss file from an Alloy view xml file

Install

sudo npm install -g xml2tss

CLI Usage

xml2tss [filename.xml]

converted file is returned to stdout (so you can build your own editor plugin)

NEW

xml2tss [filename.xml] (filename.tss)

if a target tss file is supplied it will write the output to the target tss file. If the file already exists it will update the file appending to the end the missing ids and/or classes.

to output to a file

xml2tss row.xml > ../styles/row.tss

or new

xml2tss row.xml ../styles/row.tss

the second command will create or update the target file with the missing tags

to clipboard (OS X)

xml2tss row.xml | pbcopy

Library Usage

The convertString, convertFile and updateFile functions are available:

e.g.

var xml2tss = require("xml2tss");

xml2tss.convertString('<Alloy><Win id="win"/></Alloy>',function(err,data) {
  console.log(data);
});

xml2tss.convertFile('row.xml',function(err,data) {
  console.log(data);
});

// will create or update the target row.tss
xml2tss.updateFile('row.xml','row.tss', function(err,data) {
  console.log(data);
});

Output

From this:

<Alloy>
  <Window id="addWin" title="Add Item" class="container" modal="true">
    <TextField id="itemField" hintText="What do you need to do?" />
    <Button id="addBtn" class="button again">Add Item</Button>
    <Button id="cancelBtn" class="button" class="two">Cancel</Button>
  </Window>
</Alloy>

Generates this:

"#addBtn" : {

}
"#addWin" : {

}
"#cancelBtn" : {

}
"#itemField" : {

}
".again" : {

}
".button" : {

}
".container" : {

}

xml2tss's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.