Data-centric repository cataloging Sri Lankan historical kingdoms and monarchs. This version focuses purely on structured JSON so the dataset can be reused in apps, visualizations, or static site generators.
Note: All prior example HTML pages were removed (data-only mode requested). Regeneration of site output can be done externally with a static site generator consuming the JSON.
Two primary files will be introduced:
data/
kingdoms.json # Array of kingdom objects
kings.json # Array of king objects
{
"id": "anuradhapura", // slug identifier
"name": "Anuradhapura", // display name
"era": "437 BCE – 1017 CE", // inclusive date range
"region": "North Central Province", // optional
"notes": "First major kingdom; irrigation & Buddhist center"
}
{
"name": "Dutugemunu",
"slug": "dutugemunu", // derived, lowercase kebab
"kingdom": "anuradhapura", // foreign key to kingdoms.id
"reign": "161–137 BCE", // original textual reign
"startYear": -161, // negative for BCE (optional parse)
"endYear": -137, // negative for BCE (optional parse)
"categories": ["unification","architecture"], // tags
"notes": "Unified much of Sri Lanka; major Buddhist works"
}
If years cannot be confidently parsed they will be omitted from startYear/endYear but the textual reign preserved.
kingdoms.json with all major kingdoms (Tambapanni, Upatissa Nuwara, Anuradhapura, Sigiriya phase, Polonnaruwa, Dambadeniya, Yapahuwa, Kurunegala, Gampola, Kotte, Sitawaka, Kandyan, Jaffna).kings.json from provided chronological list.sources field per king for citations.v0.1.0) for downstream consumption.data/kingdoms.json or data/kings.json following schema.sources array when adding new historical assertions.Primary narrative sources include the Mahavamsa, Culavamsa, archaeological survey reports, and peer-reviewed historiography. Pages will gradually incorporate citation footnotes to distinguish legend from corroborated history.
<caption> for complex tables (planned addition).Static site generators or visualization layers can ingest these JSON files to produce timelines, maps, or multilingual interfaces. Tooling included: scripts/validate.js (referential integrity) and scripts/export-markdown.js (derives Markdown summaries). No HTML artifacts are kept in the repo.
Install locally (dev):
npm install
Run validation:
npm run validate
List kingdoms:
node src/cli.js list-kingdoms
List kings of Anuradhapura:
node src/cli.js list-kings anuradhapura
Find king by name fragment:
node src/cli.js find-king tissa
Export Markdown set:
npm run export:md
Global install (optional):
npm link
slhistory list-kingdoms
Content is provided for educational purposes. (Formal license to be decided.)
© 2025 Sri Lanka History Wiki (Work in progress)