Jump to content

Module:Authority control/config/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MSGJ (talk | contribs) at 09:18, 2 February 2023 (create). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Contains configuation details for Module:Authority control. The syntax for the p.config table is as follows:

  • Codename for identifier
  • property = Wikidata property number, without the prefix P.
  • section = section number to place the identifier. See the p.sectionNames table for details.
  • pattern = Lua pattern of valid format for identifier. Note this is similar but not identical to a regular expression. If this is omitted, then the module will not check the validity of the identifiers.
  • link = the URL of the external page with details of the identifier. The code $1 will be replaced with the identifier.
  • label = the label for the link.
  • remark = a brief explanation of the authority control database, for use on the documentation of Template:Authority control only.

Optional parameters

  • patterns = if more than one Lua pattern is needed, then use the plural form of this argument and include the comma-separated list of patterns enclosed by curly braces.
  • prefix = a prefix to be included before the links. In this case numbers 1, 2, ... will be used as the labels and the label field will be ignored.
  • valid = a custom Lua function (without the p. prefix) to determine if the identifier is valid or not, in case the pattern method cannot be used. It should return false if the identifier is invalid.
  • idlink = link for the identifier
  • link2 = a custom Lua function to produce the entire external link. It should return false if the identifier is invalid.
  • suppressedbyproperty = if this identifier should not be displayed if other identifiers are present, then specify them here in a comma-separated list enclosed by curley braces.

Example

{'DIB',
	property = 6829,
	section = 5,
	pattern = '^0[01]%d%d%d%d%.?[A-D]?$',
	link = 'https://doi.org/10.3318/dib.$1.v1',
	label = 'Ireland',
},