Commit d6334c34 authored by Axel Dürkop's avatar Axel Dürkop
Browse files
parents e840344c ea574e3f
......@@ -15,13 +15,16 @@ PANDOC_SCHOLAR_PATH = ../../pandoc-scholar
PANDOC_WRITER_OPTIONS += --resource-path=.:../../pandoc-templates/generic-template/templates
PANDOC_WRITER_OPTIONS += --filter=$(PANDOC_CITEPROC)
PANDOC_WRITER_OPTIONS += --filter=$(PANDOC_CITEPROC) \
--lua-filter=../../journal-configuration/lua/affiliation-markers.lua \
--metadata-file=../../journal-configuration/journal-config/translations.yaml
# Include separated configuration files
# PANDOC_WRITER_OPTIONS = --metadata-file=config/article-metadata.inc.yml
# PANDOC_WRITER_OPTIONS ?= --metadata-file=config/style-metadata.inc.yml
PANDOC_READER_OPTIONS ?= --metadata-file=config/article-metadata.inc.yml
PANDOC_READER_OPTIONS ?= --metadata-file=config/article-metadata.inc.yml \
--lua-filter=../../journal-configuration/lua/localize-date.lua
# Additional option per file type
ifndef PANDOC_LATEX_OPTIONS
......
---
i18n:
submitted: Eingereicht
edited: Editiert
reviewed: Begutachtet
received: Erhalten
accepted: Akzeptiert
published: Publiziert
financing: Finanzierung
data-loc: Datenverfügbarkeit
transparency: Transparenzhinweis
article: Zeitschriftenartikel
copyright: Lizenz
citation: Empfohlene Zitierung
correspondence: Korrespondenz
abstract: Zusammenfassung
keywords: Schlagwörter
published-by: Publiziert von der
---
-- Use letters as affiliation markers
-- TODO: consider merging this filter into pandoc-scholar's
-- template-helper.lua
local letters = "abcdefghijklmnopqrstuvwxyz"
local List = require 'pandoc.List'
function Meta (meta)
local function resolve_institute (idx)
return meta.institute[tonumber(idx)]
end
for i, author in ipairs(meta.author) do
local institute_indices = List:new(author.institute)
local institutes = institute_indices:map(resolve_institute)
author.institute_indices = institute_indices
author.institute = institutes
author.institute_letter_indices = institute_indices:map(
function (idx)
return letters:sub(idx, idx)
end
)
meta.has_equal_contributors = meta.has_equal_contributors
or author.equal_contributor
meta.has_correspondence = meta.has_correspondence
or author.correspondence and author.email
end
for i, institute in ipairs(meta.institute) do
local index = tostring(i)
institute.index = index
institute.letter_index = letters:sub(index, index)
end
return meta
end
-- This *should* be doable with `os.date`, but it seems to ignore
-- the `LC_TIME` environment variable.
local months = {
'Januar', 'Februar', 'März', 'April', 'May', 'Juni',
'July', 'August', 'September', 'Oktober', 'November', 'Dezember'
}
function localize_date(date_meta)
local date_string = pandoc.utils.stringify(date_meta)
local year, month, day = date_string:match('^(%d%d%d%d)-(%d%d)-(%d%d)')
return ("%02d. %s %d"):format(day, months[tonumber(month)], year)
end
function Meta (meta)
meta.quality.received = localize_date(meta.quality.received)
meta.quality.accepted = localize_date(meta.quality.accepted)
meta.quality.published = localize_date(meta.quality.published)
return meta
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment