summaryrefslogtreecommitdiff
path: root/biblio/citation-style-language/citeproc-node-date.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-09-08 03:02:30 +0000
committerNorbert Preining <norbert@preining.info>2023-09-08 03:02:30 +0000
commit608e422a8e775ac4d1c23c80b4170776701680d5 (patch)
treed1e69057c0dc339fb0f890882f5fef9fe3b3a66f /biblio/citation-style-language/citeproc-node-date.lua
parent96f1d7a9e9fe6e682cbd19d1bf2b7797891160b6 (diff)
CTAN sync 202309080302
Diffstat (limited to 'biblio/citation-style-language/citeproc-node-date.lua')
-rw-r--r--biblio/citation-style-language/citeproc-node-date.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/biblio/citation-style-language/citeproc-node-date.lua b/biblio/citation-style-language/citeproc-node-date.lua
index 1102811573..5cf624c370 100644
--- a/biblio/citation-style-language/citeproc-node-date.lua
+++ b/biblio/citation-style-language/citeproc-node-date.lua
@@ -32,6 +32,15 @@ local PlainText = output.PlainText
-- [Date](https://docs.citationstyles.org/en/stable/specification.html#date)
+---@class Date: Element
+---@field children DatePart[]?
+---@field variable string
+---@field form string?
+---@field date_parts string?
+---@field delimiter string?
+---@field prefix string?
+---@field suffix string?
+---@field text_case string?
local Date = Element:derive("date")
function Date:from_node(node)
@@ -64,6 +73,7 @@ end
function Date:build_ir(engine, state, context)
local variable
if not state.suppressed[self.variable] then
+ ---@type DateVariable?
variable = context:get_variable(self.variable)
end
@@ -294,8 +304,8 @@ function Date:render_sort_key(engine, state, context)
return false
end
if not date["date-parts"] then
- if self.literal then
- return "1" .. self.literal
+ if date.literal then
+ return "1" .. date.literal
else
return false
end
@@ -337,6 +347,11 @@ end
-- [Date-part](https://docs.citationstyles.org/en/stable/specification.html#date-part)
+---@class DatePart: Element
+---@field name string
+---@field form string?
+---@field text_case string?
+---@field range_delimiter string?
local DatePart = Element:derive("date-part")
function DatePart:from_node(node)