Module:Duration/doc

MyWikiBiz, Author Your Legacy — Friday November 29, 2024
Jump to navigationJump to search

This is the documentation page for Module:Duration

Template:Module rating

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 Template:Clc.

Usage

This template should normally be called through {{Duration}}, and used as Template:((#invoke:Duration|main|duration=durationTemplate:)) when included in other templates.

Valid parameters are numbered parameters 1, 2 and 3, and unnumbered parameters Template:Para, Template:Para, Template:Para and Template:Para. Template:Para should not be used in {{Duration}}, as Template:Para can provide the same function.

The two triplets of parameters accept numbers as inputs (hours, minutes, seconds respectively). Only Template:Para and Template:Para 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.

Template:Para and Template:Para 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 Template:Clc.