From c3a86b41046f441b37f9ec1963ad45ff7e728f59 Mon Sep 17 00:00:00 2001 From: Greg von Nessi Date: Mon, 16 Feb 2026 23:21:51 +0000 Subject: [PATCH] Add locatorType field to citationMark schema Add CSL-compatible locatorType enum alongside the existing locator field so renderers can distinguish page, chapter, volume, etc. without guessing from the locator value. Update the semantic-document example to use the structured form. Closes #30 --- examples/semantic-document/content/document.json | 3 ++- schemas/semantic.schema.json | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/semantic-document/content/document.json b/examples/semantic-document/content/document.json index ca85213..a416159 100644 --- a/examples/semantic-document/content/document.json +++ b/examples/semantic-document/content/document.json @@ -42,7 +42,8 @@ { "type": "citation", "refs": ["turing1936"], - "locator": "pp. 230-265" + "locator": "230-265", + "locatorType": "page" } ] }, diff --git a/schemas/semantic.schema.json b/schemas/semantic.schema.json index 25e142e..90d5d0d 100644 --- a/schemas/semantic.schema.json +++ b/schemas/semantic.schema.json @@ -20,6 +20,15 @@ "type": "string", "description": "Page, chapter, section, or other locator (CSL-compatible, more general than pages)" }, + "locatorType": { + "type": "string", + "description": "Type of locator (CSL-compatible). Defaults to \"page\" if omitted.", + "enum": [ + "page", "chapter", "section", "paragraph", "line", + "verse", "volume", "issue", "part", "book", + "figure", "table", "note", "opus", "sub-verbo" + ] + }, "pages": { "type": "string", "description": "Page range (deprecated: prefer locator for flexibility)"