Vikipedio:Lua/Moduloj/Ŝablono:Handle/en
Aspekto
Ŝablona programado | Diskutoj | Lua | Testoj | Subpaĝoj | ||||
---|---|---|---|---|---|---|---|---|
Modulo | Esperanto | English | Deutsch
|
Modulo: | Dokumentado |
Ŝablono:Handle
– Module to generate titled external links to web ressources by solver, transcluded by templates.
Template:Handle might be an abstract concept with two instances to be supported:
Functions for templates
[redakti fonton]- f
- Format.
- Parameters from template transclusion:
- 1
- Identifier
- Might be escaped for URL or HTML, but after slash / only.
- Alternatively:
- Result of a previous evaluation; with URL or error message or as wikilink; even nothing.
- problem
1
– show a remark about temporary unavailability- NoCat
1
– suppress general error category defined by errCat this time.- demo
1
– suppress any hiding of error messages this time; e.g. for documentation and examples
- Parameters with
#invoke
for project specific adaption; all butscheme
optional:- scheme
- Code of coverage, mandatory:
doi
hdl
- errCat
- title of an error category for invalid DOI parameter etc.
- errClasses
- classes for selection of error messages; e.g.
error
- errHide
1
– hide error messages by default- errNS
- space separated list of namespace numbers where to use errCat
- default: all pages, all namespaces, if errCat defined
- parProblem
- name of „problem“ parameter – default:
problem
- showArticle
- page name for
doi:
schema link – default:Digital Object Identifier
- empty calue: do not link schema
- Return: external link, or error message, maybe as
class="error"
.
Usage
[redakti fonton]Nowhere than by:
Functions for Lua modules (API)
[redakti fonton]- main(argsF, argsT)
- Interface to unit tests.
- Same parameter tables as f.
- argsF
table; #invoke parameter list- errNS entry may be either string or table of numbers
- argsT
table; template parameter list
- argsF
- Return string with external link, or error message.