Template:BookShortcut: Difference between revisions

From Guild of Recappers & Podcasters
Jump to navigation Jump to search
No edit summary
(Fixed quotation marks for episode titles switch)
(10 intermediate revisions by the same user not shown)
Line 2: Line 2:
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | cs = ''[https://colinsmythe.co.uk/terry-pratchett/discworld/discworld-novels/{{#replace: {{lc:{{{3|{{{1}}}}}}}}|<nowiki> </nowiki>|-}} {{{1}}}]''
   | cs = ''[https://colinsmythe.co.uk/terry-pratchett/discworld/discworld-novels/{{{3|{{lc:{{#replace: {{{1}}}|<nowiki> </nowiki>|-}}}}}}} {{{1}}}]''
  | apf = ''[https://www.lspace.org/books/apf/{{{3|{{lc:{{#replace: {{{1}}}|<nowiki> </nowiki>|-}}}}}}}.html {{{1}}}]''
  | ep = “{{{1}}}”
  | dop = “[[{{{1}}} (DOP)|{{{1}}}]]”
  | wsp = “[[{{{1}}} (WSP)|{{{1}}}]]”
  | tcd = “[[{{{1}}} (TCD)|{{{1}}}]]”
  | dcp = “[[{{{1}}} (DCP)|{{{1}}}]]”
  | nobc = “[[{{{1}}} (NOBC)|{{{1}}}]]”
  | uap = “[[{{{1}}} (UAP)|{{{1}}}]]”
  | nrd = “[[{{{1}}} (NRD)|{{{1}}}]]”
   | ''[[{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ''[[{{{3|{{{1}}}}}}|{{{1}}}]]''
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Line 13: Line 22:


* The '''Title''' is the title of the book, and is always required. If this is the only parameter, it will produce a local link - e.g. <nowiki>{{BookShortcut|Diggers}}</nowiki> produces: {{BookShortcut|Diggers}}
* The '''Title''' is the title of the book, and is always required. If this is the only parameter, it will produce a local link - e.g. <nowiki>{{BookShortcut|Diggers}}</nowiki> produces: {{BookShortcut|Diggers}}
* The '''Destination''' parameter is required if linking externally to one of the defined alternate locations; the list below documents these. e.g. <nowiki>{{BookShortcut|Diggers|ls}}</nowiki> produces: {{BookShortcut|Diggers|ls}}
* The '''Destination''' parameter is required if linking to one of the defined alternate locations; the list below documents these. e.g. <nowiki>{{BookShortcut|Diggers|ls}}</nowiki> produces: {{BookShortcut|Diggers|ls}}
* The '''Link name''' parameter is only used when one of the defined external sites uses a different page or article name for this book. If it's omitted, the link will be to the title defined in the first parameter.<br/> e.g. <nowiki>{{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}</nowiki> produces: {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}
* The '''Link name''' parameter is only used when one of the defined external sites uses a different page or article name for this book. If it's omitted, the link will be to the title defined in the first parameter.<br/> e.g. <nowiki>{{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}</nowiki> produces: {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}


== Destinations supported ==
== Destinations supported ==
These are the abbreviations for destinations you can use as the second parameter when calling this template.  
These are the abbreviations for destinations you can use as the second parameter when calling this template.  
* '''apf''' - the Annotated Pratchett File. This links to the original, hosted at www.lspace.org. Note that it only contains entries with annotations up to {{HFOS}}, but there are empty pages for all the [[Discworld books]] and many of the others.
* '''cs''' - Colin Smythe's official website, at colinsmythe.co.uk.
* '''ls''' - the L-Space wiki. This uses the "lsb:" inter-wiki prefix, which adds the "Book:" namespace to the link.
* '''ls''' - the L-Space wiki. This uses the "lsb:" inter-wiki prefix, which adds the "Book:" namespace to the link.
* '''w''' - Wikipedia. This uses the standard inter-wiki link prefix of "wikipedia:".
* '''w''' - Wikipedia. This uses the standard inter-wiki link prefix of "wikipedia:.
* '''cs''' - Colin Smythe's official website, at colinsmythe.co.uk. This uses additional template parser functions to convert the book title into lower case and replace spaces with dashes so it can be parsed. e.g. <nowiki>{{BookShortcut|Carpe Jugulum|cs}}</nowiki> produces a link like this: {{BookShortcut|Carpe Jugulum|cs}}. Note that some books use abbreviated text, which will need to be specified as the link name; for example: <nowiki>{{BookShortcut|The Colour of Magic|cs|colour-magic}}</nowiki> for {{BookShortcut|The Colour of Magic|cs|colour-magic}}
 
There are also some special internal “destinations”:
* '''ep''' - for episode titles. A quick way to insert the name of the book in inverted commas without italicisation. Should be used as a shortcut for podcasts which use the book’s title as the episode title.
* If a podcast uses book titles as episode names, and an article needs to be created for a specific episode, these destinations will link to an article for the episode with an appropriate abbreviation. These will likely be phased out, since we’re not going down the road of creating individual episode articles, but we’re keeping them for now in case there are exceptions. The supported podcast destinations are:
** '''dop''' - {{DOP}}
** '''wsp''' - {{WSP}}
** '''tcd''' - {{TCD}}
** '''nobc''' - {{NOBC}}
** '''dcp''' - {{DCP}}
** '''uap''' - {{UAP}}
** '''nrd''' - {{NRD}}
 
The '''cs''' and '''apf''' options use additional template parser functions to convert the book title into lower case and replace spaces with dashes so it can be parsed. Note that some books use abbreviated titles on colinsmythe.co.uk, and even on the APF where full titles are used in the URL, punctuation in titles is removed to make it easier to parse as HTML. In both instances, the altered text used in the URL will need to be specified as the link name. For example: <nowiki>{{BookShortcut|The Colour of Magic|cs|colour-magic}}</nowiki> for {{BookShortcut|The Colour of Magic|cs|colour-magic}}, or <nowiki>{{BookShortcut|Guards! Guards!|apf|guards-guards}}</nowiki> for {{BookShortcut|Guards! Guards!|apf|guards-guards}}


[[Category:Shortcut Templates]]
[[Category:Shortcut Templates]]
[[Category:Book Shortcut Templates|*]]</noinclude>
[[Category:Book Shortcut Templates|*]]</noinclude>

Revision as of 23:47, 8 January 2023

This template allows our book shortcut templates to link to this wiki, the L-Space wiki or Wikipedia (and may include other options later). It's intended for use inside individual book shortcut templates like {{COM}}, which by default links to The Colour of Magic.

A similar template, Template:ShortStoryShortcut, exists for Short Stories.

Usage

The template expects one to three unnamed parameters, in order: {{BookShortcut|Title|Destination|Link name}}

  • The Title is the title of the book, and is always required. If this is the only parameter, it will produce a local link - e.g. {{BookShortcut|Diggers}} produces: Diggers
  • The Destination parameter is required if linking to one of the defined alternate locations; the list below documents these. e.g. {{BookShortcut|Diggers|ls}} produces: Diggers
  • The Link name parameter is only used when one of the defined external sites uses a different page or article name for this book. If it's omitted, the link will be to the title defined in the first parameter.
    e.g. {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}} produces: Diggers

Destinations supported

These are the abbreviations for destinations you can use as the second parameter when calling this template.

  • apf - the Annotated Pratchett File. This links to the original, hosted at www.lspace.org. Note that it only contains entries with annotations up to A Hat Full of Sky, but there are empty pages for all the Discworld books and many of the others.
  • cs - Colin Smythe's official website, at colinsmythe.co.uk.
  • ls - the L-Space wiki. This uses the "lsb:" inter-wiki prefix, which adds the "Book:" namespace to the link.
  • w - Wikipedia. This uses the standard inter-wiki link prefix of "wikipedia:”.

There are also some special internal “destinations”:

  • ep - for episode titles. A quick way to insert the name of the book in inverted commas without italicisation. Should be used as a shortcut for podcasts which use the book’s title as the episode title.
  • If a podcast uses book titles as episode names, and an article needs to be created for a specific episode, these destinations will link to an article for the episode with an appropriate abbreviation. These will likely be phased out, since we’re not going down the road of creating individual episode articles, but we’re keeping them for now in case there are exceptions. The supported podcast destinations are:

The cs and apf options use additional template parser functions to convert the book title into lower case and replace spaces with dashes so it can be parsed. Note that some books use abbreviated titles on colinsmythe.co.uk, and even on the APF where full titles are used in the URL, punctuation in titles is removed to make it easier to parse as HTML. In both instances, the altered text used in the URL will need to be specified as the link name. For example: {{BookShortcut|The Colour of Magic|cs|colour-magic}} for The Colour of Magic, or {{BookShortcut|Guards! Guards!|apf|guards-guards}} for Guards! Guards!