cupools / lia Goto Github PK
View Code? Open in Web Editor NEWSprite tool that output sprite images and stylesheet files base on configured images, supports rem
License: MIT License
Sprite tool that output sprite images and stylesheet files base on configured images, supports rem
License: MIT License
Cause by incorrect usage of child_process.execFileSync
, it will exactly throw new TypeError('invalid data')
in Windows.
Now it seems not friendly in using wrap
and tmpl
. Maybe with Handlebars
a template looks like follows and wrap
is not necessary anymore.
// sprites.tmpl
{
path: '{{path}}',
size: '{{size}}'
items: [
{{#list items}}
{
name: '{{name}}',
selector: '{{selector}}',
size: '{{size}}',
},
{{/list}}
]
}
// output
{
path: 'build/foo.png',
size: {
width: 50,
height: 100
},
items: [{
name: 'one',
selector: 'sp-one',
size: {
width: 50,
height: 30
}
}, {
name: 'two',
selector: 'sp-two',
size: {
width: 50,
height: 70
}
}]
}
New features will come in v2.1.0
and the code is now in branch feature-psd
psd
is necessary and src
will be a pattern mapped to layer name.png
images directly from psd.运行lia
时报错
fs.js:114
throw err;
^
Error: ENOENT: no such file or directory, scandir '/usr/local/lib/node_modules/lia/node_modules/images/vendor'
at Object.readdirSync (fs.js:790:3)
at Object.getInstalledBinaries (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/extensions.js:130:13)
at foundBinariesList (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:21:21)
at foundBinaries (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:16:5)
at Object.module.exports.missingBinary (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:46:5)
at module.exports (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/binding.js:20:30)
at Object.<anonymous> (/usr/local/lib/node_modules/lia/node_modules/images/index.js:32:51)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
Currently it may give the wrong message [warn]: sprite_conf.js not Found. Try 'lia init'
when syntax error in sprite_conf.js
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.