WorldHistoryArchive

Sri Lanka History Data

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.

Project Goals

Data Schema

Two primary files will be introduced:

data/
  kingdoms.json  # Array of kingdom objects
  kings.json     # Array of king objects

kingdoms.json (schema)

{
  "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"
}

kings.json (schema)

{
  "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.

Content Roadmap (Data Mode)

Contributing

  1. Fork the repository.
  2. Add or update entries in data/kingdoms.json or data/kings.json following schema.
  3. Maintain alphabetical or chronological ordering as indicated in file header comments (to be added).
  4. Include sources array when adding new historical assertions.
  5. Run validation script (planned) before PR submission.

Data Integrity & Sources

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.

Accessibility Guidelines

Future Automation

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.

CLI Usage

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

License

Content is provided for educational purposes. (Formal license to be decided.)


© 2025 Sri Lanka History Wiki (Work in progress)