This template aids building magic word templates for interactive assistants, by parsing the current page name according to certain assistant-page naming conventions.

လွင်ႈၸႂ်ႉတိုဝ်း

မႄးထတ်း

Call this template within the magic word, specifying a template to pass the parse information to.

  • t — required — the template to which to pass the parse information. Omit prefix Template:.

There are three ways to use a specified name instead of the current page name, using unnamed parameters.

  • Specify the name of a page that is part of an assistant.
  • Specify the name of a global assistant (without the Assistant: prefix).
  • Specify the parent page of a local assistant, and the name of the assistant (without the Assistant: prefix).

The following parameters are passed to t; any other named parameters passed to here are passed through to t via Module:TScope#drop.

  • name — The field of the page name that starts with Assistant:.
  • space — The namespace of the page name; no colon.
  • subpage — The part of the page name after name, if any; no leading slash.
  • full — The entire page name that was parsed.
  • parent — The part of the page name before name, if not ဝီႇၶီႇပပ်ႉ:. No trailing slash.

This template is designed so it can be substituted (via subst:) as well as transcluded (though this won't help if the template named by parameter t doesn't also support substitution).

တူဝ်ယၢင်ႇ

မႄးထတ်း
page name parse information

ဝီႇၶီႇပပ်ႉ:Assistant:Breadboard

name: Assistant:Breadboard
space: ဝီႇၶီႇပပ်ႉ
subpage:
full:   ဝီႇၶီႇပပ်ႉ:Assistant:Breadboard
parent:

Template:Assistant:Dwim/foo/bar

name: Assistant:Dwim
space: ထႅမ်းပလဵတ်ႉ
subpage: foo/bar
full:   Template:Assistant:Dwim/foo/bar
parent:

Category:Assistant:Dwim/quux/baz

name: Assistant:Dwim
space: ပိူင်ထၢၼ်ႈ
subpage: quux/baz
full:   Category:Assistant:Dwim/quux/baz
parent:

User:Pi zero/Assistant:Dwim/fnord

name: Assistant:Dwim
space: ၽူႈၸႂ်ႉတိုဝ်း
subpage: fnord
full:   User:Pi zero/Assistant:Dwim/fnord
parent: ၽူႈၸႂ်ႉတိုဝ်း:Pi zero

Breadboard

name: Assistant:Breadboard
space: ဝီႇၶီႇပပ်ႉ
subpage:
full:   ဝီႇၶီႇပပ်ႉ:Assistant:Breadboard
parent:

ဝီႇၶီႇပပ်ႉ:Reference desk/query
Citation

name: Assistant:Citation
space: ဝီႇၶီႇပပ်ႉ
subpage:
full:   ဝီႇၶီႇပပ်ႉ:Reference desk/query/Assistant:Citation
parent: ဝီႇၶီႇပပ်ႉ:Reference desk/query

ၽၢႆႇၼႂ်း

မႄးထတ်း

Magic word templates that use {{ASST}} cannot call each other, as it would cause {{ASST}} to call itself; however, the client subtemplates t can call each other.

The main template is mostly concerned with figuring out what page name is to be parsed; the page name is then passed to subtemplate {{ASST/parse}}, along with additional information gathered through subtemplate {{ASST/find}}.

With no unnamed parameters, uses the name of the current page. With one unnamed parameter, if it has multiple fields or an Assistant: prefix, it's taken to be the page name, otherwise it's the global assistant name and is used to derive a suitable page name. With two unnamed parameters, the second must be suitable as a local assistant name, and both parameters are used to derive a suitable page name.

The alternative parameter arrangements —where an assistant name is specified instead of a page name— are provided because without them, the magic word templates would not relieve the user of having to continually recreate the assistant-page-naming conventions.

တူၺ်းပႃး

မႄးထတ်း