Difference between revisions of "Template:Floruit/doc"

From blackwiki
Jump to navigation Jump to search
(Param. default (TemplateData).)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(127 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!--Categories go at the bottom of this page and interwikis go in Wikidata.-->
+
{{Template shortcut|fl|fl.}}
<!--Partly based on documentation for {{cl|Citation Style 1 templates}}.-->
 
The template {{bxtn|floruit}} (or [[#Redirects|any of its aliases]]) may be used to format the display of time periods or eras during which people, ideas, theories, or political, cultural or religious movements etc., may have been active or popular. It utilizes "fl.", an abbreviation of ''[[floruit]]'' or "flourished" (in [[Latin]]), as a prefix to the relevant date(s). The prefix abbreviation is wikilinked to ''floruit'' by default, but users may employ different or additional display options. Please also see {{slink||Exceptions}} for possible usage exceptions.
 
  
 +
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 
==Usage==
 
==Usage==
 +
'''''Source:''''' <code><nowiki>{{fl.}}</nowiki> 1234</code>, <code><nowiki>{{fl.|1234}}</nowiki></code> ''or'' <code><nowiki>{{fl.|1234|lk=off}}</nowiki></code>
  
===Structure===
+
'''''Result:''''' {{fl.}} 1234, {{fl.|1234}} ''or'' {{fl.|1234|lk=off}}
For presentation purposes only, [brackets] indicate parameter values; variables are {{em|italicized}}.
 
{{csdoc|usage full}}
 
:<code><nowiki>{{floruit|date= </nowiki>{{bxt|or}} [{{var|date-value}}]<nowiki>|ca= |sortable= |pre1= |pre2= |b= |wrap= }}</nowiki></code>
 
{{end}}
 
Copy a blank version to use. All parameter names must be in lowercase. Use the "|" (pipe) character between each parameter. Leading and trailing spaces (&#160;) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. Delete unused parameters. By default, [[Line wrap and word wrap|word wrapping]] is off in template output. See {{slink||Parameters}} for important details.
 
  
===Applicability===
+
This template generates an abbreviation for [[floruit]] ("fl."); by default, it has a mouse-over tooltip explaining its meaning.
This template may be used when exact or complete date information
 
{{Ordered list|list_style_type=lower-alpha|is not required|is not necessary or pertinent|is not reliably known}}
 
[[Floruit|By definition]], the relevant date(s) may be month, year, decade, or century ranges, or may otherwise be inexact or approximate. See [[WP:APPROXDATE]] for additional guidance.
 
  
===Exceptions===
+
===Parameters===
Normally, this template should not be used when exact, complete dates need to be indicated. For example, this template should not be used to show a person's actual birth and death dates, or an organization's actual founding and dissolution dates; however, it may be used in similar cases, when there is no exact, complete, or reliable date information, or when providing such detail is unnecessary.
+
This template supports an optional (first, unnamed) parameter representing a year. For example, {{tlx|fl.|1956}} renders to give {{fl.|1956}}. This differs from <code><nowiki>{{fl.}} 1956</nowiki></code> in that <code><nowiki>{{fl.|1956}}</nowiki></code> puts a [[non-breaking space]] in between the "fl." and the number, which prevents the web browsers from inserting a line break there.
  
==Examples==
+
{{Circa/doc/sortable}}
Some of the following examples may utilize additional, embedded templates, in order to enhance presentation or clarity. Such practice is optional.
 
*{{strong|Decade, prefix wikilinked}}
 
:<code><nowiki>{{floruit|date=2010s}}</nowiki></code>
 
:or
 
:<code><nowiki>{{floruit|2010s}}</nowiki></code>
 
:{{en dash}}{{nbsp}}{{em|Date entered without label}} {{para|date}} ({{em|[[#unnamed|Note1]]}})
 
:Either generates: {{floruit|2010s}}
 
*{{strong|As above, in parentheses}}
 
:<code><nowiki>{{floruit|date=2010s|b=yes}}</nowiki></code>
 
:or
 
:<code><nowiki>{{floruit|2010s|b=yes}}</nowiki></code>
 
:Either generates: {{floruit|2010s|b=yes}}
 
*{{strong|Prefix only, in plain text}}
 
:<code><nowiki>{{floruit|pre2=no}} 2010s</nowiki></code>
 
:Generates: {{floruit|pre2=no}} 2010s
 
:{{en dash}}{{nbsp}}{{em|Please see [[#space|Note2]]}}
 
*{{strong|Parentheses won't display without a}} {{bxt|date}} {{strong|value}}
 
:<code><nowiki>{{floruit|b=yes}} 2010s</nowiki></code>
 
:Generates: {{floruit|b=yes}} 2010s
 
*{{strong|Year range, prefix with tooltip}}
 
:<code><nowiki>{{floruit|date={{dash year|2010|2016}}|pre2=abbr}}</nowiki></code>
 
:Generates: {{floruit|date={{dash year|2010|2016}}|pre2=abbr}}
 
:{{en dash}}{{nbsp}}{{em|Uses}} {{tl|dash year}} {{em|to format year range, but please see [[#sort|Note3]]}}
 
*{{strong|Circa century, prefix wikilinked}}
 
:<code><nowiki>{{floruit|date=21st century CE|ca=yes}}</nowiki></code>
 
:Generates: {{floruit|date=21st century CE|ca=yes}}
 
*{{strong|Sortable, single year, prefix italicized with tooltip, word wrap is on}}
 
:<code><nowiki>{{floruit|date=2016|sortable=yes|pre1=italics|pre2=abbr|wrap=yes}}</nowiki></code>
 
:Generates: {{floruit|date=2016|sortable=yes|pre1=italics|pre2=abbr|wrap=yes}}
 
*{{strong|As above, in parentheses}}
 
:<code><nowiki>{{floruit|date=2016|sortable=yes|pre1=italics|pre2=abbr|b=yes|wrap=yes}}</nowiki></code>
 
:Generates: {{floruit|date=2016|sortable=yes|pre1=italics|pre2=abbr|b=yes|wrap=yes}}
 
  
==Parameters==
+
If the {{para|lk}} (as in "link") parameter  is set to {{para|lk|off}}, then the abbreviation will be rendered as {{fl.|lk=off}} (without a wikilink). Otherwise, the link is displayed. (This can be used to avoid [[WP:Overlinking|overlinking]] when this template is used repeatedly in the body of an article.)
All parameters are optional; please note that some options depend on other parameters.
 
  
===Date formatting parameters===
+
Potential future parameters could add articles to appropriate categories, e.g. [[:Category:Year of birth missing]].
*{{bxtn|date}}{{spaced en dash}}the time period during which the subject is known to have been active or popular. Dated in year(s), decade(s), centuries or other time units, including ranges. Do not wikilink. Not checked for date-formatting errors. May be any one of Wikipedia's [[MOS:DATEFORMAT|acceptable date formats]], but please follow the relevant format established in the article, if any. Depending on the template options used, {{em|this parameter may require a value}}, see {{bxt|sortable}} and {{bxt|title=brackets|1=b}}, below.
 
:{{em|id=unnamed|Note1}}: You may treat parameter {{bxt|date}} as unnamed, and insert only the parameter's desired value.
 
:{{em|id=space|Note2:}} The value of {{bxt|date}} is preceded by a [[thin space]] (&#8201;); if the parameter is not utilized, the displayed output may vary according to the user’s choice of {{nobr|[[whitespace character]](s)}} or other formatting.
 
*{{bxtn|sortable}}{{spaced en dash}}set {{para|sortable|yes}} to format the {{bxt|date}} value(s) so that they are displayed properly within [[WP:TABLESORT|sortable table]]s; {{em|requires a date value}}.
 
:{{em|id=sort|Note3:}} To sort correctly, parameter {{para|sortable}} wraps template {{tl|dts}} around the date value(s); it works best with single-date values. When using {{para|sortable}} {{em|do not}} insert other templates as values to {{bxt|date}}; results may be unpredictable.
 
*{{bxtn|title=circa|1=ca}}{{spaced en dash}}set {{para|ca|yes}} for [[circa]] dates; adds a [[thin space]] (&#8201;) followed by the additional prefix "c.", before the date value.
 
 
 
===Prefix formatting parameters===
 
*{{bxtn|title=prefix font-style|1=pre1}}{{spaced en dash}}use this parameter to {{em|italicize}} the display of the prefix "fl.", by setting {{para|pre1|italics}}.
 
*{{bxtn|title=prefix links|1=pre2}}{{spaced en dash}}alias {{bxtn|lk}}. By default, the prefix is wikilinked to ''[[floruit]]''; use this parameter to change this default by inserting one of the following values:
 
**set {{para|pre2|abbr}} to instead display a [[tooltip]] when the pointer hovers over "fl.", expanding it to "floruit". Tooltip display may depend on browser and/or operating system version.
 
**set {{para|pre2|no}} or {{para|pre2|off}} to display "fl." in plain text; use to avoid [[WP:Overlinking|overlinking]] when this template is used repeatedly in the body of an article; see {{slink|Wikipedia:Manual of Style/Abbreviations|Miscellaneous shortenings}}.
 
 
 
===Other parameters===
 
*{{bxtn|title=brackets|1=b}}{{spaced en dash}}use {{bxt|b}} (brackets) to display the template's output in parentheses "()", by setting {{para|b|yes}}; {{em|requires a date value}}.
 
*{{bxtn|title=word wrap|1=wrap}}{{spaced en dash}}by default, template output displays without word wrapping; to turn word wrap on, set {{para|wrap|yes}}.
 
 
 
==Redirects==
 
<!--This section is linked from within this document ([[MOS:HEAD]])-->
 
{{tl|floruit}} can be replaced with the redirects:
 
*{{tl|fl.}}
 
*{{tl|flor}}
 
*{{tl|flor.}}
 
*{{tl|flourished}}
 
*{{tl|flr}}
 
  
 
==See also==
 
==See also==
*[[Tempore]]
+
* [[Floruit]]
*{{tl|b.}}
+
* [[Circa]]
*{{tl|circa}}
+
* {{tl|Circa}}
*{{tl|reign}}
+
* {{tl|Reign}}
  
==Template data==
+
<includeonly>{{Sandbox other||
{{TemplateDataHeader|floruit}}
 
<templatedata>
 
{
 
"params": {
 
"pre1": {
 
"label": "Prefix style",
 
"description": "Set to \"italics\" to render the prefix 'fl.' in italics",
 
"type": "string"
 
},
 
"pre2": {
 
"aliases": [
 
"lk"
 
],
 
"label": "Prefix links",
 
"description": "Use to change the default display of the prefix 'fl.': \"abbr\" replaces wikilink to 'floruit' with a tooltip; \"no\" or \"off\" renders 'fl.' in plain text",
 
"type": "string",
 
"default": "[[Floruit|fl.]]"
 
},
 
"ca": {
 
"label": "Circa",
 
"description": "Set to \"yes\" for circa date(s)",
 
"type": "string"
 
},
 
"date": {
 
"aliases": [
 
"1"
 
],
 
"label": "Date",
 
"description": "Time-period or era, may be a single date or a range",
 
"type": "string",
 
"suggested": true
 
},
 
"sortable": {
 
"label": "Sortable",
 
"description": "Set to \"yes\" to sort the date correctly within tables; requires a 'date' value",
 
"type": "boolean",
 
"default": "N"
 
},
 
"b": {
 
"label": "Brackets",
 
"description": "Set to \"yes\" to display output in parentheses; requires a 'date' value",
 
"type": "boolean",
 
"default": "N"
 
},
 
"wrap": {
 
"label": "Word wrap",
 
"description": "Set to \"yes\" to turn word wrap on",
 
"type": "boolean",
 
"default": "N"
 
}
 
},
 
"description": "Formats the display of periods of activity or popularity for people, ideas, or movements",
 
"paramOrder": [
 
"date",
 
"ca",
 
"sortable",
 
"pre1",
 
"pre2",
 
"b",
 
"wrap"
 
],
 
"format": "inline"
 
}
 
</templatedata>
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
 
 
<!-- Categories go here and interwikis go in Wikidata. -->
 
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Internal link templates]]
+
[[Category:Time and date abbreviation templates]]
[[Category:Time, date and calendar templates]]
 
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 04:54, 25 April 2020

Usage

Source: {{fl.}} 1234, {{fl.|1234}} or {{fl.|1234|lk=off}}

Result: fl. 1234, fl. 1234 or fl. 1234

This template generates an abbreviation for floruit ("fl."); by default, it has a mouse-over tooltip explaining its meaning.

Parameters

This template supports an optional (first, unnamed) parameter representing a year. For example, {{fl.|1956}} renders to give fl. 1956. This differs from {{fl.}} 1956 in that {{fl.|1956}} puts a non-breaking space in between the "fl." and the number, which prevents the web browsers from inserting a line break there.

If the parameter "sortable=yes" is specified, the template generates invisible text that will cause the output to work in sortable tables, at the cost of causing problems for visually-impaired readers. Compare "Col 1" and "Col 2" in the following table:

Title Col 1 Col 2
Foo 1066 1066
Bar fl. 1510 1510fl. 1510
Baz 1956 1956
Jaz fl. 410 410fl. 410

"Col 1" uses {{Floruit}} 1510, and does not sort correctly. "Col 2" uses {{Floruit|1510|sortable=yes}}, and does sort correctly. This works because {{Floruit|1510|sortable=yes}} inserts an invisible span element at the start of the cell: <span style="display:none;">1510</span>. Although it is not rendered, it is still seen by the sorting code and makes sorting work.

The downside of this approach is that the invisible text is still rendered by screen readers that are used by visually impaired readers, and by text browsers such as Lynx, so the table will become garbled for readers who are using assistive technology or text browsers.

If the |lk= (as in "link") parameter is set to |lk=off, then the abbreviation will be rendered as fl. (without a wikilink). Otherwise, the link is displayed. (This can be used to avoid overlinking when this template is used repeatedly in the body of an article.)

Potential future parameters could add articles to appropriate categories, e.g. Category:Year of birth missing.

See also