Этот шаблон форматирует 9-значные SBN , 10- и 13-значные ISBN в соответствии с правилами, установленными Международным агентством ISBN. [1]
Шаблон принимает в качестве аргумента действительный ISBN и выдает отформатированную версию этого ISBN. Любые существующие дефисы в ISBN игнорируются, независимо от того, правильно ли они размещены:
{{format ISBN|97-8-1-57181655-9}}
→ 978-1-57181-655-9{{Format ISBN}}
предназначен для замены , чтобы вызов шаблона в викитексте был заменен на отформатированный ISBN. Замена может быть выполнена двумя способами. Самый простой и надежный способ — просто написать шаблон так же, как вы написали бы любой другой шаблон. После публикации вашей правки AnomieBOT , обычно в течение нескольких часов, выполнит замену. Другой способ — написать явно заменяемую форму шаблона, которая приведет к замене шаблона при публикации вашей правки:
{{subst:format ISBN|9781571816559}}
→ 978-1-57181-655-9Предупреждение: subst:
не работает внутри <ref>...</ref>
тегов (см. phab:T4700). Для использования внутри <ref>...</ref>
тегов используйте шаблон напрямую и разрешите AnomieBOT выполнить замену:
<ref> ... {{format ISBN|9781571816559}} ... </ref>
Обратите внимание, если вы напишете следующее:
<ref> ... {{subst:format ISBN|9781571816559}} ... </ref>
AnomieBOT не будет заменять шаблон.
Этот шаблон принимает три параметра: один безымянный и два именованных:
|1=
(неименованный параметр) – (обязательно) ISBN для форматирования|separator=
– (необязательно) принимает одно предопределенное ключевое слово: space
; когда |separator=space
, отображаемые элементы ISBN разделяются с помощью пробела; для любого другого значения этот шаблон отображает с разделителями-дефисами|out=
– (необязательно) принимает одно из двух предопределенных ключевых слов: 10
или 13
; для тех, кто хочет преобразовать ISBN10 в ISBN13, установить |out=13
; для преобразования ISBN13 в ISBN10 установить |out=10
. Этот параметр игнорируется, если входные данные:979
Если неименованный параметр этого шаблона не состоит из 9, 10 или 13 цифр, или контрольная цифра не соответствует ожидаемой от остальной части числа, то входное число возвращается без изменений. В таком случае форматирование невозможно, поскольку любая из цифр может быть неправильной, и это повлияет на размещение дефисов. Шаблон предназначен для использования во вложенном шаблоне, который будет сообщать о любых ошибках с длиной, контрольной цифрой или недопустимыми символами. В этом примере шаблона Format ISBN входные данные {{Format ISBN}}
содержат неправильную контрольную цифру, поэтому шаблон возвращает свои входные данные без изменений:
{{format ISBN|9789295055123}}
→ 9789295055123Если этот шаблон, использующий тот же недействительный ISBN, заключен в или , эти шаблоны выводят соответствующие сообщения об ошибках:{{ISBN}}
{{cite book}}
{{ISBN|{{format ISBN|9789295055123}}}}
{{cite book |title=ISBN Users' Manual: International Edition |edition=7th |location=London |publisher=International ISBN Agency |date=2017 |isbn={{format ISBN|9789295055123|nosubst=true}}}}
{{cite book}}
: Контрольное |isbn=
значение: контрольная сумма ( помощь )Примечание : замена будет произведена независимо от действительности введенного ISBN; рекомендуется предварительно просмотреть внесенные изменения.
ISBN13
{{format ISBN|9781571816559}}
→ 978-1-57181-655-9 (ввод из 13 цифр){{format ISBN|9783033009608}}
→ 978-3-033-00960-8 (немецкий ISBN начинается с 978-3){{format ISBN|9788876055485}}
→ 978-88-7605-548-5 (итальянский ISBN начинается с 978-88){{format ISBN|9791220008525}}
→ 979-12-200-0852-5 (итальянский ISBN начинается с 979-12 [2] ){{format ISBN|97-8-1-60520624-0}}
→ 978-1-60520-624-0 (13 цифр с недопустимыми переносами)ISBN10
{{format ISBN|1605206245}}
→ 1-60520-624-5 (ввод 10-значного кода [2] ){{format ISBN|0-385-33348-X}}
→ 0-385-33348-XСБН
{{subst:format ISBN|035789360}}
→ 03-578936-0 (ввод 9-значного (SBN))Неверный ввод
{{format ISBN|97808108596789}}
→ 97808108596789 (ISBN с неверной длиной ввода: не 10 или 13 цифр){{format ISBN|03578936X}}
→ 03578936X (9 цифр с недействительной контрольной цифрой; возможно, недействительная контрольная цифра SBN или ISBN10 с отсутствующей цифрой){{format ISBN|9780816645842}}
→ 9780816645842 (ISBN с неверной контрольной цифрой: должно быть 8){{format ISBN|Unknown}}
→ Неизвестно (параметр ISBN, содержащий текст, который не является ISBN){{format ISBN|9782D0GP00P37}}
→ 9782D0GP00P37{{format ISBN}}
→ (пустой вывод из пустого ISBN: нет сообщения об ошибке)Использование дополнительных параметров
{{format ISBN|9781571816559|separator=space}}
→ 978 1 57181 655 9 (Пробел используется в качестве разделителя в выходных данных){{format ISBN|9781571816559|out=10}}
→ 1-57181-655-0 (Конвертировать ISBN13 в ISBN10){{format ISBN|1571816550|out=13}}
→ 978-1-57181-655-9 (Конвертировать ISBN10 в ISBN13){{format ISBN|1571816550|out=13|separator=space}}
→ 978 1 57181 655 9 (Преобразовать ISBN10 в ISBN13 с пробелом в качестве разделителя)Чтобы прекратить ошибочные идентификации, всем системам США необходимо будет фактически вывести из обращения 10-значный идентификатор, прежде чем они начнут обрабатывать новые названия с префиксом 979.