Бюрократы, Администраторы интерфейса, Администраторы (Semantic MediaWiki), Кураторы (Semantic MediaWiki), Editors (Semantic MediaWiki), Скрывающие, Администраторы, trusted
69 384
правки
мНет описания правки |
мНет описания правки |
||
Строка 13: | Строка 13: | ||
-- {{#invoke: Common | page_id | volume=1 | page=17 | -- {{#invoke: Common | page_id | volume=1 | page=17 | ||
-- | volume_digits=2 | page_digits=4 | -- | volume_digits=2 | page_digits=4 | ||
-- }} | -- }} | ||
-- By default volume has 1 digit, page has 3 digits | -- page could be Roman (XVII, xvii) or Arabic (17) | ||
-- By default volume has 1 digit, page has 3 digits. | |||
function common.page_id( frame ) | function common.page_id( frame ) | ||
local vNum = frame.args['volume'] | local vNum = frame.args['volume'] | ||
Строка 29: | Строка 28: | ||
-- If we deal with regular page number then for v.1, p.17 return 1:017 | -- If we deal with regular page number then for v.1, p.17 return 1:017 | ||
if | if not roman.isRoman(frame.args['page']) then | ||
pNum = string.format(nFormat, frame.args['page']) | pNum = string.format(nFormat, frame.args['page']) | ||
Строка 39: | Строка 38: | ||
-- If we deal with Roman number then for v.1, p.xvii return 1:000017(xvii) | -- If we deal with Roman number then for v.1, p.xvii return 1:000017(xvii) | ||
if frame.args[' | if roman.isRoman(frame.args['page']) then | ||
-- 1. Fill with zeros all places for arabic digits for correct sorting. | -- 1. Fill with zeros all places for arabic digits for correct sorting. | ||
pNum = '000' | pNum = '000' |