Specific-source Template System (SSTS) is for creating and using Category:specific-source templates. It offers a standard interface for multiple host providers …
Specific-source Template System (SSTS) is for creating and using Category:specific-source templates. It offers a standard interface for multiple host providers (Internet Archive, HathiTrust, Project Gutenberg, Wikisource, Google Books) unifying the features available at each into easily understood and recognizable Wikipedia templates.
{{Cite AIA5 |page=42, 52-60}}Note the "42" and "52-60" are automatically linked. This and many other features are available.
There are thousands of specific-source templates (SST) scattered across Wikipedia, listed under Category:Specific-source templates and other places. They are individually built wrapper templates (such as {{Stewart Calculus}} or {{Acad}}) that hardcode CS1/CS2 parameters like the author, title, and publisher so editors do not have to retype them repeatedly. Each template is its own custom-made island of code, often using advanced wikitext programming methods (eg. {{{{1}}}}}}|{{{{}}}). There is no standard for how they work and they often each have peculiarities unique to that one SST.
The Specific-Source Template System (SSTS) is designed specifically for these templates. Driven by Module:SST, it provides SSTs with powerful new features while normalizing their setup and maintenance. The SST System supports commonly linked external services (ie. "hosts") including HathiTrust, Internet Archive, Google Books, Project Gutenberg and Wikisource. It can also support random web links such as a university-hosted PDF file.
Instead of hardcoding book data directly into the individual templates, SSTS stores specific book information in alphabetized files or "shards."
By moving to this system, Wikipedia gains several major advantages:
|chapter-page= parameter in combination with |chapter={{Porsche: Excellence Was Expected}}.If you are writing or editing an article, using an SSTS-powered template is nearly identical to using any standard citation template.
For example, to cite the book The Ottoman Empire, you would use:
{{The Ottoman Empire |page=45}}
This single line automatically generates a fully formatted citation with the author, title, publisher, and year, while linking to the correct destination URL at page 45.
You have the option to supplement or override parameters.
{{cite book}} or {{cite encyclopedia}}) such as |quote=, |ref=, etc.|url= if you are citing a specific digital scan not mapped by the system).Because texts have complex publication histories, digital availability may vary by volume. Some volumes may be physical-only, while others may be hosted digitally (e.g., on the Internet Archive, Google Books, or Wikisource). If a specific volume is hosted digitally, the underlying SST Module will automatically generate the correct links and activate the relevant digital features below.
Many historical works span multiple volumes or have been printed in various editions. SSTS templates are built to handle these variations natively. You can pass the |volume= or |edition= parameters exactly as you would in standard wikitext.
{{The Ottoman Empire |edition=Second |page=112}}
{{The Ottoman Empire |volume=2 |page=112}}
SSTS uses a normalization module that understands that "Second", "2nd", and "2" all mean the same thing, or "Vol. 1", "Volume 1", and "1".
To link to a specific chapter, use |chapter= and |chapter-page=.
{{The Cambridge History of Iran |volume=1 |chapter=Introduction |chapter-page=12}}
The system supports page number formatting of various types:
|page=42 - single page|pages=42-50 - page ranges|pages=42, 50, 60 - multiple pages|pages=42-49, 50-59, 60-69 - multiple page range groupsAll of these will get automatically linked to the specific page numbers.
Because the page number printed on the physical page (e.g., Roman numeral "xii") might not match the digital file's "leaf" or "sequence" number (e.g., scan #7), SSTS uses a special display@machine syntax within the |page= or |pages= parameters to bridge this gap.
Different digital libraries require slightly different machine codes.
Use the format display@<host code><leaf #>.
xiii@n7 means printed page "xiii" is located at Internet Archive leaf number 7 (e.g. the URL ../page/n7). Thus, |page=xiii@n7xiii@gPR13 means printed page "xiii" is located at Google Books leaf number 13 (e.g. the URL ...&pg=PR13).| Host Service | Host Code | Format | Resulting Link | Citation and Destination Printed Page |
|---|---|---|---|---|
| Internet Archive | n | 42 | .../page/42 |
42 |
| Internet Archive | n | xii@n7 | .../page/n7 |
xii |
| HathiTrust | s | 42 | Not Available | Does not support printed-page-number linking |
| HathiTrust | s | 42@s54 | ...&seq=54 |
42 |
| Project Gutenberg | u | 42 | .../pg78102-images.html#page-42 |
42 |
| Project Gutenberg | u | 42@u42 | .../pg78102-images.html#page-42 |
42 |
| Wikisource | w | 42 | Not Available | Does not support printed-page-number linking |
| Wikisource | w | 42@w54 | [[s:Page:FileName.pdf/54|42]] |
42 |
| Wikisource | w | 42@w"Chapter 1" | [[s:Page:FileName.pdf/Chapter_1|42]] |
42 |
| Google Books | g | 42 | ...&pg=PA42 |
42 |
| Google Books | g | 42@gPA42 | ...&pg=PA42 |
42 (PA is "Page Arabic") |
| Google Books | g | xiii | ...&pg=PR13 |
xiii |
| Google Books | g | xiii@gPR13 | ...&pg=PR13 |
xiii (PR is "Page Roman") |
| Google Books | g | cover@gPP1 | ...&pg=PP1 |
cover (PP is "Page Physical" or unnumbered pages, covers, blank pages etc) |
| Google Books | g | insert@gPT15 | ...&pg=PT15 |
insert (PT is "Page Text" unnumbered inserts, photo plates, etc) |
Many digital libraries support a "search inside" feature that automatically highlights a specific word or phrase on the page when the reader opens the link. SSTS allows you to trigger this feature directly from the citation by enclosing your search term in square brackets [] within the |page= or |pages= parameter.
This syntax can be used on its own, or appended to the @ linking syntax.
{{The Ottoman Empire |page=42 [Suleiman]}}
{{The Ottoman Empire |page=xii@n7 [Constantinople]}}
{{The Ottoman Empire |page=45 [military reform], 57-60 [justinian] }}
Please note that this feature relies on the destination host's capabilities. Based on current engine configurations, search-highlighting is supported by:
A core feature of this module is its handling of the Internet Archive's restricted viewing modes.
If an editor provides a page number, the module automatically appends that number as a "dummy" search string (e.g., ?q=42). This is a necessary architectural workaround: supplying a search string forces the IA viewer to open and highlight specific pages that might be blocked due to restrictions (similar to Google Books snippet view with search strings).
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."
The front-end template (e.g., {{The Ottoman Empire}}) is a lightweight wrapper that routes the user's input to Module:SST.
<includeonly>{{#invoke:SST|single|id=HISTORY_OF_YOLO_COUNTY}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
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.
<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>
<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>
All book metadata is stored in "shards" which are Lua Modules that contain simple tables.
There are two types of shards:
Module:SST/shards/sets for example Module:SST/shards/sets/THE_CAMBRIDGE_HISTORY_OF_IRAN.To add a new book, navigate to the correct shard and add a new table. The template documentation page will show where the shard is located.
When creating a new table, use a unique, recognizable book key in ALL CAPS, with spaces converted to underscores. For single shards it must start with the letter of the shard it is placed in. Generally a good idea to start with the author's last name then a short version of the title.
library['IMBER_THE_OTTOMAN_EMPIRE'] = { ... }When creating a multi-edition or volume set of books, name each book followed by a number for volumes e.g. _1 and _2 .. or by a year of publication e.g. _1990 and _2002 for editions.
The |host= sets which digital library the citation will link to.
Example: Host
|
|---|
library['IMBER_THE_OTTOMAN_EMPIRE'] = {
['host'] = "ia",
['cite_params'] = {
.....
}
|
Valid values for |host= are "ia", "guten", "hathi", "wikisrc", "gbook", "web" and "physical" (not online). These map to a corresponding |id= in the |hosts= entry (see below). Improper values or lack of a host will default to "physical" (no external links).
If a |host= is changed (e.g. from "hathi" to "ia") this will impact the Leaf page designations for every template on Wikipedia. For example Hathi uses 42@s54 while IA uses 42@n34. A change of |host= is disruptive, causing URLs to land on the wrong page. Tools will be in development to make |host= changes easier by automating the update of templates. Until then, it is better to consider the host "locked".
|_template=: Optional. Defaults to cite book, can also be set to cite encyclopedia (more template support in future).|last=, |first=, |quote=, |ref=, etc. = Standard CS1 parameters.Example: Citation Parameters
|
|---|
['host'] = "ia",
['cite_params'] = {
['_template'] = 'cite book',
['last'] = "Birtchnell",
['first'] = "Percy Charles",
['author-link'] = "Percy Birtchnell",
['title'] = "A Short History of Berkhamsted",
['year'] = "1972",
['edition'] = "Revised",
['publisher'] = "Privately printed",
['place'] = "Berkhamsted",
['oclc'] = "737328"
},
|
|ia= (Internet Archive), |hathi= (HathiTrust), |guten= (Project Gutenberg), |wikisrc= (Wikisource), |gbook= (Google Books), |web= (Other website), and |physical= (No digital host). You can add multiple hosts for each book, which one is used is defined by |host= (see above).|id= = The host-specific identifier.
Example: Host Configurations
|
|---|
['hosts'] = {
['ia'] = {
['id'] = "encyclopaediabrit01chisrich",
}
}
['hosts'] = {
['ia'] = {
['id'] = {
"nebraskaplacenam00fitz",
"nebraskaplacenam0000fitz"
}
}
}
['hosts'] = {
['hathi'] = {
['id'] = "iau.31858015245842",
}
}
['hosts'] = {
['gbook'] = {
['id'] = "-CNkywAACAAJ",
}
}
['hosts'] = {
['wikisrc'] = {
['id'] = "Page:The Fun of It.pdf",
}
}
['hosts'] = {
['web'] = {
['url'] = "http://www.uscoldwar.com/overview.htm",
}
}
['hosts'] = {
['physical'] = {}
}
|
Example: Internet Archive Options
|
|---|
['hosts'] = {
['ia'] = {
['query'] = "title:Britannica AND year:1911",
}
}
['hosts'] = {
['ia'] = {
['id'] = "encyclopaediabrit01chisrich",
['iasearch'] = "none",
['iadisplay'] = "full screen"
}
}
|
Some hosts have multiple copies of the same book+edition. This can be useful to mitigate viewing limits. Many hosts only allow X number of views per day per book. By including multiple IDs, you can spread the load across multiple IDs. Because the template randomly chooses real-time, it is important each book be identical ie. published in the same year, same publisher, each open to the same page 42 etc.. How to add multiple identical books:
['hosts'] = {
['ia'] = {
['id'] = {
"nebraskaplacenam00fitz",
"nebraskaplacenam0000fitz"
}
}
}
Load sharing is not available across hosts (inter-host), only within hosts (intra-host).
SSTS is built on a modular architecture to ensure scalability and ease of maintenance. When an editor invokes a template, the data flows through four layers:
{{The Ottoman Empire}}) This is the user-facing layer. It captures the editor's parameters (like |page= or |edition=) and calls the router.@ and [] syntax, calculates the final URLs, formats the deep-links, and assembles the final citation.To ensure the system remains robust and that broken links do not linger in articles, SSTS includes built-in error handling.
If a template is configured incorrectly or calls missing data, the router will output a bold, red error message directly in the citation to alert the editor. Common errors include:
SST Error: Unsupported host '...'SST Error: Book key '...' not found in shard '...'The module utilizes tracking categories.
|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.{{Location map}} - uses a similar architecture of many sub-modulesInformasi 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.