-
-
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
Refactor README to be easier to read through #1731
Conversation
* Split up code blocks by moving text outside them. (This also ensures that the Copy function makes sense.) * Remove the redundant list of default plugins and refer to the table instead. * Sort the table of plugins alphabetically. (It's easier to scan for a plugin.) * Replace the enabled/disabled code in Default column with just Yes or blank. * Tabulate the "Other ways to use" section and remove redundant "as a/an". * Correct the word Donators to Donors.
You should add a highlight about how SVGO strips the |
@drewbaker thanks for the tip. It's been 2 months since the members made any movement on the project. I don't even know if my efforts to improve the README are in vain or not. I will await for a member to let me know that they are merging/interested to merge this PR before considering your suggestion. Also, the issue of |
PS: I will probably not include any specific mention about the issue though, because the table of plugins already specifies |
Yeah I agree that it's "controversial" for sure. I also agree with your idea on better defaults. However, it seems the best we can do is document this expected behavior in a way to save people the trouble. Some better wording of this is what I had in mind: "If you are here wondering why your SVG's no longer scale after using SVGO, it's probably because you need to set |
Sounds good, but it will have to be a separate PR. It's outside the scope of this one (which only refactors the doc without adding new content). Thank you though. 🙂 |
Just my 2 cents.
This is a commonly-met issue and usually it wastes minutes if not hours for people to find the right solution. It's hard for people to notice removeViewBox in the long table of plugins. Also, it might not be straightforward for people to correlate scalability issue with viewBox attribute especially for people who are new to SVG. I think it worth being highlighted in an FAQ section to help people save time. Example:
I appreciate this clarity! It's much more helpful than "when possible". But sadly this condition will still break scalability most of the time :( I even wonder if it's possible to link to a Google Form to let people vote for the default removeViewBox setting lol |
FAQ or Troubleshooting section sounds reasonable. It will be better with more than just one item though. Are there other frequently met issues? |
I'm not sure. But given that this issue is frequently met, I think it's fine to just have one item in FAQ for now and we can add more going forward. |
For now it has only one item, with reference to svg#1128
Hi @deepsweet can I please ask for this to be merged in? Besides the original clean-up of Thank you so much! ❤️ |
@TrySound could you please try the checks again? Looks like it had a Thank you. |
Awesome, good job! |
Thank you so much @TrySound 🥳 🎉 |
Preview: https://github.com/ADTC/svgo/blob/patch-1/README.md * Split up code blocks by moving text outside them. (This also ensures that the Copy function makes sense. _See screenshot:_) * <img width="380" alt="image" src="https://user-images.githubusercontent.com/6047296/211246090-64749e5f-3f1e-413b-be39-a99fa2f1b425.png"> * Remove the redundant list of default plugins and refer to the table instead. * Sort the table of plugins alphabetically. (It's easier to scan for a plugin.) * _I suggest maintaining the sort when adding new items._ * Replace the enabled/disabled code in Default column with just Yes or blank. * Tabulate the "Other ways to use" section and remove redundant "as a/an". * Correct the word Donators to Donors. * Add a new section called _Troubleshooting_.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [svgo](https://svgo.dev) ([source](https://github.com/svg/svgo)) | [`3.0.2` -> `3.0.3`](https://renovatebot.com/diffs/npm/svgo/3.0.2/3.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/svgo/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/svgo/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/svgo/3.0.2/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/svgo/3.0.2/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>svg/svgo (svgo)</summary> ### [`v3.0.3`](https://github.com/svg/svgo/releases/tag/v3.0.3) [Compare Source](https://github.com/svg/svgo/compare/v3.0.2...v3.0.3) Includes various bug fixes and optimizations for existing plugins. We're also revamped the documentation for the project. You can find it on [svgo.dev](https://svgo.dev/)! The frontend for svgo.dev is maintained in [svg/svgo.dev](https://github.com/svg/svgo.dev), contributions are welcome. #### What's Changed ##### Settings - **Remove Comments**, introduces `preservePatterns` parameter. Preserves legal comments by default, same as the previous behavior, but can now be overridden. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1812](https://github.com/svg/svgo/pull/1812) - **Remove Description**, set the `removeAny` parameter to `false` by default for accessibility. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1806](https://github.com/svg/svgo/pull/1806) ##### Bug Fixes - **Remove Raster Images**, removes inlined JPEG images. By [@​abejfehr](https://github.com/abejfehr) in [https://github.com/svg/svgo/pull/1742](https://github.com/svg/svgo/pull/1742) - **Cleanup IDs**, correctly handle when 2 IDs have been referenced in a single attribute. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1795](https://github.com/svg/svgo/pull/1795) - **Cleanup IDS**, correctly handle when we've encountered a reference to a node that doesn't exist. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1817](https://github.com/svg/svgo/pull/1817) - **Inline Styles**, treat style prop keys as case-insensitive. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1797](https://github.com/svg/svgo/pull/1797) - **Inline Styles**, remove all classes in multiclass selector. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1801](https://github.com/svg/svgo/pull/1801) - **Inline Styles**, ignore empty CSS blocks instead of adding empty style attribute. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1823](https://github.com/svg/svgo/pull/1823) - **Minify Styles**, removes unused class selectors when the document has no classes. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1800](https://github.com/svg/svgo/pull/1800) - **Prefix IDs**, reuse the same prefix when encountering an ID multiple times. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1814](https://github.com/svg/svgo/pull/1814) - **Remove Hidden Elements**, stops removing non-rendering elements like masks. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1793](https://github.com/svg/svgo/pull/1793) - **Reuse Paths**, creates a new ID if the current one is referenced by another element. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1784](https://github.com/svg/svgo/pull/1784) - **Reuse Paths**, removes redundant `defs` children after optimization. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1785](https://github.com/svg/svgo/pull/1785) - **Reuse Paths**, stops duplicating attributes into the shared definition. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1791](https://github.com/svg/svgo/pull/1791) - Don't crash on a `null`, `undefined`, or empty plugin. Instead, log a warning and ignore it. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/issues/1128](https://github.com/svg/svgo/issues/1128) ##### SVG Optimization - **Convert Transform**, omit spaces between functions. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1802](https://github.com/svg/svgo/pull/1802) - **Remove Scripts**, removes callbacks (`on*`) and `href` attributes with `javascript:` URIs. By [@​cakeinpanic](https://github.com/cakeinpanic) and [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1807](https://github.com/svg/svgo/pull/1807), [https://github.com/svg/svgo/pull/1818](https://github.com/svg/svgo/pull/1818), [https://github.com/svg/svgo/pull/1819](https://github.com/svg/svgo/pull/1819), [https://github.com/svg/svgo/pull/1820](https://github.com/svg/svgo/pull/1820) - **Convert One-Stop Gradients**, new plugin to convert gradients with one stop to a solid color, disabled by default. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1790](https://github.com/svg/svgo/pull/1790) ##### Performance - Various optimizations for path handling. By [@​marvinhagemeister](https://github.com/marvinhagemeister) in [https://github.com/svg/svgo/pull/1716](https://github.com/svg/svgo/pull/1716) and [https://github.com/svg/svgo/pull/1717](https://github.com/svg/svgo/pull/1717) ##### Chores - Revise the README. By [@​ADTC](https://github.com/ADTC) in [https://github.com/svg/svgo/pull/1731](https://github.com/svg/svgo/pull/1731) - Fix dead link to postcss-svgo in README. By [@​Lehoczky](https://github.com/Lehoczky) in [https://github.com/svg/svgo/pull/1770](https://github.com/svg/svgo/pull/1770) - Replace webpack loader library in README as previous was deprecated. By [@​tanyabouman](https://github.com/tanyabouman) in [https://github.com/svg/svgo/pull/1771](https://github.com/svg/svgo/pull/1771) #### Metrics Before and after using vectors from various sources, with the default preset of each respective version: | SVG | Original | v3.0.2 | v3.0.3 | Delta | |---|---|---|---|---| | [Arch Linux Logo](https://archlinux.org/art/) | 8.584 KiB | 4.748 KiB | 4.747 KiB | ⬇️ 0.001 KiB | | [Blobs](https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/backgrounds/blobs-d.svg) | 50.45 KiB | 42.949 KiB | 42.949 KiB | | | [Isometric Madness](https://inkscape.org/~Denis_Kuznetsky/%E2%98%85isometric-madness) | 869.034 KiB | 550.829 KiB | 550.699 KiB | ⬇️ 0.13 KiB | | [tldr-pages Banner](https://github.com/tldr-pages/tldr/blob/main/images/banner.svg) | 2.071 KiB | 1.07 KiB | 1.07 KiB | | | [Wikipedia Logo](https://en.wikipedia.org/wiki/File:Wikipedia-logo-v2.svg) | 161.552 KiB | 118.441 KiB | 118.441 KiB | | Before and after of the browser bundle of each respective version: | | v3.0.2 | v3.0.3 | Delta | |---|---|---|---| | svgo.browser.js | 643.5 kB | 651.7 kB | ⬆️ 8.2 kB | </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on Monday" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cozy/cozy-stack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40Ni4wIiwidXBkYXRlZEluVmVyIjoiMzcuNDYuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [svgo](https://svgo.dev) ([source](https://github.com/svg/svgo)) | [`3.0.2` -> `3.0.3`](https://renovatebot.com/diffs/npm/svgo/3.0.2/3.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/svgo/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/svgo/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/svgo/3.0.2/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/svgo/3.0.2/3.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>svg/svgo (svgo)</summary> ### [`v3.0.3`](https://github.com/svg/svgo/releases/tag/v3.0.3) [Compare Source](https://github.com/svg/svgo/compare/v3.0.2...v3.0.3) Includes various bug fixes and optimizations for existing plugins. We're also revamped the documentation for the project. You can find it on [svgo.dev](https://svgo.dev/)! The frontend for svgo.dev is maintained in [svg/svgo.dev](https://github.com/svg/svgo.dev), contributions are welcome. #### What's Changed ##### Settings - **Remove Comments**, introduces `preservePatterns` parameter. Preserves legal comments by default, same as the previous behavior, but can now be overridden. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1812](https://github.com/svg/svgo/pull/1812) - **Remove Description**, set the `removeAny` parameter to `false` by default for accessibility. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1806](https://github.com/svg/svgo/pull/1806) ##### Bug Fixes - **Remove Raster Images**, removes inlined JPEG images. By [@​abejfehr](https://github.com/abejfehr) in [https://github.com/svg/svgo/pull/1742](https://github.com/svg/svgo/pull/1742) - **Cleanup IDs**, correctly handle when 2 IDs have been referenced in a single attribute. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1795](https://github.com/svg/svgo/pull/1795) - **Cleanup IDS**, correctly handle when we've encountered a reference to a node that doesn't exist. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1817](https://github.com/svg/svgo/pull/1817) - **Inline Styles**, treat style prop keys as case-insensitive. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1797](https://github.com/svg/svgo/pull/1797) - **Inline Styles**, remove all classes in multiclass selector. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1801](https://github.com/svg/svgo/pull/1801) - **Inline Styles**, ignore empty CSS blocks instead of adding empty style attribute. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1823](https://github.com/svg/svgo/pull/1823) - **Minify Styles**, removes unused class selectors when the document has no classes. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1800](https://github.com/svg/svgo/pull/1800) - **Prefix IDs**, reuse the same prefix when encountering an ID multiple times. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1814](https://github.com/svg/svgo/pull/1814) - **Remove Hidden Elements**, stops removing non-rendering elements like masks. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1793](https://github.com/svg/svgo/pull/1793) - **Reuse Paths**, creates a new ID if the current one is referenced by another element. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1784](https://github.com/svg/svgo/pull/1784) - **Reuse Paths**, removes redundant `defs` children after optimization. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1785](https://github.com/svg/svgo/pull/1785) - **Reuse Paths**, stops duplicating attributes into the shared definition. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1791](https://github.com/svg/svgo/pull/1791) - Don't crash on a `null`, `undefined`, or empty plugin. Instead, log a warning and ignore it. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/issues/1128](https://github.com/svg/svgo/issues/1128) ##### SVG Optimization - **Convert Transform**, omit spaces between functions. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1802](https://github.com/svg/svgo/pull/1802) - **Remove Scripts**, removes callbacks (`on*`) and `href` attributes with `javascript:` URIs. By [@​cakeinpanic](https://github.com/cakeinpanic) and [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1807](https://github.com/svg/svgo/pull/1807), [https://github.com/svg/svgo/pull/1818](https://github.com/svg/svgo/pull/1818), [https://github.com/svg/svgo/pull/1819](https://github.com/svg/svgo/pull/1819), [https://github.com/svg/svgo/pull/1820](https://github.com/svg/svgo/pull/1820) - **Convert One-Stop Gradients**, new plugin to convert gradients with one stop to a solid color, disabled by default. By [@​SethFalco](https://github.com/SethFalco) in [https://github.com/svg/svgo/pull/1790](https://github.com/svg/svgo/pull/1790) ##### Performance - Various optimizations for path handling. By [@​marvinhagemeister](https://github.com/marvinhagemeister) in [https://github.com/svg/svgo/pull/1716](https://github.com/svg/svgo/pull/1716) and [https://github.com/svg/svgo/pull/1717](https://github.com/svg/svgo/pull/1717) ##### Chores - Revise the README. By [@​ADTC](https://github.com/ADTC) in [https://github.com/svg/svgo/pull/1731](https://github.com/svg/svgo/pull/1731) - Fix dead link to postcss-svgo in README. By [@​Lehoczky](https://github.com/Lehoczky) in [https://github.com/svg/svgo/pull/1770](https://github.com/svg/svgo/pull/1770) - Replace webpack loader library in README as previous was deprecated. By [@​tanyabouman](https://github.com/tanyabouman) in [https://github.com/svg/svgo/pull/1771](https://github.com/svg/svgo/pull/1771) #### Metrics Before and after using vectors from various sources, with the default preset of each respective version: | SVG | Original | v3.0.2 | v3.0.3 | Delta | |---|---|---|---|---| | [Arch Linux Logo](https://archlinux.org/art/) | 8.584 KiB | 4.748 KiB | 4.747 KiB | ⬇️ 0.001 KiB | | [Blobs](https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/backgrounds/blobs-d.svg) | 50.45 KiB | 42.949 KiB | 42.949 KiB | | | [Isometric Madness](https://inkscape.org/~Denis_Kuznetsky/%E2%98%85isometric-madness) | 869.034 KiB | 550.829 KiB | 550.699 KiB | ⬇️ 0.13 KiB | | [tldr-pages Banner](https://github.com/tldr-pages/tldr/blob/main/images/banner.svg) | 2.071 KiB | 1.07 KiB | 1.07 KiB | | | [Wikipedia Logo](https://en.wikipedia.org/wiki/File:Wikipedia-logo-v2.svg) | 161.552 KiB | 118.441 KiB | 118.441 KiB | | Before and after of the browser bundle of each respective version: | | v3.0.2 | v3.0.3 | Delta | |---|---|---|---| | svgo.browser.js | 643.5 kB | 651.7 kB | ⬆️ 8.2 kB | </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on Monday after 10am before 7pm" in timezone Asia/Seoul, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/channel-io/bezier-react). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40Ni4wIiwidXBkYXRlZEluVmVyIjoiMzcuNDYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ed Sungik Choi <sungik.dev@gmail.com>
Preview: https://github.com/ADTC/svgo/blob/patch-1/README.md