M:Помощь:Ссылки: различия между версиями

Материал из Электронная энциклопедия ТПУ
Перейти к навигации Перейти к поиску
(Новая страница: «{{shortcut|ВП:ИВ}} '''Интерви́ки''' — это способ быстрого создания ссылок между несколькими [[ви...»)
 
Нет описания правки
Строка 1: Строка 1:
{{shortcut|ВП:ИВ}}
<!--
'''Интерви́ки''' — это способ быстрого создания ссылок между несколькими [[вики]]-сайтами, такими как [[Википедия]]. В Википедии есть удобный способ связывания параллельных статей [[Википедия:Список Википедий|на разных языках]], а также создания гипертекстовых ссылок на [[Фонд Викимедиа|братские вики-проекты]].
edit 7/7: As this was a significant (though not major) edit of an important reference page, special editing-comments are included, like this one --- helpful for Show Changes.  They should be removed if these changes are accepted.
{{Руководства}}
-->
<!-- Secret editing link-shortcuts!  (May be version-specific)
1. Insert link at top of page *to* section being edited.
2. Insert "[[#toolbar]]" somewhere *in* section being edited.
3. Remove both when done!
-- Will document later -->


== Ссылки на близкие по смыслу статьи в иноязычных разделах ==
<!-- problem: {{H:h|editor toc}} overlaps syntax-table when TOC is hidden -->
В левой (или правой, в зависимости от языка) части большинства статей Википедии есть список ссылок на аналогичные или близкие по смыслу иноязычные статьи. Для создания таких ссылок нужно в ''самом конце'' исходного текста поставить пометку вида:
{{H:h}}
: <tt><nowiki>[[</nowiki></tt>[[Википедия:Список Википедий|Код языка]]<tt><nowiki>:Название статьи]]</nowiki></tt>,
где '''''Код языка''''' — двух-трёх-(реже больше)буквенный код языка по стандарту [[ISO 639]], а '''''Название статьи''''' — название статьи на другом языке. Если нужно добавить ссылки на несколько различных языков, пожалуйста, помещайте каждую ссылку на отдельной строчке, столбиком. Например, чтобы связать статью [[Россия]] с соответствующими статьями в итальянском, японском и китайском разделах, делается запись:
<tt>
: <nowiki>[</nowiki>[it:Russia]]
: <nowiki>[</nowiki>[ja:ロシア]]
: <nowiki>[</nowiki>[zh:俄罗斯]]
</tt>
В некоторых случаях используется код языка из более чем двух букв, например:
<tt>
: <nowiki>[</nowiki>[simple:Russia]]
</tt>
Пожалуйста, не копируйте слепо интервики-ссылки из статьи на другом языке. Ставьте ссылки только на те языки, для которых вы убедились в правильности ссылки. Остальную работу автоматически доделают специальные интервики-[[Википедия:Бот|боты]].


Следует поставить обратную ссылку на статью в русском разделе в соответствующей статье в одном из крупных иноязычных разделов (английском, французском, немецком). Таким образом интервики-бот доделает работу по копированию ссылки во все остальные разделы намного быстрее (тогда связывать статьи будут не только боты, работающие в нашем разделе, но и боты другого раздела).
''[[w:ru:Гиперссылка|Гиперссылки]] дают пользователям возможность перемещаться между страницами. Для просмотра базовой информации по wiki-форматированию смотрите [[Помощь:Редактирование]].


Статьи, между которыми есть интервики-ссылки, должны практически или хотя бы потенциально соответствовать по своей тематике и объёму понятия. Это значит, например, что если в одной википедии есть целая статья «Парламентская демократия», а в другой википедии есть статья «Демократия» в которой есть параграф «Парламентская демократия», не следует связывать их интервики-ссылкой. Кроме того не следует устанавливать интервики-ссылку в русской статье X на иностранные статьи, содержащие русскую интервики на статью Y. Такие конфликты нарушают правильную работу ботов и вообще нежелательны.
В MediaWiki нет возможности создавать гиперссылки при помощи [[w:ru:HTML|HTML]]. Вместо этого есть три основных вида гиперссылок, каждый со своим [[w:ru:Cascading Style Sheets|CSS-форматированием]]: wiki-ссылки (''wikilinks''), interwiki-ссылки (''interwiki links'', ссылки между различными wiki) и внешние ссылки. Кроме линковки, каждый из видов ссылок обеспечивает дополнительный функционал, специфичный для wiki-движков, например, определение ''битых'' ссылок (ссылок на несуществующие страницы) для wiki-ссылок и автоматическая нумерация внешних ссылок, когда они используются в сносках.


Не следует связывать между собой статьи и страницы разрешения неоднозначностей, потому что такая связь быстро приведёт к возникновению интервикиконфликтов. Статьи должны быть связаны со статьями, а страницы разрешения неоднозначностей с такими же страницами в других языковых разделах.
== Wiki-ссылки ==
Wiki-ссылка - это  [[w:internal link|внутренняя ссылка]] на другую страницу или секцию страницы в пределах одной [[w:wiki|wiki]]. MediaWiki автоматически проверяет, существует ли цель wiki-ссылки ("[[Help:Page existence|определение существования]]"). Если страница не существует, то ссылка ведет к секции редактирования, и ей присваивается класс "новая". Такие wiki-ссылки называются "красными ссылками", т.к. они выделяются красным цветом шрифта в таблице стилей по умолчанию. "Красные ссылки" полезны для определения текущего статуса страницы (создана или не создана), создания ссылок на планируемые странцы и для поощрения создания новых страниц другими пользователями. Также, через пункт меню "Ссылки сюда" примененный к несуществующий странице можно обеспечить непрямые ссылки на другие страницы с той же красной ссылкой.


== Ссылки в тексте ==
Ссылка на несуществующую страницу в пространстве имен MediaWiki для существующего [[help:system message|системного сообщения]] считается ссылкой на существующую страницу.
Можно также вставлять [[гипертекст]]овые ссылки на любые статьи из Википедии на другом языке. Это делается так же, как и для внутренней ссылки, но перед названием статьи добавляется двоеточие, двухбуквенный код и снова двоеточие:


<center><nowiki>[[:en:Russia|английская статья о России]]</nowiki></center>
===Синтаксис===
что будет отображено так:
MediaWiki определяет wiki-ссылку как закрывающийся набор пар квадратных скобок '<nowiki>[[ ]]</nowiki>'. Цель ссылки - последовательность символов, расположенная между первой парой скобок и каналом (pipe,  '|') или закрывающей парой скобок ']]'. Целью ссылки может быть другая страница wiki , секция той же страницы, на которой расположена ссылка, или секция другой страницы wiki.
<center>[[:en:Russia|английская статья о России]]</center>


Но ссылаться на иноязычные статьи непосредственно в тексте '''нежелательно'''. Оправдать гиперссылку-интервики можно лишь в следующих случаях:
* Межстраничные ссылка: ссылка вида <code><nowiki>[[имя_страницы]]</nowiki></code>, ведет на страницу с именем "имя_страницы"
* когда надо сослаться именно на иноязычную '''статью''', а не на её объект (применяется в основном в обсуждениях);
* когда надо сослаться на сам раздел Википедии — делается обычно через шаблон {{tl|interwiki}};
* когда она ведёт на документацию (в том числе русскую) или метастатью, расположенную на [[ВП:Мета-вики|Мета-вики]] (синтаксис см. ниже);
* когда она ведёт на описание внутрикультурного понятия, о котором вряд ли стоит писать на русском.


== Коды проектов фонда ==
* Внутристраничная ссылка: ссылка вида <code><nowiki>[[#имя_ссылки]]</nowiki></code> ведет на первую секцию текущей страницы, которая имеет заголовок (или якорь), с именем "имя_ссылки".
У каждого проекта Фонда [[Викимедиа]] также есть свой код, который в общем случае состоит из двух частей:
* языкового кода,
* собственно код проекта.


При формировании ссылки код проекта следует помещать '''до''' языкового кода, также разделяя их двоеточиями. К примеру, если нужно сослаться на страницу Star Wars в [[q:en:|английском Викицитатнике]], необходимо использовать следующий код:
* Межстраничная "интра" ссылка: ссылка вида <code><nowiki>[[имя_страницы#имя_ссылки]]</nowiki></code> ведет на соответствующую секцию страницы с именем "имя_страницы", см. [[Help:Section#Section_linking|ссылки на секции]].
: <tt><nowiki>[[q:en:</nowiki>[[q:en:Star Wars|Star Wars]]<nowiki>]]</nowiki></tt>
Некоторое время назад перед кодом проекта было обязательно указывать еще одно двоеточие (<nowiki>[[</nowiki>''':'''<nowiki>q:en:Star Wars|Star Wars]]</nowiki>), но теперь это стало не обязательным условием. Старый вариант, когда требовалось указывать дополнительное двоеточие, по-прежнему функционирует и не нуждается в исправлении.


Если в ссылке используется только языковой код, например, '''[[:en:]]''', '''[[:de:]]''', '''[[:fr:]]''', то:
Синтаксис wiki-ссылок также включает в себя различные опции форматирования, определяющие внешний вид ссылок.
* если текущий проект разделён на несколько языков (Википедия, Викисловарь, Викицитатник и т. п.) — ссылка приведёт в соответствующий языковой раздел текущего проекта,
* если же проект не разделён по языкам ([[ВП:Мета-вики|Мета-вики]], [[Викисклад]]) — ссылка приведёт в соответствующий языковой раздел Википедии.
Двоеточие перед кодом языка необходимо для того, чтобы ссылка осталась внутри текста, иначе она попадёт в секцию для интервик.


'''Проекты Викимедиа, разделённые по языкам:'''
<!-- TEMPLATE FOR ADDITIONS TO SYNTAX TABLE: -->
* '''[[w:]]''' — соответствующий языковый раздел Википедии (из подразделов других проектов) — например, из русского Викисловаря будет переход в русскую Википедию, а из английского — в английскую. При ссылке из языкового раздела Википедии, отличного от английского, ссылка будет вести на английский раздел.
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
* '''[[b:]]''' — [[Викиучебник]]
<!-- {{wikilink_syntax_tbl|[[LINK]]|= -->
* '''[[n:]]''' — [[Викиновости]]
<!--              |<nowiki>[[LINK]]</nowiki>|= -->
* '''[[q:]]''' — [[Викицитатник]]
<!-- |TARGET|=  -->
* '''[[s:]]''' — [[Викитека]]
<!-- |DESCRIPTION}} -->
* '''[[v:]]''' — [[Викиверситет]]
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
* '''[[wikt:]]''' — соответствующий языковой раздел Викисловаря
<!-- -->
<!-- -->


'''Проекты Викимедиа, не разделённые по языкам:'''
{| class="wikitable" style="width:95%"
* '''[[:m:]]''' — [[ВП:Мета-вики|Метавики]]
* '''[[:commons:]]''' — [[Викисклад]]
* '''[[:wikispecies:]]''' — [[Викивиды]]
* '''[[:mw:]]''' — [[MediaWiki]]
* '''[[:mediazilla:]]''' — [[Bugzilla]]
*  '''[[:testwiki:]]''' — тестовый Вики-проект


Чтобы единообразно ссылаться на определённую статью из любого проекта, используется дополнительная приставка [[:m:]]; так, ссылка [[:m:w:de:Berlin]] будет всегда указывать на статью про Берлин в немецкой Википедии, независимо от того, из какой языковой версии какого проекта вы её использовали.
!colspan="5" align="left"|Основы синтаксиса wiki-ссылок


Приставки всех (в том числе пока не существующих) проектов фонда Викимедиа указаны на странице '''[[Служебная:SiteMatrix]]'''.
{{wikilink_syntax_tbl|''Результат''|''Код''|''Цель''|  ''Описание''  }}


Можно также ссылаться на некоторые внешние проекты, например, [[Wiki:WelcomeVisitors]], [[MeatBall:MeatballWiki]] или [[Google:searchterm]]. Список возможных приставок приведён на странице '''[[:m:Interwiki map]]'''.
{{wikilink_syntax_tbl|[[a]]|=
            |<nowiki>[[a]]</nowiki>|=
|a|=
|Простейшая wiki-ссылка}}


Остальные приставки игнорируются и считаются внутренними ссылками. Выделение ссылок на ещё не созданные статьи работает только для внутренних ссылок.
{{wikilink_syntax_tbl|[[a b]]|=
            |<nowiki>[[a b]]</nowiki>|=
|a b|=
|Несколько слов}}


== Статьи без интервики-ссылок ==
{{wikilink_syntax_tbl|[[a b|c d]]|=
Если вы предполагаете, что в иноязычной википедии существует подходящая статья, но сами не можете её отыскать, следует поставить в русскую статью шаблон {{tl|нет интервики}}. Этот шаблон помещает статью в категорию [[:Категория:Википедия:Статьи без интервик|Википедия:Статьи без интервик]].
            |<nowiki>[[a b|c d]]</nowiki>|=
|a b|=
|Ссылка указывает на 'a b', но отображается как 'c d' *}}


Если вы добавили интервики в статью, помеченную шаблоном {{tl|нет интервики}} — пожалуйста, не забудьте убрать этот шаблон из текста статьи.
{{wikilink_syntax_tbl|[[a b]]c|=
            |<nowiki>[[a b]]c</nowiki>|=
|a b|=
|Наименование ссылки совпадает с целью ссылки, к последнему слову в наименовании добавлено окончание}}


Существует проект по расставлению интервики-ссылок по темам - [[Википедия:Проект:Интервики]]. Вы можете помочь проекту, проставив интервики-ссылки в статьях, находящихся в этой категории.
{{wikilink_syntax_tbl|<nowiki>[[a]]</nowiki>|=
            |<nowiki><nowiki>[[a]]</nowiki></nowiki>|=
|&Oslash;|=
|Текст отображается как есть, без свойств ссылки}}


== Интервики и дубликаты статей ==
{{wikilink_syntax_tbl|[[a (b)|a]]|=
Если Вы собираетесь писать новую статью для русской Википедии, то имеет смысл сначала поискать её предмет в других языковых разделах, особенно в крупных ([[:en:|английском]], [[:de:|немецком]], [[:fr:|французском]]). Помимо того, что сама найденная там информация может оказаться полезной при написании планируемой вами статьи, там может оказаться интервики-ссылка на уже имеющуюся на русском языке аналогичную статью. В таком случае имеет смысл подумать, а нужна ли новая статья, или можно ограничиться созданием [[Википедия:перенаправления|перенаправления]]. Такая последовательность работы поможет избежать создания дублей статей, а также (в ряде случаев) в поисках таких дублей.
            |введено: <nowiki>[[</nowiki>a (b)&#124;]],<br>
преобразовано в: <nowiki>[[a (b)|a]]</nowiki>|=
|a (b)|=
|Канал '&#124;' непосредственно перед закрывающей парой скобок ']]' создает ссылку, в наименовании которой скрыт текст, находящийся в круглых скобках *,***}}


Аналогично, случается наткнуться на дубль и при поиске иностранных соответствий для уже существующей русской статьи без interwiki — само по себе их отсутствие может служить намёком на возможное дублирование или чрезмерную фрагментацию материала. В случае обнаружения дублирования статей не проставляйте интервики, а пишите сразу на [[Википедия:К объединению]].
{{wikilink_syntax_tbl|[[a, b|a]]|=
            |введено: <nowiki>[[</nowiki>a, b&#124;]],<br>преобразовано в: <nowiki>[[a, b|a]]</nowiki>|=
|a, b|=
|Канал '&#124;' непосредственно перед закрывающей парой скобок ']]' создает ссылку, в наименовании которой скрыта запятая и всё, что идёт после неё *,***}}


== Порядок следования интервики ==
{{wikilink_syntax_tbl|[[w:a|a]]|=
В разных языковых разделах Википедии принят разный порядок следования интервики на статью на других языках (см. [[m:Interwiki sorting order]]{{ref-en}}). Например, в английской Википедии они обычно указываются в алфавитном порядке по названию языка. В русской Википедии — обычно в алфавитном порядке по коду языка.
            |введено: <nowiki>[[</nowiki>w:a&#124;]],<br>преобразовано в: <nowiki>[[w:a|a]]</nowiki>|=
|w:a|=
|Канал '&#124;' непосредственно перед закрывающей парой скобок ']]' создает ссылку, в наименовании которой скрыта первый префикс ссылки *,**,***}}


== Дополнительные шаблоны ==
{{wikilink_syntax_tbl|[[w:a (b)|a]]|=
Если статья, на которую ссылается интервики, является [[Википедия:Избранные статьи|избранной]] или [[Википедия:Хорошие статьи|хорошей]] в своём языковом разделе, то в вики-код статьи добавляют специальный невидимый шаблон {{tl|Link FA}} или {{tl|Link GA}}. Тогда интервики на эту статью выделяется жёлтой или синей звёздочкой. Это позволяет участникам использовать качественные иноязычные статьи для улучшения русской Википедии.
            |введено: <nowiki>[[</nowiki>w:a (b)&#124;]],<br>преобразовано в: <nowiki>[[w:a (b)|a]]</nowiki>|=
|w:a (b)|=
|Канал '&#124;' непосредственно перед закрывающей парой скобок ']]' создает ссылку, в наименовании которой скрыт и первый префикс ссылки, и текст в скобках *,***}}


Для ссылок на родственные проекты в конце статьи рекомендуется использовать универсальный шаблон {{[[Шаблон:Навигация|Навигация]]}}.
{{wikilink_syntax_tbl|[[mediawiki:1movedto2]]|=
            |entered: <nowiki>[[</nowiki>mediawiki:1movedto2&#124;]]|Mediawiki:1movedto2}}


== См. также ==
{{wikilink_syntax_tbl|[[mediawiki:1movedto3]]|=
* [[Интервики]]
            |entered: <nowiki>[[</nowiki>mediawiki:1movedto2&#124;]]|Mediawiki:1movedto2}}
* [[meta:Help:Interwiki linking]] {{ref-en}}
* [[Служебная:SiteMatrix|Список проектов Викимедиа]]
* [[meta:Interwiki map]] {{ref-en}} — список дополнительных интервик на разные проекты
* [[meta:Interwiki sorting order]] {{ref-en}}
* [[mw:Manual:Interwiki/ru|Описание интервики в документации MediaWiki]]
* [[:Категория:Википедия:Статьи без интервик]]
* [[ВП:Форум/Интервики]]
* [[Википедия:Конфликт межъязыковых ссылок]]


[[Категория:Википедия:Справка|{{PAGENAME}}]]
|}
[[Категория:Википедия:Интервики| ]]


[[als:Hilfe:Internationalisierung]]
<!-- basics (above) & tricks (below) are really separate topics -->
[[ar:مساعدة:وصلات اللغات]]
 
[[be:Вікіпедыя:Інтэрвікі]]
{| class="wikitable" style="width:95%"
[[bg:Уикипедия:Междууики]]
 
[[ca:Ajuda:Enllaç interviqui]]
<!-- id added for anchor demo below -->
[[cs:Nápověda:Mezijazykové odkazy]]
!colspan="5" align="left" id="Wiki-link Tricks"|Wikilink Tricks & Demos
[[da:Hjælp:Henvisninger til andre sprog]]
 
[[de:Hilfe:Internationalisierung]]
{{wikilink_syntax_tbl|''Результат''|''Код''|''Цель''|  ''Описание''  }}
[[el:Βικιπαίδεια:Διαγλωσσικές συνδέσεις]]
 
[[en:Help:Interlanguage links]]
{{wikilink_syntax_tbl|[[a|b|c]]|=
[[eo:Helpo:Interlingva ligilo]]
            |<nowiki>[[a|b|c]]</nowiki>|=
[[es:Ayuda:Enlace interlingüístico]]
|a|=
[[fa:ویکی‌پدیا:پیوند بین زبان‌ها]]
|Wiki-разметка распознает второй канал '&#124;', как обычный текст *}}
[[fi:Wikipedia:Kieltenväliset linkit]]
 
[[fr:Aide:Lien interlangue]]
{{wikilink_syntax_tbl|[[a|b]]c|=
[[gl:Wikipedia:Ligazóns interlingüísticas]]
            |<nowiki>[[a|b]]c</nowiki>|=
[[he:עזרה:בינוויקי]]
|a|=
[[hr:Wikipedija:Međuwikipoveznice]]
|'c' is appended to the end of the link text, targets 'a' -- (Good for adding a plural-'s') *}}<!-- hint to encourage space-saving -->
[[hsb:Pomoc:Mjezyrěčne wotkazy]]
 
[[hu:Wikipédia:Nyelvközi hivatkozások]]
{{wikilink_syntax_tbl|a[[b]]|=
[[ia:Adjuta:Ligamines interlingual]]
            |<nowiki>a[[b]]</nowiki>|=
[[id:Wikipedia:Pranala antarbahasa]]
 
[[it:Aiuto:Interlink]]
|b|=
[[ja:Help:言語間リンク]]
|'a' непосредственно предшествует тексту ссылки, но не входит в него}}
[[jv:Wikipedia:InterWiki]]
 
[[ko:위키백과:인터위키]]
{{wikilink_syntax_tbl|[[a]]<nowiki>b</nowiki>|=
[[la:Vicipaedia:Nexus intervici]]
            |<nowiki>[[a]]<nowiki>b</nowiki></nowiki>|=
[[ms:Wikipedia:Pautan antara bahasa]]
|a|=
[[nl:Help:Gebruik van interwiki-links]]
|'b' следует непосредственно за текстом ссылки, но не входит в него}}
[[no:Hjelp:Lenke til andre språk]]
 
[[oc:Ajuda:Ligam interlenga]]
{{wikilink_syntax_tbl|[[a]]''b''|=
[[pl:Pomoc:Interwiki]]
            |<nowiki>[[a]]''b''</nowiki>|=
[[pt:Ajuda:Guia de edição/Interwikis]]
|a|=
[[ro:Wikipedia:Legături interlingve]]
|Using double apostrophes <nowiki>''</nowiki> around 'b' to make it italicized excludes it from the link text}}
[[simple:Wikipedia:Interwiki]]
 
[[sk:Pomoc:Medzijazykové odkazy]]
{{wikilink_syntax_tbl|[[a]]'''b'''|=
[[sl:Wikipedija:Medjezikovne povezave]]
            |<nowiki>[[a]]'''b'''</nowiki>|=
[[sr:Википедија:Како постављамо интервики линкове]]
|a|=
[[sv:Wikipedia:Interwikilänkar]]
|Using triple apostrophes <nowiki>'''</nowiki> around 'b' to make it bold excludes it from the link text}}
[[th:วิกิพีเดีย:ลิงก์ข้ามภาษา]]
 
[[tr:Vikipedi:InterWiki]]
{{wikilink_syntax_tbl|[[a|b]]c<nowiki>d</nowiki>|=
[[tt:Ярдәм:Wikiara läñker]]
            |<nowiki>[[a|b]]c<nowiki>d</nowiki></nowiki>|=
[[uk:Довідка:Інтервікі]]
|a|=
[[uz:Vikipediya:Interviki]]
|Translates like <nowiki>[[a|bc]]<nowiki>d</nowiki></nowiki> *}}
[[vi:Trợ giúp:Liên kết giữa ngôn ngữ]]
 
[[yi:װיקיפּעדיע:אינטערוויקי לינקען]]
{{wikilink_syntax_tbl|[[a]][[b]]|=
[[zh:Help:跨语言链接]]
            |<nowiki>[[a]][[b]]</nowiki>|=
[[zh-min-nan:Wikipedia:Gú-giân liân-kiat]]
|a , b|=
|Two links next to each other, looks like [[ab]] when not hovered over with a [[w:cursor (computers)|cursor]]}}
 
|}
<nowiki>*</nowiki> Англоязычный термин для ссылок, оформленных таким образом, через текст ссылки в качестве параметра — [[help:piped link|piped links]].
 
<nowiki>**</nowiki> Вне зависимости от вида префикса — ведет он в другую вики (интервики), в другое пространство имен, или просто текст ссылки содержит двоеточие.
 
<nowiki>***</nowiki> Не работает с внутристраничными #-викиссылками ([[#syntax|intra-page]]): отображает [[#xxxx|]] как текст.
 
<!-- Периодически проверять, работает ли:  
[[a|]], [[#a|]], [[p#a|]]
[[a b|]], [[#a b|]], [[p#a b|]]
[[w:a|]], [[w:#a|]], [[w:p#a|]]
[[w:a (b)|]], [[w:#a (b)|]], [[w:p#a (b)|]]
-->
 
<!-- edit 7/7: block moved up -->
 
Note that the image, category, and interlanguage syntax are the same as the wikilink syntax. Attempting to link normally will place the image on the page, add the page to the category and create an interlanguage link at the edge of the page. This can be prevented by prefixing a colon, which escapes the specific syntax. For example, <code><nowiki>[[:Category:Help]]</nowiki></code>, <code><nowiki>[[:fr:Help:Link]]</nowiki></code>, and <code><nowiki>[[:File:Mediawiki.png]]</nowiki></code>.
 
In the case of a link to a local, non-existing, dynamically generated image description page of an image on Commons, this page is counted as existing for links on pages, e.g. [[:File:Cow-on pole, with horns.jpeg]], but not for links in edit summaries and logs.
 
The existence of an internal link from a page to an existing or non-existing page is recorded in the [[pagelinks table]].
 
===Заготовки статей===
A wikilink to an existing page will be in class 'stub' if the page is in the main namespace, it is not a redirect, '''''and''''' the number of bytes of the wikitext is less than the "threshold for stub display" set in the [[Help:Preferences|user's preferences]].
 
This allows users to immediately identify links to very short pages that probably need to be expanded, and links to short disambiguation pages. Alternately, a user may set a very high threshold to achieve any of the following:
* Identify links to very large pages. However, the criterion is the size of the wikitext; possible inclusion of templates and images can make the rendered page large, even if the amount of wikitext is small.
* Determine at a glance whether a link leads to the main namespace or not. However, this does not take into account ''redirects'' to the main namespace (even if the redirect itself is in the main namespace).
* Identify links to redirects, for clean-up work such as bypassing redirects.
 
However, section linking to a "stub" does not work. Although this is normally a minor issue, this may cause problems with users who set a very high threshold.
 
== Интервики ==
{{main|Help:Interwiki linking}}
An '''[[Help:Interwiki linking|interwiki link]]''' links to a page on another website. Unlike the name suggests, the target site need not be a wiki, but it has to be on the [[m:Interwiki map|interwiki map]] specified for the source wiki. These links have the associated CSS class "extiw". These are in the same form as wikilinks above but take a prefix which specifies the target site. For example, on Wikimedia projects (except Wikipedias) and many other wikis <code><nowiki>[[wikipedia:Main Page]]</nowiki></code> links to the main page of the English Wikipedia. The prefix can be hidden using the same piped syntax as wikilinks.
 
An interwiki can also link to a section or other anchor, see [[Help:Section#Section_linking|section linking]].
 
=== Интервики в тот же проект ===
Although interwiki links can be used to point to a wiki from itself, this is not generally recommended. MediaWiki does not detect whether or not the target page of an interwiki list exists, so there is no special formatting and the link is always to the view page. Further, MediaWiki does not check if the page is linking to itself. A [[Help:Self link|self wikilink]] is bolded (like [[{{NAMESPACE}}:{{PAGENAME}}]]), whereas a self interwiki link is normal ([[m:{{NAMESPACE}}:{{PAGENAME}}]]).
 
Pros:
* A copy of the wikitext on a sister project may still point to the same page. Sometimes two prefixes are needed for that purpose, e.g. [[w:de:a]].
 
Cons:
* Link has non-standard appearance
* No existence-detection for target page
 
== Внешние ссылки ==
External links use absolute URLs to link directly to any webpage. These links have the associated CSS class "external". External links are in the form <code><nowiki>[http://www.example.org link name]</nowiki></code> (resulting in [http://www.example.org link name]), with the link name separated from the URL by a space. Links without link names will be automatically numbered: <code><nowiki>[http://www.example.org]</nowiki></code> becomes [http://www.example.org]. Links with no square brackets will be displayed in their entirety: http://www.example.org.
 
To show a URL without link use e.g.  <code><nowiki>&lt;nowiki>http://www.example.org&lt;/nowiki></nowiki></code> giving <nowiki>http://www.example.org</nowiki>.
 
Unlike in the case of internal links, characters immediately after the closing bracket are not added to the link label: <nowiki>[http://www.example.org a]s</nowiki> gives [http://www.example.org a]s.
 
See [[Help:URL#URLs in external links|URLs in external links]] for more detailed information.
 
===Ссылки на e-mail===
 
Links to an E-mail address work the same way that external links do, except they require the prefix <code>mailto:</code>. E-mail links are in the form of <code><nowiki>[mailto:anyone@example.org address name]</nowiki></code> (resulting in [mailto:anyone@example.org address name]), with the link name separated from the address by a space. Addresses without names will automatically be numbered: <code><nowiki>[mailto:anyone@example.org]</nowiki></code> becomes [mailto:anyone@example.org]. Addresses without square brackets will not be rendered as link, e.g. anyone@example.com. It's possible to make CC with <code><nowiki>[mailto:anyone@example.org?cc=anyone2@example.org address name]</nowiki></code> (resulting in [mailto:anyone@example.org?cc=anyone2@example.org address name]).
 
=== Ссылки на специальные страницы того же проекта ===
External links support various special optional URL parameters in their linking-code. These allow links directly to the edit history of a page, to a page in edit view, a diff of two versions, et cetera. They can also be used to create a [[Help:Navigational image|navigational image]].
<!-- edit 7/7: block moved down -->
 
For portability, use "fullurl" where the URL should depend on the project.
 
=== Иконки после ссылки ===
MonoBook skin produces an arrow icon after every external link. This can be suppressed with class="[[mw:Plainlinks|plainlinks]]":
 
*<code><nowiki>[http://a a]</nowiki></code> gives [http://a a]
*<code><nowiki><</nowiki>span class="plainlinks"><nowiki>[http://a a]</</nowiki>span></code> gives <span class="plainlinks">[http://a a]</span>
 
With some special code on [[MediaWiki:Common.css]] such as on [[m:MediaWiki:Common.css]], external links to PDF files have their own icon [[File:Icons-mini-file_acrobat.gif]]. On this site with your current settings http<nowiki>://a.pdf</nowiki> gives http://a.pdf .
 
===Пропуск номера ссылки ===
To skip a number in the automatically numbered external links (for whatever reason), use e.g. <nowiki><span style="display:none">[http://a]</span></nowiki>: [http://meta.wikimedia.org]<span style="display:none">[http://a]</span>[http://meta.wikimedia.org].
 
Note that a false condition of a ParserFunction, or a template like {{links-small|template|x0}} does not work, because counting the links is done after expansion of templates and parser functions.
 
=== Поиск по внешним ссылкам ===
[[Special:Linksearch]] (an extension installed on Wikimedia wikis, [http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/LinkSearch]) finds all pages linking to a given URL. Using the [[mw:externallinks table|externallinks table]] it provides for a given external link pattern a list of source page names on the wiki concerned (linked) with for each the full link target (also as a link). One can either search all namespaces or a selected one. A leading wildcard '''*''' can be used to search links to a whole [[w:top-level domain|top-level domain]] (e.g. [http://en.wikipedia.org/wiki/Special:Linksearch?title=Special%3ALinksearch&target=*.nl]), or a [[w:second-level domain|second-level domain]] (e.g. [http://en.wikipedia.org/wiki/Special:Linksearch?title=Special%3ALinksearch&target=*.ns.nl]), etc. In the case that a full domain name is specified, one can additionally specify the rest of the URL, or the first part of that (a wildcard at the end is implied), e.g. [http://meta.wikimedia.org/wiki/Special:Linksearch?title=Special%3ALinksearch&target=en.wikipedia.org/wiki/Portal].
 
Remarks:
*Do not put "http://".
*The colon in the URL may cause the program return no results.
*A MediaWiki page name in a URL has underscores instead of spaces. Also the URL specified in Linksearch requires writing underscores.
*Even if multiple URLs lead to the same target, with regard to capitalisation, multiple underscores, and using "index.php" or not, Linksearch is case-sensitive and also does not find alternatively written URLs. Therefore, when creating an external link, for optimal use of Linksearch, use a canonical form for the URL. In particular, if after following a link the address bar shows a modified URL, change the URL in the link to that.
*The list is {{ml|Help:Alphabetic_order|alphabetic}} in the URL. Note that an underscore, unlike a blank space, is alphabetically positioned between "Z" and "a".
 
===Обратные ссылки===
<!-- edit 7/7: moved from above -->
Commonly, a link to a normal page on the same project is in internal link style. An advantage is the existence detection. Also, if some links are in internal and some in external link style, we need both "What links here" and Linksearch for finding all backlinks. However, especially for a link to a section or explicitly-set anchor, one could put an internal link and also, with CSS style "display=none", an external link, to provide backlinks.
 
External link style is also superior to interwiki link style. The URL specified for Linksearch can even contain an anchor (see below), or the first part of an anchor. Therefore Linksearch can find backlinks of sections and explicit anchors. In this regard external links are even superior to internal links. We can combine the advantages of internal and external link style by putting both, but hiding the external links: <nowiki><span style="display:none">http://...</span></nowiki>
 
<!-- edit 7/7: rearranged and expanded -->
 
== Якоря ==
{{seealso|Template:Anchor}}
===Ссылки на якоря===
Links of the form <code><nowiki>[[#anchor_name]]</nowiki></code> will link to the first anchor on the page matching that "anchor_name", usually the first identical section heading.
 
An #anchor_name can also be appended to the page name in any type of link, thus linking to the first identical section heading (or anchor) of the '''named''' page:
 
<code><nowiki>
[[Help:Editing#Links]], [[m:Help:Editing#Links]],
</nowiki></code>
 
<code><nowiki>
http://meta.wikimedia.org/wiki/Help:Editing#Links
</nowiki></code>
 
=== Якоря, расставляемые автоматически ===
Section headings automatically act as anchors, with the heading text as the "anchor_name".  In the case of multiple sections with identical headings, the anchor name of each has "_2", "_3", etc. appended, starting from the second occurrence.
 
The anchor [[#toc]] links to the table of content of the page, unless there is a section titled "toc".
 
===Якоря, расставляемые вручную ===
Manually-set anchors are useful for linking to "unlinkable" things like a table (title or cell), a section of plain text, etc.  For example, in the [[#Wiki-link Tricks|Wikilink Tricks & Demos table]] above, though the "Wikilink Tricks & Demos" title-text appears like a (minor) heading, it is not, and the otherwise perfectly normal wikilink <code><nowiki>[[#Wikilink Tricks & Demos]]</nowiki></code> will not work.
 
There are a number of ways to set an anchor at an arbitrary position:
<!-- tested 7/7 -->
 
* On some wikis, a [[template]] called "anchor" exists, e.g. {{links-small|template|anchor}} and {{links-small|w|template|anchor}}, providing a simple, standardized method for that wiki.
 
* Generic anchor: <code><nowiki><span id="anchor_name">some text</span></nowiki></code>.  For a hidden anchor, omit the text.
 
* Manual HTML headings (discouraged): <code><nowiki><h2>How to Edit</h2></nowiki></code>.  Text is anchor_name.<!-- demo of this code creates useless entry in TOC -->
 
* In some cases, inserting an HTML-like ID attribute into an (existing) Wiki-element.  For example, from the [[#Wiki-link Tricks|Wikilink Tricks & Demos
]] table above:<br>
<code><nowiki>
!colspan="5" align="left" id="Wiki-link Tricks"|Wikilink Tricks & Demos
</nowiki></code>
 
* The reserved name <code><nowiki>[[#top]]</nowiki></code> always links to the [[#top|top of a page]].
 
 
See also [[Help:Section#Section_linking]].
 
=== Якоря для поиска по внешним ссылкам ===
As mentioned above, if external link style is used, e.g. [http://meta.wikimedia.org/wiki/Help:Section#Section_linking], we can use [[Special:Linksearch]]: [http://meta.wikimedia.org/wiki/Special:Linksearch?title=Special%3ALinksearch&target=meta.wikimedia.org/wiki/Help].
 
Since Linksearch allows specifying the first part of an anchor, it is useful, if anchor names are numerical or have a numerical end, to use leading zeros. Otherwise, when searching for links to e.g. "1", we also get links to "10", etc. This is e.g. applied in [[w:Portal:Current events/DateHeader2]]. More generally, if there are anchors "a" and "ab", it may or may not be desired that a search for links to "a" also  gives links to "ab"; if not, use an anchor "_a".
 
=== «Каталожные» якоря ===
If anchor names have multiple components, it is useful to put the most significant component first, e.g. if anchors indicate months or dates, we could have the format YYYY-MM, or YYYY-MM-DD, or in a year page MM-DD  (see also [http://en.wikipedia.org/wiki/Calendar_date#Big_endian_forms.2C_starting_with_the_year]), with leading zeros (see also [http://meta.wikimedia.org/wiki/Help:Date_formatting_and_linking#Link_to_date_content_other_than_required_for_autoformatting]). This applies also for page names, but since these are highly visible, as opposed to anchors, other considerations play a role too. In the case of sections, if for link targets another naming scheme is desired than for display of section headings, explicitly put anchors instead of using section names. This is applied in [[w:Portal:Current events/DateHeader2]], where the use in links of the names of explicitly put anchors is enforced by using pseudo sections, with displayed headings that cannot be used as anchors.
 
===Якоря во внешних ссылках (anchorencode)===
In an external link, an anchor can be created conveniently with the parser function [[anchorencode]], for example, {{xpdoc|anchorencode:Anchors in external links (anchorencode)}}, which can be used to form the link {{fullurl:{{PAGENAME}}}}#{{anchorencode:Anchors in external links (anchorencode)}}
 
==Подстраницы ==
MediaWiki has a [[w:subpage|subpage]] feature, although activation depends on project and namespace. If activated, the following applies (if not, "A/b" is just a page with that name).
 
A [[w:en:tree structure|tree structure]] of pages is established by using forward slashes in pagenames: A/b is a child of A, hence A is a parent of A/b; also A/b/c is a child of A/b; while A/a, A/b, and A/c are siblings.
At the top of the subpage body links to all ancestor pages are shown automatically, without any corresponding wikitext. The links show up even if the parent page does not exist, but the sequence of ancestors stops before any non-existing ancestor page (e.g., if the grandparent page does not exist, the parent page is not shown either). Like most letters of a page name, the first letter after the slash is case-sensitive; "/subpage" and "/Subpage" are different pages.
 
[[Help:What links here|What links here]] and [[Help:Related changes|Related changes]] ignore these automatic links.
 
In the namespace where the subpage feature is activated, any slash in a page name causes a subpage structure, even if unintended.
 
A list of subpages can be obtained using [[Special:PrefixIndex]].
 
===Переменные ===
On page A:B/c/d, where A is a namespace with the subpage feature enabled, <nowiki>{{BASEPAGENAME}}</nowiki> gives B/c and <nowiki>{{SUBPAGENAME}}</nowiki> gives d
 
=== Относительные ссылки ===
Inside a subpage hierarchy the following relative links can be used:
* <nowiki>[[../]]</nowiki> links to the parent of the current subpage, e.g., on A/b it links to A, on A/b/c it links to A/b.
* <nowiki>[[../../]]</nowiki> links to the grandparent of the current subpage, e.g., on  A/b/c it links to A.
* <nowiki>[[../s]]</nowiki> links to a sibling of the current subpage, e.g., on A/b, it links to A/s.
* <nowiki>[[../../s]]</nowiki> links to an "uncle" of the current subpage, e.g., on A/b/c, it links to A/s.
*<nowiki>[[/s]]</nowiki> links to a subpage, e.g. on A it is the same as <nowiki>[[A/s]]</nowiki>. Because of this, linking from a namespace where the subpage feature is enabled to a page in the main namespace with a name starting with "/", requires a workaround: put a colon before the pagename.
 
Linking to an [[#Anchors|anchor]] of an ancestor does not work; attempting that gives a link to a page with the name consisting of the name of the ancestor followed by "/".
 
Relative links still work if all pages of a tree are renamed according a name change of the root, including making it a child of a new root.
 
See also [[w:Wikipedia:Subpages]], and the example pages [[m:Link/a/b]] and [[m:Help:Link/a/b]]. The subpage feature works in both namespaces.
 
=== Активация подстраниц ===
Wikipedia has this feature activated in all talk namespaces and the user and project namespace. The Meta-Wiki also has it in the main namespace. The default is set in [[mw:Help:Configuration settings|DefaultSettings.php]][http://cvs.sourceforge.net/viewcvs.py/wikipedia/phpwiki/newcodebase/DefaultSettings.php?rev=1.21&view=markup]. As of revision 1.21, the following namespaces have it activated by default: Special, Main talk, User and User_talk, Meta_talk, and Image_talk. Settings per project are changed in [[LocalSettings.php]][http://cvs.sourceforge.net/viewcvs.py/wikipedia/phpwiki/newcodebase/LocalSettings.php?rev=1.25&view=markup].
 
See also {{mlmw|Manual:$wgNamespacesWithSubpages}}.
 
=== Личное пространство участника ===
Subpages of a user page (<code><nowiki>[[User:Username/Subpage]]</nowiki></code>) are considered to be in that user's "user space".
 
== Преобразование символов ==
In accordance with the rules explained in [[Help:Page name]], conversions are automatically made to [[Help:Special characters|non-literal characters]] in wiki and interwiki links. For example, "<code><nowiki>[[Help:Page%20name]]</nowiki></code>" becomes "[[Help:Page name]]". However, the opposite is true for external links; literal characters are converted into non-literal characters. For example, most browsers will convert ".../wiki/!" to ".../wiki/%21".
 
A code like %70 in a redirect disables it, although the link works from the redirect page. For a redirect that works, the redirect page shows the canonical form of the target, unlike its preview page, which renders the link in the usual way.
 
== Разное ==
=== Дополнительное форматирование ссылок ===
*[[Help:Related changes|Related changes]]
*[[Help:What links here|Backlink]]s, [[Help:Linksearch|Linksearch]]
*[[Help:Date formatting feature|Date formatting]]
* Using a space after the pipe syntax (<nowiki>[[Main page| ]]</nowiki>) produces (perhaps depending on the browser) a space only, not a link ("[[Main page| ]]"), but it is treated as a link for the "what links here" feature.
 
=== Всплывающие подсказки на ссылках ===
On some browsers, holding the cursor over a link will show a hover box ("tooltip") containing the text of the link's HTML title attribute. MediaWiki sets this to the target page name (without the possible section indication) if it's a wikilink (the {{msg|red-link-title}} if the page does not exist), the page name with prefix if it's an interwiki link, and the URL if it's an external link.
 
This can be switched off in the [[Help:Preferences|user preferences]]. The browser may also show similar info, but with the possible section indication, in the status bar.
 
For these effects a piped link is useful even if it not followed to the target; for example, for displaying the meaning of an acronym (e.g. [[neutral point of view|NPOV]]) or any other remark. It is possible to produce a hover box without a link, see {{links-small|template|H:title}}. It is also possible to change the contents of the hover box, using markup similar to <code><nowiki>[[Link title|<span title="hoverbox">Display text</span>]]</nowiki></code>, e.g.
 
{{xpdplain|1=[[w:foot (length){{!}}<span title="30.48 cm">ft</span>]]}}
 
===Ссылки со страницы===
With the [[m:query|Query API]] the links from page ''pagename'', sorted by namespace, and for each namespace alphabetically, are given by <nowiki>{{SERVER}}{{SCRIPTPATH}}</nowiki>/query.php?what=links&titles=''pagename'' , e.g.  {{SERVER}}{{SCRIPTPATH}}/query.php?what=links&titles={{FULLPAGENAME}} .
 
=== Изображение-ссылка на страницу ===
It is possible to use images as links to other pages. For more information, see [[Help:Navigational images|use an image as a link to a page]].
 
==Смотри также ==
*[[Help:Editing#Links, URLs]]
*[[Help:URL]]
*[[Help:Self link]]
*[[Help:Template#Restrictions]] (and the next section)
*[[Help:Guide for system administrators for setting up interwiki linking]]
*[[m:Parser testing/replaceInternalLinks]]
*[[m:Parser testing/replaceExternalLinks]]
*[[mw:Links table]]
*[[m:Brokenlinks table]]
*[[w:Red Link|Red Link]]
*[[w:Wikipedia:Canonicalization|Wikipedia:Canonicalization]]
*[[w:Template:linkless|Linkless]]
*[[Special:Mostlinked]] - shows the number of links
*[[Special:Lonelypages]] - list of pages not linked to, by any other page
 
{{h:f|langs=|enname=Link}}

Версия от 09:53, 18 апреля 2011


Шаблон:H:h

Гиперссылки дают пользователям возможность перемещаться между страницами. Для просмотра базовой информации по wiki-форматированию смотрите Помощь:Редактирование.

В MediaWiki нет возможности создавать гиперссылки при помощи HTML. Вместо этого есть три основных вида гиперссылок, каждый со своим CSS-форматированием: wiki-ссылки (wikilinks), interwiki-ссылки (interwiki links, ссылки между различными wiki) и внешние ссылки. Кроме линковки, каждый из видов ссылок обеспечивает дополнительный функционал, специфичный для wiki-движков, например, определение битых ссылок (ссылок на несуществующие страницы) для wiki-ссылок и автоматическая нумерация внешних ссылок, когда они используются в сносках.

Wiki-ссылки

Wiki-ссылка - это внутренняя ссылка на другую страницу или секцию страницы в пределах одной wiki. MediaWiki автоматически проверяет, существует ли цель wiki-ссылки ("определение существования"). Если страница не существует, то ссылка ведет к секции редактирования, и ей присваивается класс "новая". Такие wiki-ссылки называются "красными ссылками", т.к. они выделяются красным цветом шрифта в таблице стилей по умолчанию. "Красные ссылки" полезны для определения текущего статуса страницы (создана или не создана), создания ссылок на планируемые странцы и для поощрения создания новых страниц другими пользователями. Также, через пункт меню "Ссылки сюда" примененный к несуществующий странице можно обеспечить непрямые ссылки на другие страницы с той же красной ссылкой.

Ссылка на несуществующую страницу в пространстве имен MediaWiki для существующего системного сообщения считается ссылкой на существующую страницу.

Синтаксис

MediaWiki определяет wiki-ссылку как закрывающийся набор пар квадратных скобок '[[ ]]'. Цель ссылки - последовательность символов, расположенная между первой парой скобок и каналом (pipe, '|') или закрывающей парой скобок ']]'. Целью ссылки может быть другая страница wiki , секция той же страницы, на которой расположена ссылка, или секция другой страницы wiki.

  • Межстраничные ссылка: ссылка вида [[имя_страницы]], ведет на страницу с именем "имя_страницы"
  • Внутристраничная ссылка: ссылка вида [[#имя_ссылки]] ведет на первую секцию текущей страницы, которая имеет заголовок (или якорь), с именем "имя_ссылки".
  • Межстраничная "интра" ссылка: ссылка вида [[имя_страницы#имя_ссылки]] ведет на соответствующую секцию страницы с именем "имя_страницы", см. ссылки на секции.

Синтаксис wiki-ссылок также включает в себя различные опции форматирования, определяющие внешний вид ссылок.


Основы синтаксиса wiki-ссылок

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl


Wikilink Tricks & Demos

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

Шаблон:Wikilink syntax tbl

* Англоязычный термин для ссылок, оформленных таким образом, через текст ссылки в качестве параметра — piped links.

** Вне зависимости от вида префикса — ведет он в другую вики (интервики), в другое пространство имен, или просто текст ссылки содержит двоеточие.

*** Не работает с внутристраничными #-викиссылками (intra-page): отображает [[#xxxx|]] как текст.


Note that the image, category, and interlanguage syntax are the same as the wikilink syntax. Attempting to link normally will place the image on the page, add the page to the category and create an interlanguage link at the edge of the page. This can be prevented by prefixing a colon, which escapes the specific syntax. For example, [[:Category:Help]], [[:fr:Help:Link]], and [[:File:Mediawiki.png]].

In the case of a link to a local, non-existing, dynamically generated image description page of an image on Commons, this page is counted as existing for links on pages, e.g. File:Cow-on pole, with horns.jpeg, but not for links in edit summaries and logs.

The existence of an internal link from a page to an existing or non-existing page is recorded in the pagelinks table.

Заготовки статей

A wikilink to an existing page will be in class 'stub' if the page is in the main namespace, it is not a redirect, and the number of bytes of the wikitext is less than the "threshold for stub display" set in the user's preferences.

This allows users to immediately identify links to very short pages that probably need to be expanded, and links to short disambiguation pages. Alternately, a user may set a very high threshold to achieve any of the following:

  • Identify links to very large pages. However, the criterion is the size of the wikitext; possible inclusion of templates and images can make the rendered page large, even if the amount of wikitext is small.
  • Determine at a glance whether a link leads to the main namespace or not. However, this does not take into account redirects to the main namespace (even if the redirect itself is in the main namespace).
  • Identify links to redirects, for clean-up work such as bypassing redirects.

However, section linking to a "stub" does not work. Although this is normally a minor issue, this may cause problems with users who set a very high threshold.

Интервики

Шаблон:Main An interwiki link links to a page on another website. Unlike the name suggests, the target site need not be a wiki, but it has to be on the interwiki map specified for the source wiki. These links have the associated CSS class "extiw". These are in the same form as wikilinks above but take a prefix which specifies the target site. For example, on Wikimedia projects (except Wikipedias) and many other wikis [[wikipedia:Main Page]] links to the main page of the English Wikipedia. The prefix can be hidden using the same piped syntax as wikilinks.

An interwiki can also link to a section or other anchor, see section linking.

Интервики в тот же проект

Although interwiki links can be used to point to a wiki from itself, this is not generally recommended. MediaWiki does not detect whether or not the target page of an interwiki list exists, so there is no special formatting and the link is always to the view page. Further, MediaWiki does not check if the page is linking to itself. A self wikilink is bolded (like M:Помощь:Ссылки), whereas a self interwiki link is normal (m::M:Помощь:Ссылки).

Pros:

  • A copy of the wikitext on a sister project may still point to the same page. Sometimes two prefixes are needed for that purpose, e.g. w:de:a.

Cons:

  • Link has non-standard appearance
  • No existence-detection for target page

Внешние ссылки

External links use absolute URLs to link directly to any webpage. These links have the associated CSS class "external". External links are in the form [http://www.example.org link name] (resulting in link name), with the link name separated from the URL by a space. Links without link names will be automatically numbered: [http://www.example.org] becomes [1]. Links with no square brackets will be displayed in their entirety: http://www.example.org.

To show a URL without link use e.g. <nowiki>http://www.example.org</nowiki> giving http://www.example.org.

Unlike in the case of internal links, characters immediately after the closing bracket are not added to the link label: [http://www.example.org a]s gives as.

See URLs in external links for more detailed information.

Ссылки на e-mail

Links to an E-mail address work the same way that external links do, except they require the prefix mailto:. E-mail links are in the form of [mailto:anyone@example.org address name] (resulting in address name), with the link name separated from the address by a space. Addresses without names will automatically be numbered: [mailto:anyone@example.org] becomes [2]. Addresses without square brackets will not be rendered as link, e.g. anyone@example.com. It's possible to make CC with [mailto:anyone@example.org?cc=anyone2@example.org address name] (resulting in address name).

Ссылки на специальные страницы того же проекта

External links support various special optional URL parameters in their linking-code. These allow links directly to the edit history of a page, to a page in edit view, a diff of two versions, et cetera. They can also be used to create a navigational image.

For portability, use "fullurl" where the URL should depend on the project.

Иконки после ссылки

MonoBook skin produces an arrow icon after every external link. This can be suppressed with class="plainlinks":

  • [http://a a] gives a
  • <span class="plainlinks">[http://a a]</span> gives a

With some special code on MediaWiki:Common.css such as on m:MediaWiki:Common.css, external links to PDF files have their own icon Файл:Icons-mini-file acrobat.gif. On this site with your current settings http://a.pdf gives http://a.pdf .

Пропуск номера ссылки

To skip a number in the automatically numbered external links (for whatever reason), use e.g. <span style="display:none">[http://a]</span>: [3][4][5].

Note that a false condition of a ParserFunction, or a template like Шаблон:Links-small does not work, because counting the links is done after expansion of templates and parser functions.

Поиск по внешним ссылкам

Special:Linksearch (an extension installed on Wikimedia wikis, [6]) finds all pages linking to a given URL. Using the externallinks table it provides for a given external link pattern a list of source page names on the wiki concerned (linked) with for each the full link target (also as a link). One can either search all namespaces or a selected one. A leading wildcard * can be used to search links to a whole top-level domain (e.g. [7]), or a second-level domain (e.g. [8]), etc. In the case that a full domain name is specified, one can additionally specify the rest of the URL, or the first part of that (a wildcard at the end is implied), e.g. [9].

Remarks:

  • Do not put "http://".
  • The colon in the URL may cause the program return no results.
  • A MediaWiki page name in a URL has underscores instead of spaces. Also the URL specified in Linksearch requires writing underscores.
  • Even if multiple URLs lead to the same target, with regard to capitalisation, multiple underscores, and using "index.php" or not, Linksearch is case-sensitive and also does not find alternatively written URLs. Therefore, when creating an external link, for optimal use of Linksearch, use a canonical form for the URL. In particular, if after following a link the address bar shows a modified URL, change the URL in the link to that.
  • The list is Шаблон:Ml in the URL. Note that an underscore, unlike a blank space, is alphabetically positioned between "Z" and "a".

Обратные ссылки

Commonly, a link to a normal page on the same project is in internal link style. An advantage is the existence detection. Also, if some links are in internal and some in external link style, we need both "What links here" and Linksearch for finding all backlinks. However, especially for a link to a section or explicitly-set anchor, one could put an internal link and also, with CSS style "display=none", an external link, to provide backlinks.

External link style is also superior to interwiki link style. The URL specified for Linksearch can even contain an anchor (see below), or the first part of an anchor. Therefore Linksearch can find backlinks of sections and explicit anchors. In this regard external links are even superior to internal links. We can combine the advantages of internal and external link style by putting both, but hiding the external links: <span style="display:none">http://...</span>


Якоря

Шаблон:Seealso

Ссылки на якоря

Links of the form [[#anchor_name]] will link to the first anchor on the page matching that "anchor_name", usually the first identical section heading.

An #anchor_name can also be appended to the page name in any type of link, thus linking to the first identical section heading (or anchor) of the named page:

[[Help:Editing#Links]], [[m:Help:Editing#Links]],

http://meta.wikimedia.org/wiki/Help:Editing#Links

Якоря, расставляемые автоматически

Section headings automatically act as anchors, with the heading text as the "anchor_name". In the case of multiple sections with identical headings, the anchor name of each has "_2", "_3", etc. appended, starting from the second occurrence.

The anchor #toc links to the table of content of the page, unless there is a section titled "toc".

Якоря, расставляемые вручную

Manually-set anchors are useful for linking to "unlinkable" things like a table (title or cell), a section of plain text, etc. For example, in the Wikilink Tricks & Demos table above, though the "Wikilink Tricks & Demos" title-text appears like a (minor) heading, it is not, and the otherwise perfectly normal wikilink [[#Wikilink Tricks & Demos]] will not work.

There are a number of ways to set an anchor at an arbitrary position:

  • Generic anchor: <span id="anchor_name">some text</span>. For a hidden anchor, omit the text.
  • Manual HTML headings (discouraged): <h2>How to Edit</h2>. Text is anchor_name.
  • In some cases, inserting an HTML-like ID attribute into an (existing) Wiki-element. For example, from the Wikilink Tricks & Demos

table above:
!colspan="5" align="left" id="Wiki-link Tricks"|Wikilink Tricks & Demos


See also Help:Section#Section_linking.

Якоря для поиска по внешним ссылкам

As mentioned above, if external link style is used, e.g. [10], we can use Special:Linksearch: [11].

Since Linksearch allows specifying the first part of an anchor, it is useful, if anchor names are numerical or have a numerical end, to use leading zeros. Otherwise, when searching for links to e.g. "1", we also get links to "10", etc. This is e.g. applied in w:Portal:Current events/DateHeader2. More generally, if there are anchors "a" and "ab", it may or may not be desired that a search for links to "a" also gives links to "ab"; if not, use an anchor "_a".

«Каталожные» якоря

If anchor names have multiple components, it is useful to put the most significant component first, e.g. if anchors indicate months or dates, we could have the format YYYY-MM, or YYYY-MM-DD, or in a year page MM-DD (see also [12]), with leading zeros (see also [13]). This applies also for page names, but since these are highly visible, as opposed to anchors, other considerations play a role too. In the case of sections, if for link targets another naming scheme is desired than for display of section headings, explicitly put anchors instead of using section names. This is applied in w:Portal:Current events/DateHeader2, where the use in links of the names of explicitly put anchors is enforced by using pseudo sections, with displayed headings that cannot be used as anchors.

Якоря во внешних ссылках (anchorencode)

In an external link, an anchor can be created conveniently with the parser function anchorencode, for example, Шаблон:Xpdoc, which can be used to form the link https://wiki.tpu.ru/wiki/M:%D0%9F%D0%BE%D0%BC%D0%BE%D1%89%D1%8C:%D0%A1%D1%81%D1%8B%D0%BB%D0%BA%D0%B8#Anchors_in_external_links_(anchorencode)

Подстраницы

MediaWiki has a subpage feature, although activation depends on project and namespace. If activated, the following applies (if not, "A/b" is just a page with that name).

A tree structure of pages is established by using forward slashes in pagenames: A/b is a child of A, hence A is a parent of A/b; also A/b/c is a child of A/b; while A/a, A/b, and A/c are siblings.

At the top of the subpage body links to all ancestor pages are shown automatically, without any corresponding wikitext. The links show up even if the parent page does not exist, but the sequence of ancestors stops before any non-existing ancestor page (e.g., if the grandparent page does not exist, the parent page is not shown either). Like most letters of a page name, the first letter after the slash is case-sensitive; "/subpage" and "/Subpage" are different pages.

What links here and Related changes ignore these automatic links.

In the namespace where the subpage feature is activated, any slash in a page name causes a subpage structure, even if unintended.

A list of subpages can be obtained using Special:PrefixIndex.

Переменные

On page A:B/c/d, where A is a namespace with the subpage feature enabled, {{BASEPAGENAME}} gives B/c and {{SUBPAGENAME}} gives d

Относительные ссылки

Inside a subpage hierarchy the following relative links can be used:

  • [[../]] links to the parent of the current subpage, e.g., on A/b it links to A, on A/b/c it links to A/b.
  • [[../../]] links to the grandparent of the current subpage, e.g., on A/b/c it links to A.
  • [[../s]] links to a sibling of the current subpage, e.g., on A/b, it links to A/s.
  • [[../../s]] links to an "uncle" of the current subpage, e.g., on A/b/c, it links to A/s.
  • [[/s]] links to a subpage, e.g. on A it is the same as [[A/s]]. Because of this, linking from a namespace where the subpage feature is enabled to a page in the main namespace with a name starting with "/", requires a workaround: put a colon before the pagename.

Linking to an anchor of an ancestor does not work; attempting that gives a link to a page with the name consisting of the name of the ancestor followed by "/".

Relative links still work if all pages of a tree are renamed according a name change of the root, including making it a child of a new root.

See also w:Wikipedia:Subpages, and the example pages m:Link/a/b and m:Help:Link/a/b. The subpage feature works in both namespaces.

Активация подстраниц

Wikipedia has this feature activated in all talk namespaces and the user and project namespace. The Meta-Wiki also has it in the main namespace. The default is set in DefaultSettings.php[14]. As of revision 1.21, the following namespaces have it activated by default: Special, Main talk, User and User_talk, Meta_talk, and Image_talk. Settings per project are changed in LocalSettings.php[15].

See also Шаблон:Mlmw.

Личное пространство участника

Subpages of a user page ([[User:Username/Subpage]]) are considered to be in that user's "user space".

Преобразование символов

In accordance with the rules explained in Help:Page name, conversions are automatically made to non-literal characters in wiki and interwiki links. For example, "[[Help:Page%20name]]" becomes "Help:Page name". However, the opposite is true for external links; literal characters are converted into non-literal characters. For example, most browsers will convert ".../wiki/!" to ".../wiki/%21".

A code like %70 in a redirect disables it, although the link works from the redirect page. For a redirect that works, the redirect page shows the canonical form of the target, unlike its preview page, which renders the link in the usual way.

Разное

Дополнительное форматирование ссылок

Всплывающие подсказки на ссылках

On some browsers, holding the cursor over a link will show a hover box ("tooltip") containing the text of the link's HTML title attribute. MediaWiki sets this to the target page name (without the possible section indication) if it's a wikilink (the Шаблон:Msg if the page does not exist), the page name with prefix if it's an interwiki link, and the URL if it's an external link.

This can be switched off in the user preferences. The browser may also show similar info, but with the possible section indication, in the status bar.

For these effects a piped link is useful even if it not followed to the target; for example, for displaying the meaning of an acronym (e.g. NPOV) or any other remark. It is possible to produce a hover box without a link, see Шаблон:Links-small. It is also possible to change the contents of the hover box, using markup similar to [[Link title|<span title="hoverbox">Display text</span>]], e.g.

Шаблон:Xpdplain

Ссылки со страницы

With the Query API the links from page pagename, sorted by namespace, and for each namespace alphabetically, are given by {{SERVER}}{{SCRIPTPATH}}/query.php?what=links&titles=pagename , e.g. https://wiki.tpu.ru/query.php?what=links&titles=M:Помощь:Ссылки .

Изображение-ссылка на страницу

It is possible to use images as links to other pages. For more information, see use an image as a link to a page.

Смотри также

Шаблон:H:f