Template:SimplSVG

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
 
The SVG code is valid.
 
This W3C-unspecified vector image was created with a text editor.
 
Please do not replace the simplified code of this file with a version created with Inkscape or any other vector graphics editor
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:SimplSVG/doc.

This template is used for marking SVG files which use "simplified" code. Such files must have their source code suitable for manual editing. SVG files are simplified by (generally radical) optimization of files created by SVG editors.[3]

The template automatically sets the following categories:

By template {{ValidSVG}} the file is categorized also into Valid SVG created with Text Editor, a hidden subcategory of hidden Valid SVG[clarification needed]

W3CThe source code of this SVG is valid. This link to the validator passes the option to show the SVG coding.

Usage

{{SimplSVG}}

or {{ Image generationsb = size_beforesa = size_actualother parameters as described below }} 0(both parameters: sb and sa)
or {{ Image generation10 = Sother parameters as described below }} (see the documentation) to use the advantages of the template {{Image generation}},

e.g. creation of the Other fields / Information field, for a better and more uniform appearance in the {{Information}} box

or File generation description with parameter "Simplified SVG"[clarification needed]

Deutsch: Mit dem 4. Parameter kann die Kategorisierung gesteuert werden, siehe {{HandSVG}}.
English: Categorization can be controlled by parameter #4, see {{HandSVG}}.
Because just examples are useful and not crowding the categories with each file from a set of similar ones, any such categorization can be suppressed explicitly.[clarification needed]

Another possibility is diffusion to a subcategory by providing parameter #4 with a control character (see explanation at docu of {{HandSVG}}).


The file is categorized as SVG Simplified when:

  • forced by categorization parameters,
    or
  • categorization is not suppressed and both file sizes are specified and the size afterwards is less than a twentieth of the size before.

In all other cases it is categorized as Valid SVG created with Text Editor. To prevent this category from becoming too crowded the (vector software)-assigned subcategory is selected instead, when the software name is specified by parameter #1.

For layout examples see the talk page.

Template parameters

ParameterDescriptionDefaultStatus
1created withThe name of the graphics tool: Inkscape, Sodipodi, Adobe Illustrator, OpenOffice, CorelDRAW, …[clarification needed]emptyoptional
2
sb
size beforeThe size the file had when saved by the graphics tool.
To see file sizes in bytes on description pages, you can use simpleSVGcheck.js.
emptyoptional
3
sa
size actualThe size of the manually edited version
not specified if = 000; see Category:SVG files to be drawn by hand[clarification needed]
emptyoptional
4controlEither uppercase S, M, N, X, or Y
  • S: categorization forced to SVG Simplified
  • M: categorization forced to category of editor as parameter #1
  • N: without explanatory text[clarification needed]
  • X: any categorization is suppressed
  • Y: combines N and X
or a Control letter (see {{HandSVG}}): diffusion into subcategories of SVG Simplified[clarification needed]
emptyoptional
5structured?character "H":[1] it is a high quality structured graphic[clarification needed]emptyoptional
6talk page?character T:[1] an additional explanation points to the file talk page[clarification needed]emptyoptional
7categories (coded)a one-character code[1] for more categories:
SVG simplification by
emptyoptional
useredited byname of editor (person) who simplified the image, either the user name or in wiki code
coded e. g. with {{U}}, {{Uc}}, {{Ut}}, {{Ult}}, {{Ud}} or otherwise
emptyoptional
sub
subcat
subcategory
diffusion in "SVG Simplified"category diffusion: a suffix to the category name depending on parameter #2, e. g. sub=-examples[clarification needed]emptyoptional
sssdiffusion in "structured SVG"more category diffusion: Structured SVG Subcategory, e. g. sss=-examples[clarification needed]emptyoptional
vsubdiffusion in "valid/invalid"diffusion for Valid SVG created with Text Editor / Invalid SVG created with Text Editor
To suppress this subcategorizing set it to minus: vsub=-[clarification needed]
emptyoptional
keysort keysort key within the categoryemptyoptional
widthsets width for the box[clarification needed]autooptional
stylesets or overrides other style attributes for the box.[clarification needed] Setting a value (like "<nowiki/>") prevents the newline which this template adds after itself by default.emptyoptional
topicto specify the short code (e.g. "f" for "flag, "i" for "icon") of a topicemptyoptional
vwidthsets width for the box of {{Valid SVG}} / {{Invalid SVG}}widthoptional
vstyle
vs

to set or overwrite other style attributes for the box of {{Valid SVG}} / {{Invalid SVG}}
e.g. vstyle=float:left, or short vs=fl for also smaller icon


for smallest display use vs=n or vs=- (see examples)
styleoptional
vtextoptional additional text for ValidSVG/InvalidSVG.optional
puprevious user name[clarification needed]emptyoptional
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

This template is used for marking SVG files which use "optimal" code. Such files must have their source code suitable for manual editing. Optimal SVGs are created either manually (see "Created with Text Editor" template) or by (generally radical) optimization/simplification of files created by SVG editors.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
created with1

The name of the [[:Category:Anti vector graphics program logos|graphics tool]]: Inkscape, Sodipodi, Adobe Illustrator, OpenOffice, CorelDRAW, …<sup>[''[[:en:Wikipedia:Please_clarify|clarification needed]]'']</sup>

Stringoptional
size before2 sb

The size the file had when saved by the graphics tool.<br> To see file sizes in bytes on description pages, you can use [[Commons:Scattered scripts#simpleSVGcheck.js|simpleSVGcheck.js]].

Numberoptional
size actual3 sa

The size of the manually edited version; not specified if="000"; see Category:SVG files to be drawn by hand

Numberoptional
control4

Either uppercase S, M, N, X or Y; "X" and "Y": any categorization is suppressed; "M": categorization forced to category of editor as parameter #1; "S": categorization forced to Category:SVG Simplified; "N" or "Y": without explanatory text; or a Control letter (see Template:HandSVG): diffusion into subcategories of Category:SVG Simplified

Stringoptional
structured?5

character <code>H</code>: it is a "high quality structured graphic"

Stringoptional
talk page?6

character "T": an additional explanation points to the file talk page

Stringoptional
categories (coded)7

a one-character code for more categories:

SVG simplification by …
  • a → avoidance
  • b → viewBox
  • c → cloning
  • d → dasharray
  • e → elimination
  • f → fill pattern
  • g → grouping
  • k → clipping
  • l → linecapping
  • p → gradienting
  • % → text embedding
  • t → transforming

Stringoptional
sort keykey

sort key within the category

Stringoptional
pu

previous user name<sup>[''[[:en:Wikipedia:Please_clarify|clarification needed]]'']</sup>

Unknownoptional
diffusion in "structured SVG"sss

more category diffusion: Structured SVG Subcategory, e. g. sss=-examples

Stringoptional
style

sets or overrides other style attributes for the box.<sup>[''[[:en:Wikipedia:Please_clarify|clarification needed]]'']</sup> Setting a value (like "&lt;nowiki/&gt;") prevents the newline which this template adds after itself by default.

Stringoptional
diffusion in "SVG Simplified"sub subcat subcategory

category diffusion: a suffix to the category name depending on parameter #2, e. g. sub=-examples

Stringoptional
topic

to specify the short code (e.g. "f" for "flag, "i" for "icon") of a [[:Template:Igen/top|topic]]

Unknownoptional
edited byuser

name of editor (person) who simplified the image, either user name or in wiki code

Useroptional
vstyle vs

to set or overwrite other style attributes for the box of Valid SVG / Invalid SVG<br>

e.g. vstyle=float:left, or short vs=fl for also smaller icon<br> ----

for ''smallest display'' use vs=n or vs=-

Default
<code>style</code>
Unknownoptional
diffusion in "valid/invalid"vsub

diffusion for "Valid SVG created with Text Editor" / "Invalid SVG created with Text Editor"; To suppress this subcategorizing set it to minus: "vsub=-"

Stringoptional
vtext

optional additional text for ValidSVG/InvalidSVG

Default
<code>.</code>
Unknownoptional
vwidth

sets width for the box of Valid SVG / Invalid SVG

Default
<code>width</code>
Unknownoptional
width

sets width for the box<sup>[''[[:en:Wikipedia:Please_clarify|clarification needed]]'']</sup>

Default
<code>auto</code>
Numberoptional

Additional information

The template is intended to be used in the following namespaces: the File namespace

The template is intended to be used by the following user groups: all users

See also

  1. a b c Any of these parameter values can be passed in any sequence, each as an argument for one of the parameters #5 to #9, in lower or upper case: …|5=T|6=b|7=c… is equivalent to …|7=B|8=t|9=c….[clarification needed]
  2. a b c Jeder dieser Parameterwerte kann beliebig als Argument eines der Parameter #5 bis #9 übergeben werden, in Klein- oder Großbuchstaben: …|5=H|6=b|7=f… ist gleichwertig mit …|5=F|7=h|9=B….
  3. Wikimedia Commons contains hundreds of SVG images that were drawn in vector editors and then edited manually, e.g. for compatibility reasons. Most of them still contain complicated code generated by vector editors. Manual editing itself does not always make a file "optimal".