Jump to content

From Noumenapedia
Revision as of 19:11, 8 August 2026 by wikipedia>HouseBlaster (more clear)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Wikisource/doc

__EXPECTED_UNCONNECTED_PAGE__

This is a versatile template which links to a source at one of our sister projects, Wikisource.

{{Wikisource|<link target>|<link display>|lang=<lang code>|has=<text to introduce the link>|nocat=yes to disable categorization|italics=yes to display the source in italics}}

Its behavior can be modified in the following ways:

To modify the link target, include the name of the document at Wikisource as the first parameter, or as <syntaxhighlight lang="wikitext" inline style="display: none;" />|wslink=:

{{Wikisource|Magna Carta}} and {{Wikisource|wslink=Magna Carta}}

both produce:

Modifying the display text

The second parameter is the display text:

{{Wikisource|The Velveteen Rabbit#9|Name for The Velveteen Rabbit}}

produces:

You can alternatively use <syntaxhighlight lang="wikitext" inline style="display: none;" />|title=, which has the same effect. This can be handy if you only want to alter the display text, not the link target.

Linking to another language's Wikisource

To link to another language's Wikisource, you can either use the <syntaxhighlight lang="wikitext" inline style="display: none;" />|lang= parameter, or you can put the language before the source links.

{{Wikisource|la|Magna Carta|Magna Carta in Latin}}

and

{{Wikisource|Magna Carta|Magna Carta in Latin|lang=la}}

both produce:

Modifying the introductory text

The <syntaxhighlight lang="wikitext" inline style="display: none;" />|has= parameter overrides the text following the word "has" introductory text text: {{Wikisource|Magna Carta|has=the full text of the Magna Carta}}

produces:

Works by or about something

The <syntaxhighlight lang="wikitext" inline style="display: none;" />|works= parameter has four values, all of which indicate that the source at Wikisource is by or about the subject matter. It can be set to any case-insensitive version of:

  • by
  • about
  • both (or equivalently and)
  • or (discouraged; please be specific about what text is present at Wikisource)

If given anything else, the parameter is ignored. The parameter has no viable effect if <syntaxhighlight lang="wikitext" inline style="display: none;" />|has= is provided (see § Modifying the introductory text), but will change the link target to include an Author prefix (or the equivalent namespace used in the language version, according to {{Wikisource/Author}}).

For example, {{Wikisource|Author:Marcus Tullius Cicero|Cicero|works=both}} produces:

Wikidata

If the template is not given a link target, it will attempt to find an interwiki link from Wikidata. If no Wikidata link is found, it will search Wikisource for the Wikipedia article's title.

Categorisation

If no Wikidata link is found, the template will populate Category:Wikisource templates with missing id (2). If the lack of interwiki link is intentional, add <syntaxhighlight lang="wikitext" inline style="display: none;" />|nocat=yes.

The following error categories are not turned off with <syntaxhighlight lang="wikitext" inline style="display: none;" />|nocat=yes:

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Wikisource in articles based on its TemplateData.

TemplateData for Wikisource

<templatedata> { "params": { "1": { "label": "Link target", "description": "The link target, without any Wikisource: or language prefix", "example": "Magna Carta", "type": "line", "suggested": true, "aliases": [ "wslink", "wislink" ] }, "2": { "label": "Display text", "description": "The link's display text", "example": "Full text of the Magna Carta", "type": "line", "default": "The link target", "aliases": [ "title" ] }, "nocat": { "description": "If true, disables categorisation in . This is useful if the omission of a sitelink at Wikidata is intentional.", "type": "boolean", "default": "false" }, "position": { "label": "position", "description": "If set to \"left\", displays the box floats to the left", "type": "line", "suggestedvalues": [ "left" ] }, "has": { "label": "Has text replacement", "description": "The text following \"Wikisource has\" ...", "example": "the full text of the Magna Carta", "type": "line", "default": "text related to this article" }, "lang": { "label": "Language code", "description": "The ISO 639 code of the Wikisource language. \"mul\" indicates the Multilingual Wikisource.", "example": "es", "type": "line", "suggestedvalues": [ "mul", "es", "la", "fr", "de" ], "default": "en" }, "italic": { "label": "italics", "description": "If true, displays the source in italics", "type": "boolean", "default": "false", "aliases": [ "italics" ] }, "works": { "description": "This parameter indicates that the content at Wikisource is by/about the subject, rather than a copy of the subject. Can be set to \"by\", \"about\", or \"both\", or \"or\", depending on what type of content is present at Wikisource. Other values are ignored.", "type": "line", "suggestedvalues": [ "by", "about", "both", "or", "and" ], "label": "Works by" }, "diagnose": { "label": "Run diagnostics", "description": "If true, displays some diagnostic information. Useful for debugging.", "type": "boolean" } }, "paramOrder": [ "lang", "1", "2", "has", "works", "position", "nocat", "italic", "diagnose" ] } </templatedata>

See also