Difference between revisions of "Template:Cite APOD"

From blackwiki
Jump to navigation Jump to search
imported>Primefac
(TFD closed as Keep (using TFDcloser))
imported>Tom.Reding
(Update from sandbox (allow correct URL creation even if date=YMD given))
Line 1: Line 1:
 
+
{{cite web
<includeonly>{{cite web
 
 
  |editor1-last=Nemiroff
 
  |editor1-last=Nemiroff
 
  |editor1-first=R.
 
  |editor1-first=R.
Line 7: Line 6:
 
  |date={{{date|}}}
 
  |date={{{date|}}}
 
  |title={{{title|}}}
 
  |title={{{title|}}}
  |url=http://apod.nasa.gov/apod/ap{{#if:{{{date|}}}|{{str sub|{{date|{{{date|}}}|iso}}|2|2}}{{str sub|{{date|{{{date|}}}|iso}}|5|2}}{{str sub|{{date|{{{date|}}}|iso}}|8|2}}.html}}
+
  |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}}|<!--
 +
 
 +
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.
 +
{{date|YMD|iso}} doesn't work, so YMD needs to be reformatted to an acceptable format.
 +
YMD: --> {{#if:{{{date|}}}|<!--
 +
YMD input Y-->{{str sub|{{date|{{str sub|{{{date|}}}|0|4}}-<!--
 +
YMD input M-->{{MONTHNUMBER|{{str sub|{{{date|}}}|5|3}}}}-<!--
 +
YMD input D-->{{str rightc|{{{date|}}}|2}}<!--
 +
YMD output Y-->|iso}}|2|2}}<!--
 +
YMD input Y-->{{str sub|{{date|{{str sub|{{{date|}}}|0|4}}-<!--
 +
YMD input M-->{{MONTHNUMBER|{{str sub|{{{date|}}}|5|3}}}}-<!--
 +
YMD input D-->{{str rightc|{{{date|}}}|2}}|iso}}<!--
 +
YMD output M-->|5|2}}<!--
 +
YMD input Y-->{{str sub|{{date|{{str sub|{{{date|}}}|0|4}}-<!--
 +
YMD input M-->{{MONTHNUMBER|{{str sub|{{{date|}}}|5|3}}}}-<!--
 +
YMD input D-->{{str rightc|{{{date|}}}|2}}|iso}}<!--
 +
YMD output D-->|8|2}}.html}} }}
 
  |work=[[Astronomy Picture of the Day]]
 
  |work=[[Astronomy Picture of the Day]]
 
  |publisher=[[NASA]]
 
  |publisher=[[NASA]]
 
  |access-date={{{access-date|{{{accessdate|}}}}}}
 
  |access-date={{{access-date|{{{accessdate|}}}}}}
 
  |quote={{{quote|}}}
 
  |quote={{{quote|}}}
}}</includeonly><noinclude>
+
}}<noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 12:25, 25 September 2016

Nemiroff, R.; Bonnell, J. (eds.). Astronomy Picture of the Day. NASA http://apod.nasa.gov/apod/ap. Missing or empty |title= (help)

Template documentation[view] [edit] [history] [purge]

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