1
0
mirror of https://github.com/svg/svgo.git synced 2025-08-01 18:46:52 +03:00

Formatting

This commit is contained in:
GreLI
2015-06-21 19:13:41 +03:00
parent 336b08998d
commit a7f62d8984
34 changed files with 36 additions and 35 deletions

View File

@ -4,7 +4,7 @@ exports.type = 'full';
exports.active = false; exports.active = false;
exports.description = 'Add classnames to an outer <svg> element.'; exports.description = 'adds classnames to an outer <svg> element';
/** /**
* Add classnames to an outer <svg> element. * Add classnames to an outer <svg> element.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'cleanup attributes from newlines, trailing and repeating spaces'; exports.description = 'cleanups attributes from newlines, trailing and repeating spaces';
exports.params = { exports.params = {
newlines: true, newlines: true,

View File

@ -4,7 +4,7 @@ exports.type = 'full';
exports.active = true; exports.active = true;
exports.description = 'remove unused and minify used IDs'; exports.description = 'removes unused IDs and minifies used';
exports.params = { exports.params = {
remove: true, remove: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = false; exports.active = false;
exports.description = 'Round list of values to the fixed precision'; exports.description = 'rounds list of values to the fixed precision';
exports.params = { exports.params = {
floatPrecision: 3, floatPrecision: 3,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'round numeric values to the fixed precision, remove default \'px\' units'; exports.description = 'rounds numeric values to the fixed precision, removes default px units';
exports.params = { exports.params = {
floatPrecision: 3, floatPrecision: 3,

View File

@ -4,7 +4,7 @@ exports.type = 'perItemReverse';
exports.active = true; exports.active = true;
exports.description = 'collapse useless groups'; exports.description = 'collapses useless groups';
var animationElems = require('./_collections').elemsGroups.animation; var animationElems = require('./_collections').elemsGroups.animation;

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'convert colors (from rgb() to #rrggbb, from #rrggbb to #rgb)'; exports.description = 'converts colors: rgb() to #rrggbb and #rrggbb to #rgb';
exports.params = { exports.params = {
names2hex: true, names2hex: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'convert Path data to relative or absolute whichever is shorter, convert one segment to another, trim useless delimiters, smart rounding and much more'; exports.description = 'optimizes path data: writes in shorter form, applies transformations';
exports.params = { exports.params = {
applyTransforms: true, applyTransforms: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'convert some basic shapes to path'; exports.description = 'converts basic shapes to more compact path form';
var none = { value: 0 }, var none = { value: 0 },
regNumber = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g; regNumber = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;

View File

@ -1,16 +1,17 @@
/* jshint quotmark: false */
'use strict'; 'use strict';
exports.type = 'perItem'; exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'Convert style in attributes. Cleanups comments and illegal declarations (without colon) as a side effect'; exports.description = 'converts style to attributes';
var EXTEND = require('whet.extend'), var EXTEND = require('whet.extend'),
stylingProps = require('./_collections').stylingProps, stylingProps = require('./_collections').stylingProps,
rEscape = '\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)', // Like \" or \2051. Code points consume one space. rEscape = '\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)', // Like \" or \2051. Code points consume one space.
rAttr = '\\s*(' + g('[^:;\\\\]', rEscape) + '*?)\\s*', // attribute name like fill rAttr = '\\s*(' + g('[^:;\\\\]', rEscape) + '*?)\\s*', // attribute name like fill
rSingleQuotes = '\'(?:[^\'\\n\\r\\\\]|' + rEscape + ')*?(?:\'|$)', // string in single quotes: 'smth' rSingleQuotes = "'(?:[^'\\n\\r\\\\]|" + rEscape + ")*?(?:'|$)", // string in single quotes: 'smth'
rQuotes = '"(?:[^"\\n\\r\\\\]|' + rEscape + ')*?(?:"|$)', // string in double quotes: "smth" rQuotes = '"(?:[^"\\n\\r\\\\]|' + rEscape + ')*?(?:"|$)', // string in double quotes: "smth"
rQuotedString = new RegExp('^' + g(rSingleQuotes, rQuotes) + '$'), rQuotedString = new RegExp('^' + g(rSingleQuotes, rQuotes) + '$'),

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'collapse multiple transforms into one, convert matrices to the short aliases and much more'; exports.description = 'collapses multiple transformations and optimizes it';
exports.params = { exports.params = {
convertToShorts: true, convertToShorts: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'merge multiple Paths into one'; exports.description = 'merges multiple paths in one if possible';
exports.params = { exports.params = {
collapseRepeated: true, collapseRepeated: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItemReverse';
exports.active = true; exports.active = true;
exports.description = 'move elements attributes to the existing group wrapper'; exports.description = 'moves elements attributes to the existing group wrapper';
var inheritableAttrs = require('./_collections').inheritableAttrs, var inheritableAttrs = require('./_collections').inheritableAttrs,
pathElems = require('./_collections.js').pathElems; pathElems = require('./_collections.js').pathElems;

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'move some group attributes to the content elements'; exports.description = 'moves some group attributes to the content elements';
var collections = require('./_collections.js'), var collections = require('./_collections.js'),
pathElems = collections.pathElems.concat(['g', 'text']), pathElems = collections.pathElems.concat(['g', 'text']),

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove comments'; exports.description = 'removes comments';
/** /**
* Remove comments. * Remove comments.

View File

@ -8,7 +8,7 @@ exports.params = {
removeAny: false removeAny: false
}; };
exports.description = 'remove <desc> (only non-meaningful by default)'; exports.description = 'removes <desc> (only non-meaningful by default)';
var standardDescs = /^Created with/; var standardDescs = /^Created with/;

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove doctype declaration'; exports.description = 'removes doctype declaration';
/** /**
* Remove DOCTYPE declaration. * Remove DOCTYPE declaration.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove editors namespaces, elements and attributes'; exports.description = 'removes editors namespaces, elements and attributes';
var editorNamespaces = require('./_collections').editorNamespaces, var editorNamespaces = require('./_collections').editorNamespaces,
prefixes = []; prefixes = [];

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove empty attributes'; exports.description = 'removes empty attributes';
/** /**
* Remove attributes with empty values. * Remove attributes with empty values.

View File

@ -4,7 +4,7 @@ exports.type = 'perItemReverse';
exports.active = true; exports.active = true;
exports.description = 'remove empty Container elements'; exports.description = 'removes empty container elements';
var container = require('./_collections').elemsGroups.container; var container = require('./_collections').elemsGroups.container;

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove empty Text elements'; exports.description = 'removes empty <text> elements';
exports.params = { exports.params = {
text: true, text: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove hidden elements'; exports.description = 'removes hidden elements (zero sized, with absent attributes)';
exports.params = { exports.params = {
displayNone: true, displayNone: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove <metadata>'; exports.description = 'removes <metadata>';
/** /**
* Remove <metadata>. * Remove <metadata>.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove non-inheritable group\'s "presentation" attributes'; exports.description = 'removes non-inheritable groups presentational attributes';
var inheritableAttrs = require('./_collections').inheritableAttrs, var inheritableAttrs = require('./_collections').inheritableAttrs,
attrsGroups = require('./_collections').attrsGroups, attrsGroups = require('./_collections').attrsGroups,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = false; exports.active = false;
exports.description = 'remove raster images (disabled by default)'; exports.description = 'removes raster images (disabled by default)';
/** /**
* Remove raster images references in <image>. * Remove raster images references in <image>.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = false; exports.active = false;
exports.description = 'remove <title> (disabled by default)'; exports.description = 'removes <title> (disabled by default)';
/** /**
* Remove <title>. * Remove <title>.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove unknown elements content and attributes, remove attrs with default values'; exports.description = 'removes unknown elements content and attributes, removes attrs with default values';
exports.params = { exports.params = {
unknownContent: true, unknownContent: true,

View File

@ -4,7 +4,7 @@ exports.type = 'full';
exports.active = true; exports.active = true;
exports.description = 'remove unused namespaces declaration'; exports.description = 'removes unused namespaces declaration';
/** /**
* Remove unused namespaces declaration. * Remove unused namespaces declaration.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove elements of <defs> without id'; exports.description = 'removes elements in <defs> without id';
var nonRendering = require('./_collections').elemsGroups.nonRendering, var nonRendering = require('./_collections').elemsGroups.nonRendering,
defs; defs;

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove useless stroke and fill attrs'; exports.description = 'removes useless stroke and fill attributes';
exports.params = { exports.params = {
stroke: true, stroke: true,

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = false; exports.active = false;
exports.description = 'remove viewBox attribute when possible (disabled by default)'; exports.description = 'removes viewBox attribute when possible (disabled by default)';
var regViewBox = /^0\s0\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/, var regViewBox = /^0\s0\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/,
viewBoxElems = ['svg', 'pattern']; viewBoxElems = ['svg', 'pattern'];

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = true; exports.active = true;
exports.description = 'remove XML processing instructions'; exports.description = 'removes XML processing instructions';
/** /**
* Remove XML Processing Instruction. * Remove XML Processing Instruction.

View File

@ -4,7 +4,7 @@ exports.type = 'perItem';
exports.active = false; exports.active = false;
exports.description = 'sort element attributes for epic readability (disabled by default)'; exports.description = 'sorts element attributes (disabled by default)';
exports.params = { exports.params = {
order: [ order: [

View File

@ -8,7 +8,7 @@ exports.type = 'full';
exports.active = false; exports.active = false;
exports.description = 'apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside (disabled by default)'; exports.description = 'performs a set of operations on SVG with one path inside (disabled by default)';
exports.params = { exports.params = {
// width and height to resize SVG and rescale inner Path // width and height to resize SVG and rescale inner Path