Перейти к содержанию

Модуль:CTD: различия между версиями

м
нет описания правки
м (+addition)
мНет описания правки
Строка 115: Строка 115:
--  | author_short = Name with initials
--  | author_short = Name with initials
--  | published    = Book or article published; applied to literature
--  | published    = Book or article published; applied to literature
--  | userparam    = text@view@type@style@addition
--  | userparam    = text@view@type@style@specification
-- }}
-- }}
-- Where 'userparam' consist of all the parameters that can not be fetched by symantic property:
-- Where 'userparam' consist of all the parameters that can not be fetched by symantic property:
Строка 122: Строка 122:
-- * type = type of term: понятие (по умолчанию), личность, выражение, литература, периодика / conception, person, expression, literature, periodical
-- * type = type of term: понятие (по умолчанию), личность, выражение, литература, периодика / conception, person, expression, literature, periodical
-- * style= серый / gray
-- * style= серый / gray
-- * specification = уточнение к литературному источнику: том, страница, глава и т.п.
-- View, type and style are language dependent parameters, consider changes in code below.
-- View, type and style are language dependent parameters, consider changes in code below.
-- TODO: Всплывающую подсказку сделать вики текстом и добавить ссылку [[{{{БТС статья}}}|БТС]]  
-- TODO: Всплывающую подсказку сделать вики текстом и добавить ссылку [[{{{БТС статья}}}|БТС]]  
Строка 140: Строка 141:
-- split 'userparam' in variables
-- split 'userparam' in variables
local t = split_string(frame.args['userparam'],'@')
local t = split_string(frame.args['userparam'],'@')
local text, view, term_type, style, addition = t[1], t[2], t[3], t[4], t[5]
local text, view, term_type, style, specification = t[1], t[2], t[3], t[4], t[5]
if isempty(view) then view = 'подсказка' end
if isempty(view) then view = 'подсказка' end
if isempty(term_type) then term_type = 'понятие' end
if isempty(term_type) then term_type = 'понятие' end
Строка 168: Строка 169:
else
else
description = frame.args['description']
description = frame.args['description']
end
if not isempty(addition) then
description = description ..', '.. addition
end
end
Строка 197: Строка 195:
origin = origin .. ')'
origin = origin .. ')'
end
end
if not isempty(specification) then
origin = origin ..', '.. specification
end


-- construct lifetime string for pop-up message
-- construct lifetime string for pop-up message
Строка 230: Строка 232:
end
end
if view == 'сноска' or view == 'сноска и подсказка' or view == 'подсказка и сноска' then
if view == 'сноска' or view == 'сноска и подсказка' or view == 'подсказка и сноска' then
reference =  term_to_show .. origin .. ' – ' .. description .. ' ('.. ctd_title ..').'
reference =  term_to_show .. origin .. '. – ' .. description .. ' ('.. ctd_title ..').'
if not isempty(style) then  -- there is only one additional style for now, so ignore the value
if not isempty(style) then  -- there is only one additional style for now, so ignore the value
reference = '<span style="color: gray;">' .. reference ..'</span>'
reference = '<span style="color: gray;">' .. reference ..'</span>'