Module:SST/doc
| This is a documentation subpage for Module:SST. It may contain usage information, categories and other content that is not part of the original module page. |
This module is the core router for the Specific-Source Template System (SSTS). It acts as a dynamic wrapper and dispatcher for specific-source templates. It intercepts specific parameters, routes the request to the correct host engine (such as Internet Archive, HathiTrust, or Google Books), and passes the formatted data to standard citation templates like {{cite book}}.
Usage
Creating a new specific-source template requires two steps: creating the front-end template, and adding the book's data to the correct alphabetized "shard."
Step 1: the front-end template
The front-end template (e.g., {{The Ottoman Empire}}) is a lightweight wrapper that routes the user's input to Module:SST.
- Single-book (example template)
<includeonly>{{#invoke:SST|single|id=HISTORY_OF_YOLO_COUNTY}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
- id: The unique base identifier for the book located in the data shard.
If the book has multiple volumes or editions, replace single with set. You can combine it with a {{#switch}} statement and {{Normalize volume and edition}} to route to the correct data block within the book's standalone shard.
- Three editions (example template)
<includeonly>{{#invoke:SST|set
| id = IMBER_THE_OTTOMAN_EMPIRE
| key = {{#switch:{{#invoke:Normalize volume and edition|edition|{{{edition|}}}}}
| 3 | 2019 = 2019
| 2 | 2009 = 2009
| 1 | 2002 | #default = 2002
}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
- 7 volume set (example template)
<includeonly>{{#invoke:SST|set
| id = BYZANTINE_SEALS
| key = {{#switch:{{#invoke:Normalize volume and edition|volume|{{{volume|}}}}}
| 1 | I = 1
| 2 | II = 2
| 3 | III = 3
| 4 | IV = 4
| 5 | V = 5
| 6 | VI = 6
| 7 | VII = 7
| all | ALL | #default = ALL
}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
- id: The base identifier for the entire set (maps to the shard filename).
- key: The specific variant key (e.g., 1, 2, ALL) to append to the base ID.
Architecture & Data Sharding
To avoid loading a single massive data table into memory, configuration data is split into alphabetical subpages (shards).
- Validation: When invoked, the module verifies that a valid host code (e.g.,
IA,Hathi,GBook) and Book Key are provided. - Data Retrieval: It extracts the first letter of the Book Key (e.g., "B" from "BYZANTINE_SEALS_V1") and uses
mw.loadData()to retrieve the corresponding subpage (e.g., Module:SST/shards/B). - Engine Execution: It then loads the Module:SST/hosts engine, passing the shard data and the user's template arguments to build the final URLs.
- Output: The compiled arguments are expanded into the base template defined in the shard (defaulting to
{{cite book}}).
Error Tracking
The module utilizes an error tracking system.
- Fatal Execution Errors: If the module encounters a system failure (e.g., an unsupported host engine) or a native CS1 red error, it outputs a bold red error message in the citation and categorizes the page into Category:SSTS errors.
- Missing Records: If a citation requests a book key, shard, or volume that does not exist in the database, it outputs a visible error and categorizes the page into Category:SSTS missing records.
- Parameter Logic Faults: If an editor uses an invalid combination of parameters that conflicts with the shard's architecture (e.g., adding
|title=or|article=to a{{cite encyclopedia}}), the module will attempt to silently resolve the citation to prevent a red error, but will flag the page in the hidden category Category:SSTS parameter logic faults.
Testcases
Testcases: Template:Catalogue of Byzantine Seals at Dumbarton Oaks and in the Fogg Museum of Art/testcases
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.