Extension:Disambiguator/ru
![]() Статус релиза: стабильно |
|
---|---|
Реализация | Служебная страница |
Описание | Enables the designation of disambiguation pages with a magic word |
Автор(ы) | Ryan Kaldari (Kaldariобсуждение) |
Последняя версия | Постоянные обновления |
Политика совместимости | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.28+ |
PHP | 5.4+ |
Лицензия | MIT License |
Скачать | |
|
|
Quarterly downloads | 1,481 (Ranked 6th) |
Public wikis using | 6,730 (Ranked 31st) |
Переведите расширение Disambiguator, если оно доступно на translatewiki.net | |
Проблемы | Открытые задачи · Сообщить об ошибке |
The Disambiguator extension is designed to make disambiguation pages easier to work with programmatically.
It allows you to designate all disambiguation pages with the __DISAMBIG__
magic word (or an equivalent alias), which then marks them as such in the database.
This allows other extensions to optionally handle disambiguation pages as a separate class of page, although they are still considered "normal" pages.
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
Disambiguator
в вашей папкеextensions/
. - Добавьте следующий код внизу вашего
LocalSettings.php
:wfLoadExtension( 'Disambiguator' );
- Configure as required.
Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
Настройка
The following configuration variables can be set from your LocalSettings.php file.
- $wgDisambiguatorIndicateLinks - добавлять ли CSS-класс 'mw-disambig' к ссылкам на страницы неоднозначности (по умолчанию верно)
- $wgDisambiguatorNotifications - whether to warn the user when they type a link to a disambiguation page in wikitext editors (default is false)
Features
Disambiguator provides the following features:
- Programmatic identification of disambiguation pages via the __DISAMBIG__ magic word
- Новые служебные страницы для перечисления всех страниц неоднозначности и страниц, ссылающихся на страницы неоднозначности
- New API functions equivalent to the above special pages as well as an API function for querying whether or not a page is a disambiguation page
- Modifies Special:LonelyPages to ignore disambiguation pages
- Modifies Special:Random to ignore disambiguation pages (requires MediaWiki 1.26.0)
- If VisualEditor is enabled, allows marking a page as a disambiguation page via the page properties interface
- If VisualEditor is enabled, shows whether a page is a disambiguation page or not in the link inspector
- If VisualEditor is enabled, shows whether a page is a disambiguation page or not in the link dialog
- If configured, adds a 'mw-disambig' CSS class to links to disambiguation pages (See #Configuration above)
- Warns a Расширение:WikiEditor user when linking to a disambiguation page, and allows them to fix the link.
Использование
На вики
Once Disambiguator is installed, the best way to use it is to add the __DISAMBIG__
magic word to a template that is then included in all of your disambiguation pages.
Once the magic word is in place, your disambiguation pages will all have the 'disambiguation' page property assigned to them in the database. This property resides in the page_props table.
You will also have two new Служебные страницы :
- Special:DisambiguationPages - which lists all the disambiguation pages on your wiki.
- Special:DisambiguationPageLinks - which lists all of the pages on your wiki that link to disambiguation pages. (This is a replacement for the old Special:Disambiguations page which is deprecated.)
With API
To list all the disambiguation pages:
api.php?action=query&list=querypage&qppage=DisambiguationPages
To list all the disambiguation page links:
api.php?action=query&list=querypage&qppage=DisambiguationPageLinks
Note that on wikis running in MiserMode (all WMF wikis), both the special page and API interface for DisambiguationPageLinks are limited to a certain number of results (typically 1000–5000).
To see if an individual page is a disambiguation page:
api.php?action=query&titles=Bug&prop=pageprops&ppprop=disambiguation
If it is a disambiguation page it will include 'disambiguation' in its pageprops. Note that the disambiguation pageprop, if present, will have its value set to an empty string, so be careful about testing it as a boolean.
SQL
To see if an individual page is a disambiguation page, check the page_props
table for the presence of a pp_propname = 'disambiguation'
. Pages that are not disambiguation pages will not have this pp_propname
. The pp_value
isn't important.
SELECT page_title, pp_propname
FROM page
LEFT JOIN page_props ON pp_page = page_id AND pp_propname = 'disambiguation'
WHERE page_namespace = 0
AND page_title IN ('John', 'COVID-19') -- John is a disambiguation page on enwiki, COVID-19 is not
Возможные планы на будущее
- Add an option to hide disambiguation pages from:
Special:AllPages (task #9936), Special:PrefixIndex (task #11319), Special:WhatLinksHere (task #9935), Special:AncientPages (task #76287)
- Consider extending link dialog in wikitext editor with ability to detect disambigs in search results and pull a list of links
![]() | Это расширение используется в одном или нескольких проектах Викимедиа. Вероятно, это означает, что расширение стабильно и работает достаточно хорошо, чтобы использоваться такими сайтами с высоким трафиком. Найдите название этого расширения в файлах конфигурации Викимедиа CommonSettings.php и InitialiseSettings.php, чтобы узнать, где оно установлено. Полный список расширений, установленных на конкретной вики, можно увидеть на странице Special:Version wiki. |
![]() | Это расширение включено в следующие пакеты и/или вики-фермы: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
- Stable extensions/ru
- Special page extensions/ru
- MIT licensed extensions/ru
- Extensions in Wikimedia version control/ru
- AncientPagesQuery extensions/ru
- ChangeTagsListActive extensions/ru
- EditPage::showEditForm:initial extensions/ru
- GetDoubleUnderscoreIDs extensions/ru
- GetLinkColours extensions/ru
- LinksUpdateComplete extensions/ru
- ListDefinedTags extensions/ru
- LonelyPagesQuery extensions/ru
- RandomPageQuery extensions/ru
- RecentChange save extensions/ru
- ShortPagesQuery extensions/ru
- WgQueryPages extensions/ru
- All extensions/ru
- Extensions used on Wikimedia/ru
- Extensions included in Canasta/ru
- Extensions included in Fandom/ru
- Extensions included in Miraheze/ru
- Extensions included in MyWikis/ru
- Disambiguation extensions/ru