Extension:Disambiguator/sk

From Linux Web Expert

MediaWiki extensions manual
Disambiguator
Release status: stable
Implementation Special page
Description Umožní označiť špeciálným slovom rozlišovacie stránky
Author(s) Ryan Kaldari (Kaldaritalk)
Latest version Neverziované aktualizácie
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.28+
PHP 5.4+
License No license specified
Download

  • $wgDisambiguatorIndicateLinks
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the Disambiguator extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

Rozšírenie 'Disambiguator' je navrhnuté tak, aby uľahčilo programovú prácu s rozlišovacími stránkami. Umožňuje vám označiť všetky rozlišovacie stránky pomocou špecialného slova __DISAMBIG__ (alebo ekvivalentného aliasu), ktoré sa takto označené môžu potom nájsť v databáze. Prípadne to umožnuje iným rozšíreniam pristupovať ku rozlišovacím stránkam ako so zvlášť samostatnou kategóriou stránok, aj keď sú ináč stále považované za „normálne“ stránky.

Inštalácia

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/Disambiguator/sk</tvar>|Download]] and move the extracted <tvar name=name>Disambiguator/sk</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Disambiguator%2Fsk
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'Disambiguator/sk' );
    
  • Je potrebné nakonfigurovať.
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Konfigurácia

Nasledujúce konfiguračné premenné sa môžu nastaviť zo súboru LocalSettings.php.

  • $wgDisambiguatorIndicateLinks - či sa má pridať trieda CSS „mw-disambig“ do odkazov na rozlišovacích stránkach (predvolená hodnota je true)
  • $wgDisambiguatorNotifications - whether to warn the user when they type a link to a disambiguation page in wikitext editors (default is false)

Rozšírenia

Disambiguator poskytuje nasledujúce funkcie:

  • Programátorská identifikácia rozlišovacích stránok prostredníctvom __DISAMBIG__ špeciálneho slova
  • Nová špeciálna stránka so zoznamov všetkých rozlišovacích stránok a s odkazmi na ne
  • Nové funkcie API, ktoré sú ekvivalentné ku vyššie spomenutím špeciálnim stránka, ako aj funkcia API na zistenie, či stránka je alebo nie je rozlišovacou stránkou
  • Upráva Special:LonelyPages na ignorovanie rozlišovacích stránok
  • Upráva Special:Random na ignorovanie rozlišovacích stránok (vyžaduje MediaWiki 1.26.0)
  • Ak je povolené VisualEditor , dovoľuje v nastaveniach rozhrania stránky označiť stránku ako rozlišovaciu stránku
  • Ak je povolené VisualEditor , tak zobrazí v inšpektorovi odkazov, či je stránka rozlišovacou stránkou
  • Ak je povolené VisualEditor , tak zobrazí v dialógovom okne, či je stránka rozlišovacou stránkou
  • Ak je nakonfigurované, pridá CSS triedu 'mw-disambig' do odkazov pre rozlišovacie stránky (Viď #Configuration vyššie)
  • Warns a WikiEditor user when linking to a disambiguation page, and allows them to fix the link.

Usage

<translate> For {{<tvar name=1>#if:end-user help|end-user help</tvar>|other uses}}, see: <tvar name=2>Help:Extension:Disambiguator</tvar>.</translate>

On wiki

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 pages :

  • 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

Possible future plans

  • 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