Difference between revisions of "Template:Include-USGov/testcases"
imported>Hike395 (→Tests: alter behavior) |
imported>Hike395 (→Tests: add title argument tests) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 7: | Line 7: | ||
* comment (optional) - free field that produces parenthesized comment at end | * comment (optional) - free field that produces parenthesized comment at end | ||
* article (optional) - the title of the reference | * article (optional) - the title of the reference | ||
| − | |||
| − | |||
* source (optional) - free field at end at shuts off most other arguments: useful for inline use of {{tl|cite web}} | * source (optional) - free field at end at shuts off most other arguments: useful for inline use of {{tl|cite web}} | ||
| + | |||
| + | Template takes any parameter specified by {{tl|cite web}} as long as article and url are specified (article gets mapped to cite web title) | ||
==Tests== | ==Tests== | ||
| Line 44: | Line 44: | ||
| {{Include-USGov/sandbox|agency=United States Department|url=http://www.agency.gov}} | | {{Include-USGov/sandbox|agency=United States Department|url=http://www.agency.gov}} | ||
| Url without agency is just a bare link | | Url without agency is just a bare link | ||
| + | |- | ||
| + | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| + | <nowiki>|agency=United States Department</nowiki><br> | ||
| + | <nowiki>|url=http://www.agency.gov/}}</nowiki><br> | ||
| + | <nowiki>|comment=comment}}</nowiki> | ||
| + | | {{Include-USGov|agency=United States Department|url=http://www.agency.gov/|comment=comment}} | ||
| + | | {{Include-USGov/sandbox|agency=United States Department|url=http://www.agency.gov/|comment=comment}} | ||
| + | | Url with comment should still work | ||
|- | |- | ||
| <nowiki>{{Include-USGov</nowiki><br/> | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| Line 51: | Line 59: | ||
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document}} | | {{Include-USGov/sandbox|agency=United States Department|article=Reference document}} | ||
| With article argument, template refers to specific document | | With article argument, template refers to specific document | ||
| + | |- | ||
| + | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| + | <nowiki>|agency=United States Department</nowiki><br/> | ||
| + | <nowiki>|title=Reference document}}</nowiki> | ||
| + | | {{Include-USGov|agency=United States Department|title=Reference document}} | ||
| + | | {{Include-USGov/sandbox|agency=United States Department|title=Reference document}} | ||
| + | | {{para|title}} as alternative to {{para|article}} | ||
|- | |- | ||
| <nowiki>{{Include-USGov</nowiki><br/> | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| Line 59: | Line 74: | ||
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html}} | | {{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html}} | ||
| With article argument, url becomes external link to specific document | | With article argument, url becomes external link to specific document | ||
| + | |- | ||
| + | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| + | <nowiki>|agency=United States Department</nowiki><br/> | ||
| + | <nowiki>|title=Reference document</nowiki><br/> | ||
| + | <nowiki>|url=http://www.agency.gov/doc.html}}</nowiki> | ||
| + | | {{Include-USGov|agency=United States Department|title=Reference document|url=http://www.agency.gov/doc.html}} | ||
| + | | {{Include-USGov/sandbox|agency=United States Department|title=Reference document|url=http://www.agency.gov/doc.html}} | ||
| + | | {{para|title}} as alternative to {{para|article}} | ||
|- | |- | ||
| <nowiki>{{Include-USGov</nowiki><br/> | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| Line 107: | Line 130: | ||
|{{Include-USGov/sandbox|agency=United States Department|source={{cite book|first=John |last=Smith |title=Battle of Hastings}} }} | |{{Include-USGov/sandbox|agency=United States Department|source={{cite book|first=John |last=Smith |title=Battle of Hastings}} }} | ||
|Example of source usage | |Example of source usage | ||
| + | |- | ||
| + | |<nowiki>{{Include-USGov</nowiki><br/> | ||
| + | <nowiki>|agency=United States Department</nowiki><br/> | ||
| + | <nowiki>|source={{cite book|first=John |last=Smith |title=Battle of Hastings}}|comment=1066}}</nowiki> | ||
| + | |{{Include-USGov|agency=United States Department|source={{cite book|first=John |last=Smith |title=Battle of Hastings}}|comment=1066}} | ||
| + | |{{Include-USGov/sandbox|agency=United States Department|source={{cite book|first=John |last=Smith |title=Battle of Hastings}}|comment=1066}} | ||
| + | |Source plus comment | ||
|- | |- | ||
|<nowiki>{{Include-USGov</nowiki><br/> | |<nowiki>{{Include-USGov</nowiki><br/> | ||
Latest revision as of 04:51, 9 March 2020
| This is the template test cases page for the sandbox of Template:Include-USGov. Script error: No such module "Purge". to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki, see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
- agency (required) - name of agency (or reference source) that produced material
- url (optional) - URL of reference
- policy (optional) - URL of re-use policy of agency or reference source
- comment (optional) - free field that produces parenthesized comment at end
- article (optional) - the title of the reference
- source (optional) - free field at end at shuts off most other arguments: useful for inline use of {{cite web}}
Template takes any parameter specified by {{cite web}} as long as article and url are specified (article gets mapped to cite web title)
Tests
| Code | Working template | Sandbox version | Comments |
|---|---|---|---|
| {{Include-USGov |agency=United States Department}} |
Minimal usage: templates that call this one should pass in optional arguments. | ||
| {{Include-USGov |agency=United States Department |
Replace internal wikilink about generic re-use to specific agency policy | ||
| {{Include-USGov |agency=United States government |
comment is a free field that produces a parenthesized comment at end, agency should auto-wikilink | ||
| {{Include-USGov |agency=United States Department |
Url without agency is just a bare link | ||
| {{Include-USGov |agency=United States Department |
Url with comment should still work | ||
| {{Include-USGov |agency=United States Department |
With article argument, template refers to specific document | ||
| {{Include-USGov |agency=United States Department |
|title= as alternative to |article=
| ||
| {{Include-USGov |agency=United States Department |
With article argument, url becomes external link to specific document | ||
| {{Include-USGov |agency=United States Department |
|title= as alternative to |article=
| ||
| {{Include-USGov |agency=United States Department |
Author can be added for use in inline citation | ||
| {{Include-USGov |agency=United States Department |
Accessdate can be added, also | ||
| {{Include-USGov |agency=United States Department |
All parameters can work together | ||
| {{Include-USGov |agency=United States government |
Source parameter shuts down most arguments, leaves free field at end for citation template | ||
| {{Include-USGov |agency=United States Department |
Example of source usage | ||
| {{Include-USGov |agency=United States Department |
Source plus comment | ||
| {{Include-USGov |agency=United States Department |
Blank source leaves other parameters active |