Difference between revisions of "Template:MathGenealogy/doc"

From blackwiki
Jump to navigation Jump to search
imported>Lam-ang
(Removed 12 sitelinks migrated to an item on Wikidata)
imported>David Eppstein
(→‎TemplateData: id is not required when it can be found on wikidata)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
 +
{{Uses Wikidata|P549}}
 +
{{Lua|Module:EditAtWikidata}}
  
==Usage==
+
== Usage ==
<pre>{{MathGenealogy|id=38586}}</pre>
+
If the 'name' or 'title' parameter is not supplied, the name shown for the person will be that of the Wikipedia page where the template is included.
Produces:
 
{{MathGenealogy|id=38586}}
 
  
<pre>{{MathGenealogy|id=38586|title=Leonhard  Euler}}</pre>
+
; Unnamed parameters
Produces:
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
{{MathGenealogy|id=38586|title=Leonhard  Euler}}
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
  
If the 'title' parameter is not supplied, the name shown for the person will be that of the Wikipedia page where the template is included.
+
; Named parameters
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | title= ''NAME'' }}</code>
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
+
; Using [[Wikidata]] property {{Property|549}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | title= ''NAME'' }}</code>
 +
 
 +
== Examples ==
 +
 
 +
=== Unnamed parameters ===
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 25274 | Sheila Adele Greibach }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} | 25274 | Sheila Adele Greibach }}
 +
 
 +
; URL
 +
: [https://mathgenealogy.org/id.php?id=25274 https://mathgenealogy.org/id.php?id={{Highlight|25274}}]
 +
 
 +
=== Named parameters ===
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 38586 | name= Leonhard Euler }}</code>
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 38586 | title= Leonhard Euler }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} | id= 38586 | name= Leonhard Euler }}
 +
:* {{{{BASEPAGENAME}} | id= 38586 | title= Leonhard Euler }}
 +
 
 +
; URL
 +
: [https://mathgenealogy.org/id.php?id=38586 https://mathgenealogy.org/id.php?id={{Highlight|38586}}]
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
; Output
 +
:* {{ {{BASEPAGENAME}} }}
 +
 
 +
==TemplateData==
 +
<templatedata>
 +
{
 +
"params": {
 +
"id": {
 +
"aliases": [
 +
"1"
 +
],
 +
"label": "id",
 +
"description": "Mathematics Genealogy Project id",
 +
"type": "number"
 +
},
 +
"title": {
 +
"aliases": [
 +
"name",
 +
"2"
 +
],
 +
"label": "title",
 +
"description": "optional display title",
 +
"type": "string"
 +
}
 +
},
 +
"description": "Mathematics Genealogy Project link",
 +
"format": "inline"
 +
}
 +
</templatedata>
 +
 
 +
<includeonly>{{Sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
[[Category:Mathematics source templates]]
 
[[Category:Mathematics source templates]]
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
 
+
[[Category:External link templates using Wikidata]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 01:43, 16 October 2020

Template:Uses Wikidata

Usage

If the 'name' or 'title' parameter is not supplied, the name shown for the person will be that of the Wikipedia page where the template is included.

Unnamed parameters
{{MathGenealogy | ID }}
{{MathGenealogy | ID | NAME }}
Named parameters
{{MathGenealogy | id= ID }}
{{MathGenealogy | id= ID | name= NAME }}
{{MathGenealogy | id= ID | title= NAME }}
Using Wikidata property Template:Property
{{MathGenealogy}}
{{MathGenealogy | name= NAME }}
{{MathGenealogy | title= NAME }}

Examples

Unnamed parameters

Usage
* {{MathGenealogy | 25274 | Sheila Adele Greibach }}
Output
URL
https://mathgenealogy.org/id.php?id=25274

Named parameters

Usage
* {{MathGenealogy | id= 38586 | name= Leonhard Euler }}
* {{MathGenealogy | id= 38586 | title= Leonhard Euler }}
Output
URL
https://mathgenealogy.org/id.php?id=38586

No parameters and Wikidata property not defined

Usage
* {{MathGenealogy}}
Output

TemplateData

Mathematics Genealogy Project link

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
idid 1

Mathematics Genealogy Project id

Numberoptional
titletitle name 2

optional display title

Stringoptional