Skip to content

Commit d709619

Browse files
authored
update docs (#183)
1 parent 199451a commit d709619

18 files changed

+142
-179
lines changed

docs/02-usage/02-browser.mdx

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/diffs-from-svgo.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,9 @@ In SVGO, rounding of decimal values is enabled by default and integrated into ma
88

99
## Plugins
1010

11-
The following SVGO default plugins have been removed from **svgo-ll**:
12-
13-
- **cleanupAttrs**
14-
- **cleanupEnableBackground**
15-
- **cleanupNumericValues**
16-
- **convertColors** - similar functionality is in the new **[minifyColors](./plugins/minifyColors.md)** plugin
17-
- **convertPathData** - most of the lossless functionality of this plugin has been preserved in the new **[minifyPathData](./plugins/minifyPathData.md)** plugin
18-
- **convertTransform** - some of the benefits of this plugin are achieved with the new **[minifyTransforms](./plugins/minifyTransforms.md)** plugin
19-
- **mergePaths** - some of the benefits of **mergePaths** are achieved with the new **[createGroups](./plugins/createGroups.md)** plugin
20-
- **mergeStyles**
21-
- **moveElemsAttrsToGroup**
22-
- **moveGroupAttrsToElems**
23-
- **removeDeprecatedAttrs**
24-
- **removeEmptyAttrs**
25-
- **removeEmptyText** - now handled by [removeEmptyContainers](./plugins/removeEmptyContainers.md)
26-
- **sortAttrs**
27-
- **sortDefsChildren**
28-
29-
The following new default plugins have been added to **svgo-ll**:
30-
31-
- **[cleanupStyleAttributes](./plugins/cleanupStyleAttributes.md)**
32-
- **[cleanupTextElements](./plugins/cleanupTextElements.md)**
33-
- **[cleanupXlink](./plugins/cleanupXlink.md)**
34-
- **combineStyleElements**
35-
- **[createGroups](./plugins/createGroups.md)**
36-
- **[mergeGradients](./plugins/mergeGradients.md)**
37-
- **[minifyColors](./plugins/minifyColors.md)**
38-
- **[minifyGradients](./plugins/minifyGradients.md)**
39-
- **[minifyPathData](./plugins/minifyPathData.md)**
40-
- **[minifyTransforms](./plugins/minifyTransforms.md)**
41-
- **moveElemsStylesToGroup**
11+
Many plugins have been removed or rewritten, and new plugins have been added.
12+
13+
See the list of [default plugins](./plugins/default-plugins.md) for information about **svgo-ll** plugins.
4214

4315
## CSS
4416

@@ -50,6 +22,8 @@ Plugins can be [enabled, disabled, and configured](./command-line-options.md#plu
5022

5123
The `--multipass` option has been removed and replaced by [`--max-passes`](./command-line-options.md#max-passes). By default **svgo-ll** will make up to 10 passes, the equivalent of using the `--multipass` option in SVGO.
5224

25+
A preprocessing phase (plugins are run once each, before the main plugin loop) and a postprocessing phase (plugins are run once each, after the main plugin loop).
26+
5327
<a id="scalability"></a>
5428

5529
## Scalability

docs/faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ npx svgo-ll --plugins minifyPathData -i test.svg
3737
Use the `--disable` command line option. For example:
3838

3939
```
40-
npx svgo-ll --disable minifyPathData cleanupIds -i test.svg
40+
npx svgo-ll --disable minifyPathData minifyIds -i test.svg
4141
```
4242

4343
<a id="comp-round"></a>
@@ -54,11 +54,11 @@ npx svgo-ll -i test.svg --enable round
5454

5555
### Change the default options for a plugin
5656

57-
You can change the default options for a plugin by creating a JSON file and using the [`--options` command line option](./command-line-options.md#options). For example, to use the default plugins and specify an id that should not be changed by the `cleanupIds` plugin, create file named `options.json` with the content:
57+
You can change the default options for a plugin by creating a JSON file and using the [`--options` command line option](./command-line-options.md#options). For example, to use the default plugins and specify an id that should not be changed by the `minifyIds` plugin, create a file named `options.json` with the content:
5858

5959
```
6060
{
61-
"cleanupIds": {
61+
"minifyIds": {
6262
"preserve": "abc"
6363
}
6464
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# cleanupGradientAttributes
2+
3+
Removes unnecessary `<linearGradient>` and `<radialGradient>` attributes.
4+
5+
## Details
6+
7+
The plugin has no effect if:
8+
9+
- The document has scripts.
10+
- The document has `<style>` elements.
11+
12+
The plugin does the following:
13+
14+
- If `gradientUnits="userSpaceOnUse"`, converts to `objectBoundingBox` if possible, and adjust the values of other attributes.
15+
- Applies the `gradientTransform` directly to the coordinates if possible.
16+
- Removes attributes which are not needed because they are default values.
17+
- Removes attributes which are not needed because they are always overridden.

docs/plugins/cleanupIds.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/plugins/convertImageToUse.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# convertImageToUse
2+
3+
Convert duplicate `<image>` elements to `<use>` elements.
4+
5+
## Details
6+
7+
The plugin has no effect if:
8+
9+
- The document has scripts.
10+
- The document has `<style>` elements.
11+
12+
This plugin does the following:
13+
14+
- For `<image>` elements with identical `data` URLs in their `href` attribute
15+
- creates a single `<image>` in a `<defs>` element
16+
- converts the original `<image>` elements to `<use>` elements referencing the common image

docs/plugins/default-plugins.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,21 @@ Run until there are no further decreases in size, up to [max-passes](../command-
2727

2828
- [inlineStyles](./inlineStyles.md)
2929
- minifyStyles
30-
- [cleanupIds](./cleanupIds.md)
3130
- [minifyColors](./minifyColors.md)
32-
- [minifyGradients](./minifyGradients.md)
3331
- [removeUnknownsAndDefaults](./removeUnknownsAndDefaults.md)
3432
- removeNonInheritableGroupAttrs
33+
- [removeUselessProperties](./removeUselessProperties.md)
34+
- [removeUnusedElements](./removeUnusedElements.md)
3535
- [removeUselessStrokeAndFill](./removeUselessStrokeAndFill.md)
36-
- [removeHiddenElems](./removeHiddenElems.md)
37-
- [mergeDefs](./mergeDefs.md)
3836
- convertEllipseToCircle
3937
- moveElemsStylesToGroup
38+
- [cleanupGradientAttributes](./cleanupGradientAttributes.md)
4039
- [convertShapeToPath](./convertShapeToPath.md)
4140
- [minifyPathData](./minifyPathData.md)
41+
- [mergeFilters](./mergeFilters.md)
4242
- [mergeGradients](./mergeGradients.md)
43+
- [minifyGradients](./minifyGradients.md)
44+
- [minifyPatterns](./minifyPatterns.md)
4345
- [removeEmptyContainers](./removeEmptyContainers.md)
4446
- [convertPathToUse](./convertPathToUse.md)
4547
- [createGroups](./createGroups.md)
@@ -53,6 +55,8 @@ Run until there are no further decreases in size, up to [max-passes](../command-
5355
Run once, in the specified order, after main plugins have completed:
5456

5557
- removeUnusedNS
58+
- [convertImageToUse](./convertImageToUse.md)
59+
- [moveGradientAttsToTemplate](./moveGradientAttsToTemplate.md)
5660
- [minifyIds](./minifyIds.md)
5761
- [minifyAttrsAndStyles](./minifyAttrsAndStyles.md)
5862
- [stylesToClasses](./stylesToClasses.md)

docs/plugins/mergeDefs.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/plugins/mergeFilters.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# mergeFilters
2+
3+
Combines identical `<filter>` elements and removes duplicates.
4+
5+
## Details
6+
7+
The plugin has no effect if:
8+
9+
- The document has scripts.
10+
- The document has `<style>` elements with CSS which **svgo-ll** is not able to process.
11+
12+
Duplicate `<filter>` elements are removed, and references to the removed elements are updated to reference the single remaining `<filter>` element.

docs/plugins/minifyGradients.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The plugin has no effect if:
1111

1212
This plugin makes the following transformations:
1313

14+
- Unnecessary stop elements are removed.
1415
- `stop` attributes are written in the shortest format (for example, `"90%"` becomes `".9"`).
1516
- If a gradient consists of a single solid color, any references to the gradient are changed to use the color itself.
1617
- If a gradient is used as a [template](https://svgwg.org/svg2-draft/pservers.html#PaintServerTemplates) and is only referenced once, the template is merged with the referencing gradient.

0 commit comments

Comments
 (0)