Difference between revisions of "Template:Cite APOD"

From blackwiki
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 (the rule): --> {{#if:{{{date|}}}|{{str sub|{{date|{{{date|}}}|iso}}|2|2}}{{str sub|{{date|{{{date|}}}|iso}}|5|2}}{{str sub|{{date|{{{date|}}}|iso}}|8|2}}.html}}|<!--
+
!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 (the exception to the rule) will cause {{cite web}} to emit a "Check date value" message, but the APOD URL (yymmdd) will not be broken after this.
+
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

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=amp to 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