Ref:Abe's Origins: Difference between revisions
m (Re-arranged citations within the page-processing lines, using Extension:Variables; updated documentation to reflect changes) |
m (Fixed bugs with unnecessary full stops, empty page list appearing after book title, and ‘unrecognized word’ error message, by removing strings from #ifexpr parser function input parameter.) |
||
Line 6: | Line 6: | ||
| datetime = 2019-12-16 | | datetime = 2019-12-16 | ||
| bold = {{{bold|true}}} | | bold = {{{bold|true}}} | ||
}} | }}<noinclude>The following nested parser functions check if a chapter title can confidently be included based on the page number.</noinclude> | ||
{{#if: {{{p|}}} | {{#if: {{{p|}}} | ||
| {{#ifexpr: {{{p}}} >= 8 | | {{#ifexpr: {{{p}}} >= 8 | ||
Line 151: | Line 145: | ||
}} | }} | ||
}} | }} | ||
{{# | {{#ifeq:{{#var:headingTitle}}|0| | ||
| ‘<cite class="book-heading">{{#var:headingTitle}}</cite>’{{#if: {{{p|}}} | | ‘<cite class="book-heading">{{#var:headingTitle}}</cite>’{{#if: {{{pp|}}} | ||
| , <abbr title="pages">pp.</abbr> {{{pp}}} | |||
| , <abbr title="page">p.</abbr> {{{p}}} | |||
}}{{#vardefine:pagePrinted|1}}. | |||
}} | |||
{{#ifeq:{{#var:chapterTitle}}|0| | |||
| ‘<cite class="{{#var:chapterTitle}}</cite>’{{#ifexpr:{{#var:questionPrinted}} | |||
| , <abbr title="question{{#var:questionPrinted}} | |||
}}{{#ifexpr:{{#var:pagePrinted}} = 0 | |||
| {{#if: {{{pp|}}} | | {{#if: {{{pp|}}} | ||
| , <abbr title="pages">pp.</abbr> {{{pp}}} | | , <abbr title="pages">pp.</abbr> {{{pp}}} | ||
Line 159: | Line 161: | ||
}}. | }}. | ||
}} | }} | ||
<cite class="book AbesOrigins">Oddworld: Abe's Origins</cite>{{#if: {{{p|}}} | |||
| {{#ifexpr:{{#var:pagePrinted}} = 0 | |||
| {{#if: {{{pp|}}} | | {{#if: {{{pp|}}} | ||
| , <abbr title="pages">pp.</abbr> {{{pp}}} | | , <abbr title="pages">pp.</abbr> {{{pp}}} | ||
| , <abbr title="page">p.</abbr> {{{p}}} | | , <abbr title="page">p.</abbr> {{{p}}} | ||
}}{{#vardefine:pagePrinted|1}} | }}{{#vardefine:pagePrinted|1}} | ||
}} | |||
}}. | }}. | ||
{{#if: {{{quote|}}} | {{#ifeq: {{{quoteMarks|single}}} | double |“|‘}}<q>{{{quote}}}</q>{{#ifeq: {{{quoteMarks|single}}} | double |”|’}} }} | {{#if: {{{quote|}}} | {{#ifeq: {{{quoteMarks|single}}} | double |“|‘}}<q>{{{quote}}}</q>{{#ifeq: {{{quoteMarks|single}}} | double |”|’}} }} | ||
East Grinstead, United Kingdom: Independent By Design. | East Grinstead, United Kingdom: Independent By Design. | ||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude>This reference template is used to easily reference the art book <cite class="book AbesOrigins">[[Oddworld: Abe's Origins]]</cite>. To use it, place it inside a <code><nowiki><ref></nowiki></code> element in the reference list. | ||
This reference template is used to easily reference the art book <cite class="book AbesOrigins">[[Oddworld: Abe's Origins]]</cite>. To use it, place it inside a <code><nowiki><ref></nowiki></code> element in the reference list. | |||
<pre> | <pre> |
Latest revision as of 12:30, 16 February 2025
This reference template is used to easily reference the art book Oddworld: Abe's Origins. To use it, place it inside a <ref>
element in the reference list.
<ref name="Name of the reference"> {{ref:Abe's Origins | parameter1 = value1 | parameter2 = value2 }} </ref>
Parameters
This template takes the following parameters. There are no parameters that are required.
bold
- Defaults to the value of
true
if not specified. The only value that overwrites this is the value offalse
, which causes the reference header to be rendered with no extra weight. This is useful if theref:Abe's Origins
template is used within a larger reference, such as when citing a specific work within the book. q
- If included, adds a single question number after the chapter title, as long as the chapter is ‘Lorne Lanning’. Ignored if
qq
is set. qq
- If included, adds a range or sequence of question numbers after the chapter title, as long as the chapter is ‘Lorne Lanning’. If set,
q
is ignored. p
- If included, adds two things to the reference. Firstly, it adds a single page number after the most specific citation in the reference. (If the question number(s) are displayed after the chapter title ‘Lorne Lanning’, the page number comes afterwards.) Secondly, as long as the page is 8 or over, it automatically adds the titles of the sections of the book that page is in. Partially ignored if
pp
is set:pp
will overwrite the page numbers if set, butp
is still required to add the section titles. pp
- If included, adds a range or sequence of page numbers after the most specific citation in the reference. (If the question number(s) are displayed after the chapter title ‘Lorne Lanning’, the page numbers come afterwards.) If set, overwrites the page number set by
p
, butp
is still required to add the section titles. Thus, ifpp
is set,p
should equal the first page in the value ofpp
, but there is no internal check of this. quote
- Used to include a quote between the chapter title and the publisher. Only do this if it is particularly important to the context of the reference, and only if it is a short quote with no carriage returns.
quoteMarks
- Defines how many quotation marks are used to delimit the quote. Does nothing if there is no quote. Defaults to the value of
single
if not specified. The only value that overwrites this is the value ofdouble
. Only set the value todouble
if the quote itself contains single quotation marks, and those single quotation marks are the outermost quotation marks used in the quote. Do not count apostrophes as single quotation marks.
If both of either q
or qq
, and either p
or pp
are set, the question number(s) will appear before the page number(s). If the question number(s) are set, p
should logically be between 10 and 41 inclusive, although there is no automatic verification for this, and no error if it is not.