svg-sprite
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -50,2 +50,7 @@ #!/usr/bin/env node | ||
yargs = yargs.default(alias, def); | ||
if ((option.default === true) || (option.default === false)) { | ||
yargs = yargs.boolean(name); | ||
} | ||
} else if (option.required) { | ||
@@ -52,0 +57,0 @@ yargs = yargs.require(alias); |
@@ -0,1 +1,7 @@ | ||
## 1.1.2 Bugfix release (2015-04-22) | ||
* Fixed symbol example template regression bug ([#70](https://github.com/jkphl/svg-sprite/issues/70#issuecomment-95307588)) | ||
* Added mixin option to CLI arguments | ||
* Fixed boolean CLI argument notation ([#76](https://github.com/jkphl/svg-sprite/issues/76)) | ||
* Added whitespace replacement for shape IDs ([#77](https://github.com/jkphl/svg-sprite/issues/77)) | ||
## 1.1.1 Bugfix release (2015-04-19) | ||
@@ -2,0 +8,0 @@ * Updated dependencies & development dependencies |
@@ -15,3 +15,2 @@ svg-sprite [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url] | ||
Options: | ||
@@ -25,14 +24,17 @@ --version Show version number | ||
--shape-id-pseudo Separator for CSS pseudo classes [default: "~"] | ||
--shape-id-whitespace Whitespace replacement string for shape IDs [default: "_"] | ||
-w, --shape-dim-width Maximum shape width in pixels [default: 2000] | ||
-h, --shape-dim-height Maximum shape height in pixels [default: 2000] | ||
--shape-dim-precision Precision (decimal places) for dimension calculations [default: 2] | ||
--shape-dim-attributes Whether to add width and height attributes to the shapes [default: false] | ||
-p, --shape-spacing-padding Padding around shape (up to 4 x comma-separated) [default: "0,0,0,0"] | ||
-b, --shape-spacing-box Box sizing strategy ("content" or "padding") [default: "content"] | ||
-m, --shape-meta Path to YAML file with meta and positioning information | ||
-m, --shape-meta Path to YAML file with meta information | ||
-a, --shape-align Path to YAML file with alignment information | ||
-i, --shape-dest Path to output directory for intermediate SVG files | ||
--ims, --shape-dest Path to output directory for intermediate SVG files | ||
--transform Comma-separated list of predefined transformers (see docs) [default: "svgo"] | ||
--transform-* External JSON config files for named transformers | ||
--svg-xmldecl Whether to include an XML declaration in SVG files [default: true] | ||
--svg-doctype Whether to include a doctype declaration in SVG files [default: true] | ||
--svg-namespace-ids Whether to apply ID namespacing to the sprite [default: true] | ||
--svg-dimattrs Whether to add width and height attributes to the sprite [default: true] | ||
-c, --css Activates the «css» mode [default: false] | ||
@@ -42,3 +44,4 @@ --css-dest Mode specific output directory [default: "css"] | ||
--css-common Common CSS rule selector for all shapes [default: null] | ||
--css-prefix CSS selector prefix for all shapes (including placeholders) [default: "svg-%s"] | ||
--css-mixin Preprocessor mixin name with properties for all shapes [default: null] | ||
--css-prefix CSS selector prefix for all shapes (including placeholders) [default: ".svg-%s"] | ||
--css-dimensions CSS selector suffix for shape dimension rules ("" for inline) [default: "-dims"] | ||
@@ -69,3 +72,4 @@ --cs, --css-sprite Sprite path and filename (relative to --mode-css-dest) [default: "svg/sprite.css.svg"] | ||
--view-common Common CSS rule selector for all shapes [default: null] | ||
--view-prefix CSS selector prefix for all shapes (including placeholders) [default: "svg-%s"] | ||
--view-mixin Preprocessor mixin name with properties for all shapes [default: null] | ||
--view-prefix CSS selector prefix for all shapes (including placeholders) [default: ".svg-%s"] | ||
--view-dimensions CSS selector suffix for shape dimension rules ("" for inline) [default: "-dims"] | ||
@@ -94,5 +98,6 @@ --vs, --view-sprite Sprite path and filename (relative to --mode-css-dest) [default: "svg/sprite.css.svg"] | ||
--defs-dest Mode specific output directory [default: "defs"] | ||
--defs-prefix CSS selector prefix for all shapes (including placeholders) [default: "svg-%s"] | ||
--defs-prefix CSS selector prefix for all shapes (including placeholders) [default: ".svg-%s"] | ||
--defs-dimensions CSS selector suffix for shape dimension rules ("" for inline) [default: "-dims"] | ||
--ds, --defs-sprite Sprite path and filename (relative to --mode-css-dest) [default: "svg/sprite.css.svg"] | ||
--defs-bust Enable cache busting [default: false] | ||
--di, --defs-inline Create sprite variant suitable for inline embedding [default: false] | ||
@@ -104,5 +109,6 @@ --dx, --defs-example Whether to render an example HTML document [default: false] | ||
--symbol-dest Mode specific output directory [default: "symbol"] | ||
--symbol-prefix CSS selector prefix for all shapes (including placeholders) [default: "svg-%s"] | ||
--symbol-prefix CSS selector prefix for all shapes (including placeholders) [default: ".svg-%s"] | ||
--symbol-dimensions CSS selector suffix for shape dimension rules ("" for inline) [default: "-dims"] | ||
--ss, --symbol-sprite Sprite path and filename (relative to --mode-css-dest) [default: "svg/sprite.css.svg"] | ||
--symbol-bust Enable cache busting [default: false] | ||
--si, --symbol-inline Create sprite variant suitable for inline embedding [default: false] | ||
@@ -114,5 +120,6 @@ --sx, --symbol-example Whether to render an example HTML document [default: false] | ||
--stack-dest Mode specific output directory [default: "stack"] | ||
--stack-prefix CSS selector prefix for all shapes (including placeholders) [default: "svg-%s"] | ||
--stack-prefix CSS selector prefix for all shapes (including placeholders) [default: ".svg-%s"] | ||
--stack-dimensions CSS selector suffix for shape dimension rules ("" for inline) [default: "-dims"] | ||
--Ss, --stack-sprite Sprite path and filename (relative to --mode-css-dest) [default: "svg/sprite.css.svg"] | ||
--stack-bust Enable cache busting [default: false] | ||
--Sx, --stack-example Whether to render an example HTML document [default: false] | ||
@@ -119,0 +126,0 @@ --stack-example-template HTML document Mustache template (relative to svg-sprite basedir) [default: "tmpl/stack/sprite.html"] |
@@ -77,3 +77,4 @@ svg-sprite [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url] | ||
generator : function() { /*...*/ }, // SVG shape ID generator callback | ||
pseudo : '~' // File name separator for shape states (e.g. ':hover') | ||
pseudo : '~', // File name separator for shape states (e.g. ':hover') | ||
whitespace : '_' // Whitespace replacement for shape IDs | ||
}, | ||
@@ -101,5 +102,6 @@ dimension : { // Dimension related options | ||
-------------------------| --------------- | ------------- | ------------------------------------------ | | ||
`shape.id.separator` | String | `"--"` | Separator for traversing a directory structure into a shape ID | | ||
`shape.id.generator` | Function∣String | See desc. | Callback for translating the local part of a shape's file name into a shape ID. The callback's signature is `function(name) { /* ... */ return id; }`. By default, the file extension `".svg"` is stripped off and directory structures get traversed using the `id.separator` as replacement for the directory separator. You may also provide a template string (e.g. `"icon-%s"`), in which case the placeholder `"%s"` gets substituted with the traversed local file name. If the string doesn't contain any placeholder, it is used as a prefix to the local file name. | | ||
`shape.id.pseudo` | String | `"~"` | String separator for pseudo CSS classes in file names. Example: `my-icon.svg` and `my-icon~hover.svg` for an icon with a regular and a `:hover` state. | | ||
`shape.id.separator` | String | `"--"` | Separator for traversing a directory structure into a shape ID | | ||
`shape.id.generator` | Function∣String | See desc. | Callback for translating the local part of a shape's file name into a shape ID. The callback's signature is `function(name) { /* ... */ return id; }`. By default, the file extension `".svg"` is stripped off and directory structures get traversed using the `id.separator` as replacement for the directory separator. You may also provide a template string (e.g. `"icon-%s"`), in which case the placeholder `"%s"` gets substituted with the traversed local file name. If the string doesn't contain any placeholder, it is used as a prefix to the local file name. | | ||
`shape.id.pseudo` | String | `"~"` | String separator for pseudo CSS classes in file names. Example: `my-icon.svg` and `my-icon~hover.svg` for an icon with a regular and a `:hover` state. | | ||
`shape.id.whitespace` | String | `"_"` | Replacement string for whitespace characters in file names during shape ID generation. Example: By default, `My Custom Icon.svg` will result in the shape ID `my_custom_icon`. | | ||
@@ -106,0 +108,0 @@ |
@@ -118,5 +118,4 @@ 'use strict'; | ||
if (this.config.example) { | ||
var basedir = process.cwd(), | ||
renderConfig = { | ||
template : path.resolve(basedir, path.join('tmpl', this.mode, 'sprite.html')), | ||
var renderConfig = { | ||
template : path.resolve(path.dirname(path.dirname(path.dirname(__dirname))), path.join('tmpl', this.mode, 'sprite.html')), | ||
dest : path.join(this.config.dest, 'sprite.' + this.key + '.html') | ||
@@ -126,3 +125,3 @@ }; | ||
if ('template' in this.config.example) { | ||
renderConfig.template = path.resolve(basedir, this.config.example.template); | ||
renderConfig.template = path.resolve(process.cwd(), this.config.example.template); | ||
} | ||
@@ -129,0 +128,0 @@ if ('dest' in this.config.example) { |
@@ -36,3 +36,3 @@ 'use strict'; | ||
return function(name) { | ||
return util.format(template || '%s', path.basename(name.split(path.sep).join(this.separator), '.svg')); | ||
return util.format(template || '%s', path.basename(name.split(path.sep).join(this.separator).replace(/\s+/g, this.whitespace), '.svg')); | ||
} | ||
@@ -65,2 +65,8 @@ }, | ||
/** | ||
* Whitespace replacement string | ||
* | ||
* @type {String} | ||
*/ | ||
whitespace : '_', | ||
/** | ||
* ID traversal callback | ||
@@ -67,0 +73,0 @@ * |
{ | ||
"name": "svg-sprite", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Joschi Kuphal", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34653802
4096