<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AGetShortDescription%2Fdoc</id>
	<title>Module:GetShortDescription/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AGetShortDescription%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:GetShortDescription/doc&amp;action=history"/>
	<updated>2026-04-21T22:32:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:GetShortDescription/doc&amp;diff=16270847&amp;oldid=prev</id>
		<title>imported&gt;Gonnym at 11:29, 29 August 2024</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:GetShortDescription/doc&amp;diff=16270847&amp;oldid=prev"/>
		<updated>2024-08-29T11:29:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{distinguish|Module:Get short description}}&lt;br /&gt;
{{Module rating|protected}}&lt;br /&gt;
{{High-use}}&lt;br /&gt;
{{Lua|Module:Arguments|Module:Lang}}&lt;br /&gt;
{{info|This module is required by [[Module:Annotated link]].}}&lt;br /&gt;
{{info|This module may, by design, output alarming informational messages under certain circumstances; if these messages are displayed on any page invoking this module directly or via any other module or template using it, the page will be added to [[:Category:Pages displaying alarming messages about Module:GetShortDescription]].}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name= |only= |prefer= |fallback= |lang_italic= |lang_nocat= |lang_size= |lang_cat= |lang_rtl= |lang_no= }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
=== name ===&lt;br /&gt;
By providing only the &amp;#039;&amp;#039;&amp;#039;required&amp;#039;&amp;#039;&amp;#039; page name (including namespace), the module will look for an explicit {{tlx|short description}} in that page, but if not found, will try to fetch the wikidata description. If neither are found, the result will be an empty string.&lt;br /&gt;
&lt;br /&gt;
If the result is a wikidata description, and it is declared (at the source) as being of a foreign language (i.e. not &amp;#039;&amp;#039;en&amp;#039;&amp;#039;), the result will be appropriately formatted by [[Module:Lang]] (the module powering {{tlx|lang}}), in accordance with [[MOS:OTHERLANG]]; see [[#Foreign language wikidata descriptions]] (below).&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Wikipedia}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Wikipedia}}&lt;br /&gt;
This is equivalent to stating {{para|prefer|explicit}}; see [[#prefer]] (below).&lt;br /&gt;
&lt;br /&gt;
=== only ===&lt;br /&gt;
Providing a value for {{para|only}} will limit the search to being only for the stated description. If no description is found, the result will be an empty string, unless a fallback is provided; see [[#fallback]] (below).&lt;br /&gt;
&lt;br /&gt;
==== explicit ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Wikipedia |only=explicit }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Wikipedia|only=explicit}}&lt;br /&gt;
&lt;br /&gt;
==== wikidata ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Wikipedia |only=wikidata }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Wikipedia|only=wikidata}}&lt;br /&gt;
&lt;br /&gt;
=== prefer ===&lt;br /&gt;
Providing a value for {{para|prefer}} will initiate the search for the stated description, but try for the alternative if none is found. If no description is found, the result will be an empty string, unless a fallback is provided; see [[#fallback]] (below).&lt;br /&gt;
&lt;br /&gt;
==== explicit or wikidata ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Wikipedia |prefer=explicit }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Wikipedia |prefer=explicit}}&lt;br /&gt;
&lt;br /&gt;
==== wikidata or explicit ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Wikipedia |prefer=wikidata }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Wikipedia |prefer=wikidata}}&lt;br /&gt;
&lt;br /&gt;
=== fallback ===&lt;br /&gt;
If a value for {{para|fallback}} is provided, and no description is found by the expressed route, the result will be the stated fallback.&lt;br /&gt;
&lt;br /&gt;
==== only or fallback ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Example |only=explicit |fallback=This is a fallback }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Example|only=explicit|fallback=This is a fallback}}&lt;br /&gt;
&lt;br /&gt;
==== prefer or fallback ====&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Markup:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:GetShortDescription|main |name=Example |prefer=wikidata |fallback=This is a fallback }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;Result:&amp;#039;&amp;#039;&amp;#039; {{#invoke:GetShortDescription|main|name=Example|prefer=wikidata|fallback=This is a fallback}}&lt;br /&gt;
&lt;br /&gt;
=== Foreign language wikidata descriptions ===&lt;br /&gt;
Should a wikidata description be retrieved, which is declared (at the source) as being of a foreign language (i.e. not &amp;#039;&amp;#039;en&amp;#039;&amp;#039;), per [[MOS:OTHERLANG]], the return will be formatted as appropriate by Module:Lang by default. This may be disabled with {{para|lang_no|yes}} or adjusted via the parameters for {{tlc|lang}}: {{para|lang_italic}}, {{para|lang_nocat}}, {{para|lang_size}}, {{para|lang_cat}} and {{para|lang_rtl}}; see [[Template:Lang/doc|lang&amp;#039;s documentation]] for details.&lt;br /&gt;
&lt;br /&gt;
== Requiring this module ==&lt;br /&gt;
=== Instances when a table is returned ===&lt;br /&gt;
Providing a value for {{para|objectify_alarm}} will cause alarming messages (red informational messages) to be returned as [[mw:Extension:Scribunto/Lua reference manual#table|tables]].&lt;br /&gt;
&lt;br /&gt;
Providing a value for {{para|report_redlinks}} will cause the return of a report instead of nothing in the event that the page named is nonexistent (i.e. a [[WP:REDLINK]]) and a search for a {{tlc|short description}} template is processed.&lt;br /&gt;
&lt;br /&gt;
A table will also be returned in the event that the module is instructed to {{para|prefer|explicit}} (its default), and returns a Wikidata description. If the reason for there being no explicit short description is because it was set to &amp;#039;&amp;#039;[[WP:SDNONE|none]]&amp;#039;&amp;#039;; the table will include a value for &amp;lt;code&amp;gt;table.none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See below for examples of these behaviors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local getShortDescription = require( &amp;#039;Module:GetShortDescription&amp;#039; ).main&lt;br /&gt;
&lt;br /&gt;
local short_description = getShortDescription( {&lt;br /&gt;
  -- required&lt;br /&gt;
    name = &amp;#039;page name&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
  -- optional&lt;br /&gt;
    prefer = &amp;#039;explicit&amp;#039; or &amp;#039;wikidata&amp;#039;,&lt;br /&gt;
    only = &amp;#039;explicit&amp;#039; or &amp;#039;wikidata&amp;#039;,&lt;br /&gt;
    fallback = &amp;#039;fallback&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
    objectify_alarm = true,&lt;br /&gt;
    report_redlinks = true,&lt;br /&gt;
&lt;br /&gt;
    lang_no = &amp;#039;yes&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
    -- {{lang}} options&lt;br /&gt;
    lang_italic = &amp;lt;yes, no, unset, invert, default&amp;gt;,&lt;br /&gt;
    lang_nocat = &amp;lt;yes, y, true, t, on, 1&amp;gt;,&lt;br /&gt;
    lang_size = &amp;lt;CSS font-size e.g. &amp;#039;1.5em&amp;#039;&amp;gt;,&lt;br /&gt;
    lang_cat = &amp;lt;no, n, false, f, off, 0&amp;gt;,&lt;br /&gt;
    lang_rtl = &amp;lt;no (default), yes&amp;gt;&lt;br /&gt;
} )&lt;br /&gt;
&lt;br /&gt;
-- If we&amp;#039;ve requested to report_redlinks or to objectify_alarm then&lt;br /&gt;
if type( short_description ) == &amp;#039;table&amp;#039; then&lt;br /&gt;
  if short_description.alarm then&lt;br /&gt;
    -- An alarming message has been returned&lt;br /&gt;
    local alarming_message = short_description.alarm&lt;br /&gt;
  elseif short_description.redlink then&lt;br /&gt;
    -- Do something about that&lt;br /&gt;
  elseif short_description.wikidata then&lt;br /&gt;
    -- A Wikidata description was returned without being explicitly requested&lt;br /&gt;
    local wikidata_description = short_description.wikidata&lt;br /&gt;
    if short_description.none then&lt;br /&gt;
      -- Because the explicit short desc was &amp;#039;none&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
[[Category:Modules using data from Wikidata]]&lt;br /&gt;
[[Category:Short description related modules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Gonnym</name></author>
	</entry>
</feed>