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

м
нет описания правки
мНет описания правки
мНет описания правки
Строка 92: Строка 92:
-- Call example:  
-- Call example:  
-- {{#invoke: CTD | info  
-- {{#invoke: CTD | info  
--  | term        = Term  
--  | type        = Type of term: понятие (по умолчанию), личность, выражение, литература, периодика
--  | type        = Type of term: conception, person, expression, literature, periodical
--  | term        = Term, that is word or phrase
--  | term_to_show = Term with accent or diacritic marks  
--  | term_to_show = Term with accent or diacritic marks  
--  | lifetime    = Lifetime (for person or conception) or day of issue (for literature and periodical)
--  | shortly      = Short description  
--  | shortly      = Short description  
--  | description  = Full description  
--  | description  = Full description  
Строка 140: Строка 143:
end
end
-- check if origin specified
-- check if origin or lifetime specified
if not isempty(frame.args['origin']) then
if not isempty(frame.args['origin']) or not isempty(frame.args['lifetime']) then
origin = ' (' .. frame.args['origin'] .. ')'
origin = ' (' .. frame.args['origin'] .. ')'
if not isempty(frame.args['lifetime']) then
origin = origin .. frame.args['lifetime']
end
if not isempty(frame.args['origin']) and not isempty(frame.args['lifetime']) then
origin = origin .. ', '
end
if not isempty(frame.args['origin']) then
origin = origin .. frame.args['origin']
end
origin = origin .. ')'
end
end
Строка 237: Строка 250:
-- DEBUG.  
-- DEBUG.  
--text = '<p>DEBUG: view: ' .. view .. "; term: " .. term .. "; description: " .. description .. "; origin: " .. origin .. '</p>' .. text
--text = '<p>DEBUG: view: ' .. view .. "; term: " .. term .. "; description: " .. description .. "; origin: " .. origin .. '</p>' .. text
     -- return text .. reference ..'; view='.. view ..'; i='.. i  
     --return text .. reference ..'; view='.. view ..'; i='.. i  
     return frame:preprocess( text .. reference )
     return frame:preprocess( text .. reference )