Difference between revisions of "Template:Cite APOD"
Jump to navigation
Jump to search
imported>Tom.Reding m (<includeonly></includeonly>) |
imported>Tom.Reding (Sync from live (handle m/mm & mmm/mmmm differently when preceded by year)) |
||
| Line 8: | Line 8: | ||
|url=http://apod.nasa.gov/apod/ap{{#iferror: {{#expr:{{str sub|{{{date|}}}|0|4}} * 1}}|<!-- | |url=http://apod.nasa.gov/apod/ap{{#iferror: {{#expr:{{str sub|{{{date|}}}|0|4}} * 1}}|<!-- | ||
| − | !YMD ( | + | !YMD (yyyy is not in front): -->{{#if:{{{date|}}}|{{str sub|{{date|{{{date|}}}|iso}}|2|2}}{{str sub|{{date|{{{date|}}}|iso}}|5|2}}{{str sub|{{date|{{{date|}}}|iso}}|8|2}}.html}}|<!-- |
| − | Using date=yyyy mmm d | + | Y *is* in front. Now check month: m & mm ok, mmm & mmmm bad. |
| + | -->{{#iferror: {{#expr:{{str sub|{{{date|}}}|5|2}} * 1}}|<!-- | ||
| + | |||
| + | mmm & mmmm bad: | ||
| + | Using date=yyyy mmm d will cause {{cite web}} to emit a "Check date value" message, but the APOD URL (yymmdd) will not be broken after this. | ||
{{date|YMD|iso}} doesn't work, so YMD needs to be reformatted to an acceptable format. | {{date|YMD|iso}} doesn't work, so YMD needs to be reformatted to an acceptable format. | ||
YMD: --> {{#if:{{{date|}}}|<!-- | YMD: --> {{#if:{{{date|}}}|<!-- | ||
| Line 24: | Line 28: | ||
YMD input M-->{{MONTHNUMBER|{{str sub|{{{date|}}}|5|3}}}}-<!-- | YMD input M-->{{MONTHNUMBER|{{str sub|{{{date|}}}|5|3}}}}-<!-- | ||
YMD input D-->{{str rightc|{{{date|}}}|2}}|iso}}<!-- | YMD input D-->{{str rightc|{{{date|}}}|2}}|iso}}<!-- | ||
| − | YMD output D-->|8|2}}.html}} }} | + | YMD output D-->|8|2}}.html}}|<!-- |
| + | |||
| + | m & mm ok: | ||
| + | -->{{#if:{{{date|}}}|{{str sub|{{date|{{{date|}}}|iso}}|2|2}}{{str sub|{{date|{{{date|}}}|iso}}|5|2}}{{str sub|{{date|{{{date|}}}|iso}}|8|2}}.html}} }} }} | ||
|work=[[Astronomy Picture of the Day]] | |work=[[Astronomy Picture of the Day]] | ||
|publisher=[[NASA]] | |publisher=[[NASA]] | ||
Revision as of 12:26, 26 September 2016
File:Test Template Info-Icon - Version (2).svg Template documentation[view] [edit] [history] [purge]
| This template is a Citation Style 1 wrapper template based on {{Cite web}}. For centralised Citation Style 1 discussions, see Help talk:Citation Style 1. |
Usage
This template aids in the creation and standardization of a citation to NASA's Astronomy Picture of the Day (APOD).
The following 3 named parameters are required, which are then passed to {{Cite web}}. Please refer to {{Cite web}} for more detail on each parameter.
|date=is the date the picture appeared on APOD. See {{Cite web}} for acceptable date formats.|title=refers to the title of the|date='s APOD image, which normally appears immediately below the image. Do not use|title=Astronomy Picture of the Day.|access-date=is the date when the|date='s APOD content was last verified.
The following parameters are also accepted, but are not required:
|name-list-style=ampto separate the last author with an ampersand&instead of a semicolon;.|quote=to quote relevant text from the APOD page.|df=to set the date format. See Template:Cite web/doc#Date for accepted values.
Empty horizontal template with all parameters:
{{Cite APOD |date= |title= |access-date= |name-list-style= |quote= |df=}}
Empty vertical template with all parameters:
{{Cite APOD
| date =
| title =
| access-date =
| name-list-style =
| quote =
| df =
}}
|
Examples
{{Cite APOD |date=19 January 2014 |title=Spiral Galaxies in Collision |access-date=20 February 2015 |quote=Quoted text.}}- Nemiroff, R.; Bonnell, J., eds. (19 January 2014). sub%5d%5d%5b%5b:Template:Str sub%5d%5d%5b%5b:Template:Str sub%5d%5d.html "Spiral Galaxies in Collision" Check
|url=value (help). Astronomy Picture of the Day. NASA. Retrieved 20 February 2015.Quoted text.
See also
{{APOD}}— for the non-citation version of this template{{Cite sbdb}}{{Cite simbad}}
| The above documentation is transcluded from Template:Cite APOD/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |