-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: revamp readme #1835
chore: revamp readme #1835
Conversation
477811a
to
01ef6dd
Compare
01ef6dd
to
75009d7
Compare
```sh | ||
# npm | ||
npm install -g svgo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These days npx, yarn dlx or pnpx are more popular ways to run something globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the quick merge! I should've left this open clearly. ^-^'
I actually opted for the individual commands intentionally because while looking npx
, I've found it's very slow. This checks out with the fact that typically when I see it, it's for running one-time tasks like create-react-app
.
Every time one does npx svgo
, it will check through node modules etc, taking 2 seconds just to run npx svgo --help
. Not the ideal UX, so I thought it'd be best to document them separately, which is also handy to explain how to depend on it in a Node.js project anyway.
|
||
SVGO reads the configuration from `svgo.config.js` or the `--config {{path/to/config.js}}` command-line option. Some other parameters can be configured though command-line options too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{}} is a bit confusing for non dev, maybe not really necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I just borrowed the syntax from tldr-pages.
I'll update this locally and include it as a chore in my next PR.
Revamps the README to tidy things up, reference the new documentation, and drop some unmaintained or deprecated ways to use SVGO.
Hero
I changed the
alt
attribute of the hero image because it wasn't fulfilling it's purpose. Thealt
attribute is what should be used instead if the user is unable to see the image for whatever reason. However, this image is purely decorative and so can be skipped over in the scenario it doesn't load.See: https://www.w3.org/WAI/tutorials/images/decision-tree/
Shields
Adds a badge guiding users to the SVGO documentation. I also modified the alt to match the text we'd expect to see if the badge loaded.
Content
svg
→SVG
)Troubleshooting
I've dropped the troubleshooting section, as caveats of SVGO and each plugin are explained in the documentation. The particular example with
removeViewBox
has also been covered to hell across mediums.Ways to use SVGO
I've deleted some entries, either due to planned deprecation, or because it still uses SVGO v0 or SVGO v1.
I will be working with third-party tools to try to get everyone upgraded to SVGO v3, but once we have released SVGO v4, I would like to remove tools still on SVGO v2 from this list as well.