Module:quote/documentation
Introduction
[සංස්කරණය]This module provides the underlying implementation of quote-* templates such as {{quote-book}}, {{quote-journal}} and {{quote-web}}. These templates themselves are implemented using template code which calls this module using {{#invoke:quote|quote_t}}. The module also implements a higher-level interface onto the quote-* templates using {{#invoke:quote|call_quote_template}} (documented below) to simplify writing work-specific quotation templates such as {{RQ:Ascham Scholemaster}} and {{RQ:Shakespeare Titus Andronicus}}. It also provides the implementation of {{quote-meta/paramdoc}} to simplify writing documentation for work-specific quotation templates.
call_quote_template
[සංස්කරණය]This is an interface onto quote-* templates such as {{quote-book}}. See {{RQ:Ascham Scholemaster}} for an example. If you write the code the way of this example, it automatically handles |text=, |passage=, |footer=, |brackets= and |authorlink=, and optionally |page= and |pages=. This means you don't have to propagate them explicitly. In general, any arguments given directly to {{#invoke:quote|call_quote_template}} are passed directly to the underlying quote-* template (usually {{quote-book}}), except for the control parameters given below. In addition, certain other arguments are automatically propagated from the outer template (e.g. the call to {{RQ:Ascham Scholemaster}}) to the underyling template (e.g. {{quote-book}}). Specifically:
- The
|template=control parameter specifies the name of thequote-*template to call, defaulting toquote-book. - The
|textparam=control parameter controls the propagation of the|text=and|passage=parameters and any synonyms. If not given,|text=and|passage=(preferring the former) are passed to the|passage=parameter of the underlyingquote-*template. If given, it should be a comma-separated list of parameters that are synonyms for|text=/|passage=; if neither of these is seen, the specified parameters are passed to the|passage=parameter of the underlyingquote-*template (processed from left to right if multiple synonyms are given). Specifying|textparam=-disables propagation of|text=and|passage=. - The
|pageparam=control parameter controls the propagation of the|page=and|pages=parameters and any synonyms. If not given, neither parameter is propagated. If given,|page=and any synonymous parameters specified by|pageparam=(a comma-separated list of parameters) are propagated to the|page=parameter of the underlyingquote-*template, and|pages=is propagated to the|pages=parameter of the underlyingquote-*template. If there are no synonyms for|page=, but the propagation behavior is still desired, just specify|pageparam=page. - The
|brackets=parameter is automatically propagated. - The
|footer=parameter is automatically propagated and surrounded by a call to{{small}}. - If a value for
|author=is given to{{#invoke:quote|call_quote_template}}, and no value for|authorlink=is given, and the value given for|author=does not have any links or HTML in it, it is propagated to the|authorlink=parameter of the underlyingquote-*template. - The
|propagateparams=control parameter is a comma-separated list of any additional params to propagate to the underlyingquote-*template, so you don't have to manually propagate these parameters. - The
|allowparams=control parameter lists the parameters that are allowed in the outer template (e.g.{{RQ:Ascham Scholemaster}}), in addition to those mentioned above. It should be a comma-separated list of parameters. Parameters not listed and not handled specially will cause an error if given. This allows for parameter checking. If the value is*, parameter checking is disabled.