Skip to content

Commit 11dbd5f

Browse files
author
Florens Verschelde
committed
Update gulp-svg-symbols and improve test setup
1 parent 87200ef commit 11dbd5f

26 files changed

+191
-857
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Archive downloads: only keep gulp-scripts, gulpfile.js, package.json
1+
# Archive downloads: only keep gulp-tasks, gulpfile.js, package.json
22
/doc export-ignore
33
/test export-ignore
44
/.gitignore export-ignore

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Test output
2+
test/gulp-tasks
23
test/dist
3-
# Dependencies
4-
node_modules
4+
55
# This is a boilerplate: don't keep lockfiles
6+
node_modules
67
package-lock.json
78
yarn.lock

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Installation
2626
### Custom installation
2727

2828
1. Install `gulp` and `gulp-task-maker` as devDependencies: `npm install -D gulp gulp-task-maker`.
29-
2. [Download a ZIP of this repo](https://github.com/gradientz/assets-builder/archive/master.zip) and copy the `gulp-scripts` directory or only the task scripts you want to ue.
29+
2. [Download a ZIP of this repo](https://github.com/gradientz/assets-builder/archive/master.zip) and copy the `gulp-tasks` directory or only the task scripts you want to ue.
3030
3. Write your own `gulpfile.js`, following the [gulp-task-maker documentation](https://github.com/fvsch/gulp-task-maker/blob/master/README.md).
3131

3232
Usage

doc/less.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Options
1212

1313
```js
14-
require("gulp-task-maker").task("gulp-scripts/less.js", {
14+
require("gulp-task-maker").task("gulp-tasks/less.js", {
1515
// (Required) Source can be a single Less or CSS stylesheet
1616
// or pattern, or an array of paths or patterns
1717
src: "assets/styles/*.less",

doc/mincss.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## Options
1111

1212
```js
13-
require("gulp-task-maker").task("gulp-scripts/mincss.js", {
13+
require("gulp-task-maker").task("gulp-tasks/mincss.js", {
1414
// (Required) Source can be a single stylesheet
1515
// or pattern, or an array of paths or patterns
1616
src: "assets/styles/*.css",

doc/minjs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Options
1010

1111
```js
12-
require("gulp-task-maker").task("gulp-scripts/minjs.js", {
12+
require("gulp-task-maker").task("gulp-tasks/minjs.js", {
1313
// (Required) Source can be a single script or pattern,
1414
// or an array of paths or patterns
1515
src: "assets/scripts/*.js",

doc/sass.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Options
1212

1313
```js
14-
require("gulp-task-maker").task("gulp-scripts/sass.js", {
14+
require("gulp-task-maker").task("gulp-tasks/sass.js", {
1515
// (Required) Source can be a single Sass stylesheet
1616
// or pattern, or an array of paths or patterns
1717
src: "assets/styles/*.scss",

doc/svgsymbols.md

+15-21
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,33 @@
99
## Options
1010

1111
```js
12-
require("gulp-task-maker").task("gulp-scripts/svgsymbols.js", {
13-
// (Required) Source can be a single script or pattern,
14-
// or an array of paths or patterns
15-
src: "assets/scripts/*.js",
12+
require("gulp-task-maker").task("gulp-tasks/svgsymbols.js", {
13+
// (Required) Source should be a list of SVG files
14+
src: "assets/scripts/*.svg",
1615

1716
// (Required) Destination must be a filename ending in ".svg".
1817
dest: "public/css/main.svg",
1918

2019
// (Optional; defaults to false)
21-
// File patterns to watch for changes
22-
watch: true,
23-
24-
// (Optional; defaults to true)
25-
// Should we minify with svgo?
26-
// Note: when disabling svgo, some features such as internal references may break
27-
minify: true,
28-
29-
// (Optional; defaults to the string shown below)
30-
// Pattern for the symbol’s id attribute.
31-
// "%f" is the cleaned-up original filename.
32-
id: "icon-%f",
20+
// Should we watch file changes?
21+
// Use true to watch the config.src files.
22+
watch: false,
3323

3424
// (Optional; defaults to false)
3525
// Should we make a HTML demo page?
3626
demo: false,
3727

38-
// (Optional; defaults to false)
39-
// Add a class name on the sprite’s root <svg> element?
40-
// Can be useful for sprites you want to directly include in a web page.
41-
svgClassname: "inline-sprite",
28+
// (Optional; defaults to the string shown below)
29+
// Pattern for the symbol’s id attribute.
30+
// "%f" is the cleaned-up original filename.
31+
id: "icon-%f",
4232

4333
// (Optional; defaults to the function shown below)
4434
// Function that cleans up file names to be used in the symbol’s id attribute
45-
slug: file => file.toLowerCase().replace(/[^a-z0-9]/g,"")
35+
slug: name => name.toLowerCase().replace(/[^a-z0-9]/g,""),
36+
37+
// (Optional) XML attributes added to the sprite's root element
38+
// e.g. {"aria-hidden": "true", height: 0, width: 0}
39+
svgAttrs: {}
4640
})
4741
```

0 commit comments

Comments
 (0)