Jump to content

User:Jason Quinn/How to space your cite templates and stop sucking eggs

From Wikipedia, the free encyclopedia

When you add cite templates to articles, make sure your spacing makes sense. Wikipedia is based on the manipulation of textual information and editing text is at its heart so you must mind such details. (This is of extreme importance for bot creators! As far as I'm concerned, any bot creator who never considered the spacing their bot produces has demonstrated poor judgement.)

The right way to space

[edit]

There is only one way to space your cite templates that passes muster and withstands the test of time: a space before the pipe character and no spaces after or around the equal sign. The following example demonstrates:

{{cite book |last=Bloggs |first=Joe |authorlink=Joe Bloggs |date=December 2, 2018 |title=The Life and Times of Joe Bloggs |publisher=International Bogus Press |ibsn=978-3-16-148410-0 |url=https://www.example.com/Joe-Bloggs-autobiography |accessdate=July 7, 2022 |quote=When I was seven I ate a butterfly but it didn't die. Instead it lodged in my stomach where it still lives to this very day.}}

This is, as objectively as possible, an optimal spacing choice. The text wrapping breaks the parameters up into easy to identify parts. It's still compact too. It's as best as can be done.

ALWAYS USE THIS STYLE! Not because it's mandatory but because it shows you care.

And the way to suck eggs

[edit]

The following choices for the spacing in cite templates are absolutely terrible and I don't know why a sane person would ever do it any of the following ways:

Spacing?What'sthat?

[edit]
{{cite book|last=Bloggs|first=Joe|authorlink=Joe Bloggs|date=December 2, 2018|title=The Life and Times of Joe Bloggs|publisher=International Bogus Press|ibsn=978-3-16-148410-0|url=https://www.example.com/Joe-Bloggs-autobiography|accessdate=July 7, 2022|quote=When I was seven I ate a butterfly but it didn't die. Instead it lodged in my stomach where it still lives to this very day.}}

This is bad because text editors have trouble wrapping the citation for display in the text editor. And when it does wrap, it only does so in spots that do not separate parameters but instead in the middle of the value of the parameter (eg in the middle of the title or a date). This runs the risk of a person not noticing the full value of the parameter when editing the source and causing errors.

NEVER USE THIS STYLE!

Fluffy spacing

[edit]
{{cite book | last = Bloggs | first = Joe | authorlink = Joe Bloggs | date = December 2, 2018 | title = The Life and Times of Joe Bloggs | publisher = International Bogus Press | ibsn = 978-3-16-148410-0 | url = https://www.example.com/Joe-Bloggs-autobiography | accessdate = July 7, 2022 | quote = When I was seven I ate a butterfly but it didn't die. Instead it lodged in my stomach where it still lives to this very day.}}

In many ways this is worse than no spaces. The text is wrapping too much, leaving stray pipe characters or equal signs on the far right.

NEVER USE THIS STYLE!

Spaces after pipes and around equal signs

[edit]
{{cite book| last = Bloggs| first = Joe| authorlink = Joe Bloggs| date = December 2, 2018| title = The Life and Times of Joe Bloggs| publisher = International Bogus Press| ibsn = 978-3-16-148410-0| url = https://www.example.com/Joe-Bloggs-autobiography| accessdate = July 7, 2022| quote = When I was seven I ate a butterfly but it didn't die. Instead it lodged in my stomach where it still lives to this very day.}}

This version is confusing to parse. It continually tricks the eye and makes it difficult to tell where parameters start and end.

NEVER USE THIS STYLE!

Random slop

[edit]
{{cite book | last= Bloggs|first=Joe | authorlink =Joe Bloggs | date= December 2, 2018|title=The Life and Times of Joe Bloggs| publisher =International Bogus Press|ibsn=978-3-16-148410-0| url = https://www.example.com/Joe-Bloggs-autobiography| accessdate = July 7, 2022| quote=When I was seven I ate a butterfly but it didn't die. Instead it lodged in my stomach where it still lives to this very day.}}

NEVER USE THIS STYLE AND STAY OFF DRUGS.

See also

[edit]