Skip to content
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

Readme.md lists of plugins to refresh (2021) ? #1621

Closed
hugolpz opened this issue Nov 12, 2021 · 1 comment
Closed

Readme.md lists of plugins to refresh (2021) ? #1621

hugolpz opened this issue Nov 12, 2021 · 1 comment
Assignees

Comments

@hugolpz
Copy link
Contributor

hugolpz commented Nov 12, 2021

Situation

README.md currently presents two lists, with slightly different wordings.

  1. "Default preset plugins"
  2. "List of built-in plugings: enable by default vs disabled by default."
    I suspect "Default preset plugins" and "List of built-in plugings: enable by default" should be the exact same plugins. The two lists are difficult to compare since they are in different order for no apparent reason.

This unclear duplication is confusing.

Recommendations

@TrySound, I can lead this forward but I need your or active leaders' feedback first. My notes...

  1. Clarify the wording: if it's the same, use a consistent wording or replace "Default preset plugins" by _"Default preset of enabled plugins".
  2. Clarify the order: README.md: better plugins' sorting #1430 point out the non-alphabetical order is voluntary because "Plugins are specified in order they are run which is critical for optimisation and correctness." If so, readme.md should states it.
  3. Configuration section: should state that the plugins declaration order within svgo.config.js matters. (I made a README.md PR including that change).
  4. Merge ?: It could be interesting to replace the first list by a pointer to the table and an explanation.
  5. De-tablify: given table sorting is not possible on Github's markdown, the table has no significant comparative advantage for us. A well conceived list could prove to be a better practical fit. Example below:

Regex used : \|(.+?)\|(.+?)\|(.+?)\|\n -> * [$3] $1: $2\n and minor space eating sugars.

See also: #1430, #1455, #1335.


Default preset includes the following list of plugins:

  • removeDoctype
  • removeXMLProcInst
  • removeComments
  • removeMetadata
  • removeEditorsNSData
  • cleanupAttrs
  • mergeStyles
  • inlineStyles
  • minifyStyles
  • cleanupIDs
  • removeUselessDefs
  • cleanupNumericValues
  • convertColors
  • removeUnknownsAndDefaults
  • removeNonInheritableGroupAttrs
  • removeUselessStrokeAndFill
  • removeViewBox
  • cleanupEnableBackground
  • removeHiddenElems
  • removeEmptyText
  • convertShapeToPath
  • convertEllipseToCircle
  • moveElemsAttrsToGroup
  • moveGroupAttrsToElems
  • collapseGroups
  • convertPathData
  • convertTransform
  • removeEmptyAttrs
  • removeEmptyContainers
  • mergePaths
  • removeUnusedNS
  • sortDefsChildren
  • removeTitle
  • removeDesc

Built-in plugins

Plugin Description Default
cleanupAttrs cleanup attributes from newlines, trailing, and repeating spaces enabled
mergeStyles merge multiple style elements into one enabled
inlineStyles move and merge styles from <style> elements to element style attributes enabled
removeDoctype remove doctype declaration enabled
removeXMLProcInst remove XML processing instructions enabled
removeComments remove comments enabled
removeMetadata remove <metadata> enabled
removeTitle remove <title> enabled
removeDesc remove <desc> enabled
removeUselessDefs remove elements of <defs> without id enabled
removeXMLNS removes the xmlns attribute (for inline SVG) disabled
removeEditorsNSData remove editors namespaces, elements, and attributes enabled
removeEmptyAttrs remove empty attributes enabled
removeHiddenElems remove hidden elements enabled
removeEmptyText remove empty Text elements enabled
removeEmptyContainers remove empty Container elements enabled
removeViewBox remove viewBox attribute when possible enabled
cleanupEnableBackground remove or cleanup enable-background attribute when possible enabled
minifyStyles minify <style> elements content with CSSO enabled
convertStyleToAttrs convert styles into attributes disabled
convertColors convert colors (from rgb() to #rrggbb, from #rrggbb to #rgb) enabled
convertPathData convert Path data to relative or absolute (whichever is shorter), convert one segment to another, trim useless delimiters, smart rounding, and much more enabled
convertTransform collapse multiple transforms into one, convert matrices to the short aliases, and much more enabled
removeUnknownsAndDefaults remove unknown elements content and attributes, remove attributes with default values enabled
removeNonInheritableGroupAttrs remove non-inheritable group's "presentation" attributes enabled
removeUselessStrokeAndFill remove useless stroke and fill attributes enabled
removeUnusedNS remove unused namespaces declaration enabled
prefixIds prefix IDs and classes with the SVG filename or an arbitrary string disabled
cleanupIDs remove unused and minify used IDs enabled
cleanupNumericValues round numeric values to the fixed precision, remove default px units enabled
cleanupListOfValues round numeric values in attributes that take a list of numbers (like viewBox or enable-background) disabled
moveElemsAttrsToGroup move elements' attributes to their enclosing group enabled
moveGroupAttrsToElems move some group attributes to the contained elements enabled
collapseGroups collapse useless groups enabled
removeRasterImages remove raster images disabled
mergePaths merge multiple Paths into one enabled
convertShapeToPath convert some basic shapes to <path> enabled
convertEllipseToCircle convert non-eccentric <ellipse> to <circle> enabled
sortAttrs sort element attributes for epic readability disabled
sortDefsChildren sort children of <defs> in order to improve compression enabled
removeDimensions remove width/height and add viewBox if it's missing (opposite to removeViewBox, disable it first) disabled
removeAttrs remove attributes by pattern disabled
removeAttributesBySelector removes attributes of elements that match a CSS selector disabled
removeElementsByAttr remove arbitrary elements by ID or className disabled
addClassesToSVGElement add classnames to an outer <svg> element disabled
addAttributesToSVGElement adds attributes to an outer <svg> element disabled
removeOffCanvasPaths removes elements that are drawn outside of the viewbox disabled
removeStyleElement remove <style> elements disabled
removeScriptElement remove <script> elements disabled
reusePaths Find duplicated elements and replace them with links disabled
@SethFalco
Copy link
Member

Hey! Thanks for reporting the issue.
This has been resolved by revamping how we document the project in general.

Reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants