Difference between revisions of "Template:Cite APOD"
Jump to navigation
Jump to search
imported>Primefac (TFD closed as Keep (using TFDcloser)) |
imported>Tom.Reding m (Rm dup param) |
||
| (15 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
<includeonly>{{cite web | <includeonly>{{cite web | ||
|editor1-last=Nemiroff | |editor1-last=Nemiroff | ||
| Line 7: | Line 6: | ||
|date={{{date|}}} | |date={{{date|}}} | ||
|title={{{title|}}} | |title={{{title|}}} | ||
| − | |url= | + | |url=https://apod.nasa.gov/apod/ap{{#iferror: {{#expr:{{str sub|{{{date|}}}|0|4}} * 1}}|<!-- |
| + | |||
| + | !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}}|<!-- | ||
| + | |||
| + | 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|yyyy mmm d|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}}<!-- | ||
| + | Finish URL-->.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]] | ||
|access-date={{{access-date|{{{accessdate|}}}}}} | |access-date={{{access-date|{{{accessdate|}}}}}} | ||
|quote={{{quote|}}} | |quote={{{quote|}}} | ||
| + | |name-list-style={{{name-list-style|}}} | ||
| + | |df={{{df|}}} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> | ||
Latest revision as of 15:42, 20 November 2020
| 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. |