Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbankier/xml2tss
Alloy View XML to tss generator
https://github.com/dbankier/xml2tss
Last synced: about 1 month ago
JSON representation
Alloy View XML to tss generator
- Host: GitHub
- URL: https://github.com/dbankier/xml2tss
- Owner: dbankier
- Archived: true
- Created: 2013-06-25T11:05:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-29T22:45:32.000Z (over 11 years ago)
- Last Synced: 2024-08-04T07:03:32.535Z (5 months ago)
- Language: JavaScript
- Size: 60.5 KB
- Stars: 43
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 UsageThe `convertString`, `convertFile` and `updateFile` functions are available:
e.g.
```
var xml2tss = require("xml2tss");xml2tss.convertString('',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:
```
Add Item
Cancel
```
Generates this:
```
"#addBtn" : {}
"#addWin" : {}
"#cancelBtn" : {}
"#itemField" : {}
".again" : {}
".button" : {}
".container" : {}
```