Module:Hms/doc: Difference between revisions
More actions
Created page with "{{Module rating|beta}} {{doc sub}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> == Utterly interesting == *Apparently modules can be called by different names for the same action. I don't know of how they're redirecting modules but recreating them works just as well. This module implements {{tl|Duration}}. It tries to add a microformat to a duration (<code>hh:mm:ss</code> or <code>mm:..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{doc sub}} | {{doc sub}} | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
Line 21: | Line 20: | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
[[Category:Modules]] | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
[[Category:Module documentation pages]] | [[Category:Module documentation pages]] | ||
</noinclude> | </noinclude> |
Latest revision as of 00:36, 1 March 2025
This is a documentation subpage for Module:Hms. It may contain usage information, categories and other content that is not part of the original module page. |
Utterly interesting
- Apparently modules can be called by different names for the same action. I don't know of how they're redirecting modules but recreating them works just as well.
This module implements {{Duration}}. It tries to add a microformat to a duration (hh:mm:ss
or mm:ss
) whenever possible. If the module is unable to add hAudio microformat (and the input does not contain the microformat) then the page will be included in Category:Duration without hAudio microformat (0).
Usage
This template should normally be called through {{Duration}}, and used as {{#invoke:Duration|main|duration=duration}}
when included in other templates.
Valid parameters are numbered parameters 1, 2 and 3, and unnumbered parameters |h=
, |m=
, |s=
and |duration=
. |duration=
should not be used in {{Duration}}, as |1=
can provide the same function.
The two triplets of parameters accept numbers as inputs (hours, minutes, seconds respectively). Only |3=
and |s=
can contain decimals; the others must be integers. The seconds value must not exceed 60, and the minutes value must not exceed 60 if there is an hours value. If the inputs are not recognized as numbers, an error message is returned.
|1=
and |duration=
accept strings. If the string contains a microformat then the string will be returned without modification. Otherwise, the module will attempt to add an hAudio microformat to the first unformatted duration found. If the string contains more than one duration, only the first one will have a microformat added.
Errors are placed in Category:Duration with input error (2).