မာတိကာသို့ ခုန်သွားရန်

မဝ်ဂျူ:quote/doc

နူ ဝိက်ရှေန်နရဳ

This is the documentation page for မဝ်ဂျူ:quote

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 the quote-* template to call, defaulting to quote-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 underlying quote-* 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 underlying quote-* 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 underlying quote-* template, and |pages= is propagated to the |pages= parameter of the underlying quote-* 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}}.
  • The |usenodot=1 parameter will add a trailing "." to the end of the citation unless |nodot=1 provided in the template call.
  • |ascite=1 will force display using "citation" formatting.
  • |asquote=1 will force display using "quotation" formatting.
  • 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 underlying quote-* template.
  • The |propagateparams= control parameter is a comma-separated list of any additional params to propagate to the underlying quote-* template, so you don't have to manually propagate these parameters. |propagateparams=column,volume is functionally equivalent to writing |column={{{column|}}}|volume={{{volume|}}}
  • 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. If the parameter is omitted, all variables used by the template will be allowed.

This is a method to call a specified quote or citation template while combining the arguments from the parent template with additional arguments provided directly plus arguments passed by the user. This is useful for dynamically reusing templates with modified or additional parameters.

  • The |1= (required) the template to overload.
  • All other named or numbered parameters will be passed directly to the parent template.
  • All user-specified parameters used when calling this template will also be passed through to the parent template and will override any values declared in this template.

To create a {{R:Cite}} citation formatted equivalent from an existing {{RQ:Quote}} quotation template:

{{#invoke:quote|overload
    |RQ:Quote
    |ascite=1
}}

Calling {{R:Cite|page=123}} will display the output of {{RQ:Quote|ascite=1|page=123}}

To create a {{RQ:Author Work}} "specific work" template from an "all in one" {{RQ:Author}} author template that handles user provided |book=, |year=, |chapter=, and |page= values:

{{#invoke:quote|overload
    |RQ:Author
    |book=Storytime
    |year=2010
    |chapter={{{chapter|{{#ifexpr:{{{page|}}}<10 | 1 | 2 }}}}}
}}

Calling {{RQ:Author Work|page=20}} would then be the same as calling {{RQ:Author|book=Storytime|chapter=2|page=20|year=2010}}.