Module:Val/units/doc: Difference between revisions

Content deleted Content added
Created page with "This where you {{edit|Module:Val/units|configure Val units}}. The list of Val units is published at ''Template:Val/list'', and here is the place that produces that report..."
 
m Text replacement - "[[WP:" to "[[Wikipedia:WP:"
Line 22:
 
 
An entry defining a [[Unit of measurement|unit]] for Val is a single line under a [[Wikipedia:section|section]] heading.<ref>Module pages don't have section editing.</ref> It starts with the '''unit code''', followed by at least two spaces and a [[Wikipedia:WP:wikilink|link]]. If you are adding a group of related units, you can enter a blank line around them to group them in the report at Val/list. An entry is ignored if it lacks at least ''two adjacent space characters''.
 
:<kbd>''code''{{spaces|4}}[<nowiki/>[ ''pagename'' | ''symbol'' ]]</kbd>
Line 33:
 
;unit pagename
:Title or section of an article. When linked with ul or upl, the title or one of its [[Wikipedia:WP:redirect|redirect]]s can expand the abbreviation for the unit.<ref>A redirect page is easy to make; there are tools on the editor toolbars.</ref>
 
;unit symbol
:[[wp:V|Verifiable]], standard symbol, formatted in accordance with [[Wikipedia:WP:UNITS]].
* Templates will not work for producing the unit symbol for input to this module; only [[Wikipedia:HTML#Formatting|Wikipedia HTML formatting]] is accepted.
* Composite units use {{code|&sdot;}} to multiply, {{code|/}} to divide, and {{tag|sup}} for powers. Division is also the unit-inversion form that multiplies a negative numbered power, for example for <kbd>m/s<sup>2</sup></kbd> and <kbd>m&sdot;s<sup>−2</sup></kbd> (from {{code|m.s-2}} and {{code|m/s2}}).
* If the hover-text just shows the abbreviation, it is not a user-friendly unit-symbol. When not linked, the unit's abbreviation can be spelled out with hover-text at the symbol by way of the ''title'' attribute of either {{tag|abbr}} or {{tag|span}}.
* For more about HTML tags and HTML symbols such as {{code|&sdot;}}, see [[Wikipedia:HTML]].
* For more information about marking up your unit symbol see [[Wikipedia:WP:HTML#formatting]].
* Examples of unit codes, and hover text are at [[Template:Val/list]].
 
Line 283:
* Sorting functionality is handled for Val by {{tlf|convert}}.)
 
* At Convert the procedure for defining a unit is much more involved than it is here, because there every unit defined must reference associated units, conversion factors, alternate spellings, and many other attributes. [[Module:Convert/data|An entry at Convert]] is defined as a multi-line, multi-attribute Lua table with its attendant syntax, and inside a larger Lua script. Therefore Convert is more conservative about adding units. Val may be more liberal in this respect if only because unit entry is simpler and "wikified". Therefore [[Wikipedia:WP:Be bold]]. Bold customization may be a worthwhile risk at Val/units, or it may get removed. Although units used in ''articles'' have definite stylistic standards, there remains room for depending on Val for markup (but see [[Wikipedia:WP:Accessibility]] about color, link, and text). You may want to customize some Val unit codes that will automate some Val markup for special articles, the ''talk page'', etc. See [[Wikipedia:WP:HTML#formatting]] for possibilities.
 
== Notes ==