Skip to content

Commit

Permalink
Adapt to new iconset layout
Browse files Browse the repository at this point in the history
Remove Adobe's "save for web" nodes
  • Loading branch information
dfreedm committed Jul 15, 2014
1 parent f9b1816 commit 14f65ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions concat-svg/compile-icon-sets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../core-iconset-svg/core-iconset-svg.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-iconset-svg/core-iconset-svg.html">
<core-iconset-svg id="$NAME" iconSize="24">
<svg><defs>
ENDL
Expand All @@ -40,10 +41,10 @@ contains() {
mkdir -p iconsets

NAME="icons"
FILE="iconsets/icons.html"
FILE="core-icons.html"
header
# find all the default icons, sort by basename (in perl), run concat
find "${DEFAULT[@]/#/$FOLDER}" -name "*24px.svg" | perl -le 'print sort{lc($p=$a)=~s|.*/||; lc($q=$b)=~s|.*/||; $p cmp $q} <>' | xargs $runfrom/concat-svg.js >> $FILE
find "${DEFAULT[@]/#/$FOLDER}" -name "*24px.svg" | perl -le 'print sort{($p=$a)=~s|.*/||; ($q=$b)=~s|.*/||; lc($p) cmp lc($q)} <>' | xargs $runfrom/concat-svg.js >> $FILE
footer

for dir in $FOLDER/*/; do
Expand All @@ -52,7 +53,7 @@ for dir in $FOLDER/*/; do
fi
echo $dir
NAME=`basename $dir`
FILE="iconsets/$NAME-icons.html"
FILE="$NAME-icons.html"
header
find $dir -name "*24px.svg" | sort | xargs $runfrom/concat-svg.js >> $FILE
footer
Expand Down
2 changes: 2 additions & 0 deletions concat-svg/concat-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ function transmogrify($, name) {
e.removeAttr('fill');
}
});
// remove adobe "save for web" elements
node.find('sfw,metadata').remove();
// remove empty groups
var innerHTML = $.xml(node.find('*').filter(':not(g)'));
// remove extraneous whitespace
Expand Down

0 comments on commit 14f65ab

Please sign in to comment.