Module:CitationLite/doc

From Chalo Chatu, Zambia online encyclopedia
Revision as of 10:59, 8 September 2025 by Chalochatu (talk | contribs) (Created page with "''CitationLite'' is a lightweight Lua citation engine for Chalo Chatu. It powers minimal, stable versions of the following templates: * {{tl|Cite web}} * {{tl|Cite news}} * {{tl|Cite book}} * {{tl|Cite journal}} This module avoids the complexity of CS1/CS2 while covering the most common citation needs on Chalo Chatu. It has no external module dependencies and aims for predictable output and low error rates. == Entry points == Use {{#invoke}} only from templates. Do not...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:CitationLite

CitationLite is a lightweight Lua citation engine for Chalo Chatu. It powers minimal, stable versions of the following templates:

This module avoids the complexity of CS1/CS2 while covering the most common citation needs on Chalo Chatu. It has no external module dependencies and aims for predictable output and low error rates.

Entry points

Use {{#invoke}} only from templates. Do not call the module directly from articles.

Supported parameters

All four entry points accept a small, consistent set of parameters. Some are ignored when not applicable.

Core
author, authors, last, first, title, date, language/lang, access-date
Source and publication
website/work, publisher, newspaper (news only), journal (journal only)
Identifiers and detail
isbn (book), doi (journal), edition (book), volume, issue/number, pages/page, year, place/location
Links
url, archive-url, archive-date, url-status (use live or dead)
Extras
quote (short inline quotation)

Notes on parameters

  • Authors may be provided as
|author= or |last= with |first=, or |authors= with names separated by semicolons or commas.
  • |language= displays as a short marker in parentheses, for example (bemba), (ny), (en). Do not use long prose.
  • |access-date= is free-form; the module does not parse or validate dates.
  • Archive handling shows links as “URL • Archived 2025-07-20 (live/dead)”. If only |archive-url= is present, it will still display the archived link.

Output style

The module emits simple inline citations wrapped in a span with a type class:

  • <span class="citation web">...</span>
  • <span class="citation news">...</span>
  • <span class="citation book">...</span>
  • <span class="citation journal">...</span>

Formatting rules

  • Author list joins with commas and an ampersand before the last author.
  • Article and chapter titles use quotation marks.
  • Work, website, book, and journal names are italicised.
  • Blocks end with a final period if missing.

Examples

Web

{{Cite web
 | author       = Ministry of Information
 | title        = Government launches new portal
 | website      = Cabinet Office
 | publisher    = Government of the Republic of Zambia
 | date         = 2025-07-12
 | url          = https://www.example.gov.zm/portal
 | access-date  = 2025-09-08
 | archive-url  = https://web.archive.org/web/20250720/https://www.example.gov.zm/portal
 | archive-date = 2025-07-20
 | url-status   = live
 | language     = en
}}

News

{{Cite news
 | author      = Reporter Name
 | title       = Power outage hits parts of Lusaka
 | newspaper   = Times of Zambia
 | date        = 2025-08-29
 | url         = https://www.times.co.zm/article/power-outage
 | access-date = 2025-09-08
}}

Book

{{Cite book
 | author    = Mulenga, John
 | title     = History of Lusaka
 | edition   = 2nd
 | publisher = ZedPress
 | year      = 2019
 | place     = Lusaka
 | isbn      = 978-1-23456-789-7
 | pages     = 45–48
}}

Journal

{{Cite journal
 | authors  = Phiri, M.; Banda, T.
 | title    = Urban growth in Lusaka
 | journal  = Zambian Journal of Planning
 | volume   = 12
 | issue    = 2
 | pages    = 101–120
 | year     = 2024
 | doi      = 10.1234/zjp.2024.012
 | url      = https://journal.example.org/urban-growth
 | access-date = 2025-09-08
}}

Error handling and maintenance

The module is defensive about missing parameters. It will not throw Lua errors for empty fields. Where both |title= and |url= are missing, maintainers may enable an optional tracking category by adding the small helper in the module source and creating

  • Category:Citation Lite maintenance (hidden)

This is off by default to keep article output clean.

Migration guidance

  • Prefer these templates for straightforward sources on Chalo Chatu.
  • Legacy CS1-based templates may remain where advanced fields are required; otherwise consider converting to the lightweight forms for performance and consistency.
  • When converting, preserve dates and archive fields exactly as written by the editor.

Limitations

  • No automatic date parsing or reformatting.
  • No complex name parsing beyond simple lists.
  • No S2CID, JSTOR, OCLC, or similar identifiers.
  • No automatic punctuation trimming inside parameters; provide clean input.

See also

Testcases

Use the sandbox and testcases pages to validate changes:

Maintainers: keep the public interface stable. Any breaking change should be announced on the Village Pump before deployment.