Skip to content

Commit

Permalink
Update FAQ and command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkenny54 committed Oct 16, 2024
1 parent ffd86ed commit ba9a745
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/command-line-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ Specify which set of predefined plugins to use. If this option is not used, and
`--config <CONFIG>`
Custom configuration file.

<a id="enable"></a>
`--enable <plugin...>`
Specify one or more builtin plugins to run in addition to those specified by `--preset` or `--config`.

<a id="options"></a>
` --options <FILENAME>`
Path to a [JSON file](https://www.json.org) containing configuration parameters for enabled plugins. The JSON file should contain an object whose keys are the names of plugins, and whose values are the parameters to pass to that plugin.

`--disable <plugin...>`
Specify one or more plugins specified by `--preset` or `--config` which should not be run.

Expand Down
32 changes: 32 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Compression

- [Just remove whitespace from a file](#comp-ws)
- [Run a single plugin](#comp-1plugin)
- [Round decimal values](#comp-round)
- Change the default options for a plugin

## Compression

Expand All @@ -26,3 +28,33 @@ Use `preset-none`. For example:
```
npx svgo-ll --preset none -i test.svg
```

<a id="comp-round"></a>

### Round decimal values

Rounding is not enabled by default. To enable the rounding plugin, use the [`--enable` command line option](./command-line-options.md#enable). For example, to add rounding to the default plugins:

```
npx svgo-ll -i test.svg --enable round
```

<a id="comp-defaults"></a>

### Change the default options for a plugin

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:

```
{
"cleanupIds": {
"preserve": "abc"
}
}
```

and use the command:

```
npx svgo-ll -i test.svg --options options.json
```

0 comments on commit ba9a745

Please sign in to comment.