Расширение:Semantic Glossary

This page is a translated version of the page Extension:Semantic Glossary and the translation is 80% complete.
Other languages:
Справка по расширениям MediaWiki
OOjs UI icon advanced-invert.svg
Semantic Glossary
Статус релиза: стабильный
px
Реализация Пользовательский интерфейс
Описание A terminology markup extension with a Semantic MediaWiki back-end
Автор(ы)
Последняя версия 4.0.0 (2021-07-09)
Политика совместимости Master maintains backward compatibility.
MediaWiki 1.31+
PHP 7.1+
Изменения БД Нет
Composer mediawiki/semantic-glossary
Лицензия GNU General Public License 2.0 or later
Загрузка
README
RELEASE NOTES

Compatibility

  • Semantic MediaWiki 3.1+
  • Lingo 3.1+

Проверьте использование и версию.

Расширение Semantic Glossary позволяет определять термины и сокращения вместе с определением. Всякий раз, когда в статье появляется термин или аббревиатура, на странице будет отображается ее определение. The extension is an alternative back-end for the Lingo extension: Where the Lingo extension uses a dedicated page to store the glossary. Semantic Glossary retrieves the data from a Semantic MediaWiki store. The advantages of this approach are: the glossary can be queried like any other semantic data, storing of the data is not limited to one pre-defined page and editing the data can be made more user-friendly using Page Forms.

Свойства

The following properties are used to hold the data of the glossary entries:

  • Glossary-Term: The term or abbreviation that is to be annotated on pages
  • Glossary-Definition: Its definition
  • Glossary-Link: The name of a page to which a link will be displayed alongside the definition (e.g. to link to a longer explanation of the term)
  • Glossary-Style: The name of a CSS class (or multiple classes, separated by spaces) that will be used to style the tooltip.

There must only ever be one definition per wiki page. The easiest way to ensure this and to keep the definition in one place is probably to use Semantic Internal Objects or SMW's subobjects.

The link may be any internal or interwiki link.

You can easily build a user interface to edit the glossary, e.g. using Page Forms. See this discussion entry for an example.

Интернационализация

The extension is pretty well internationalized by now, thanks to the efforts of the volunteers on translatewiki.net. (If your language is not supported yet, get an account there and help yourself. It's easy!) To find out the names of the properties for your language, look at the "langcode".json file of the respective language and find the messages semanticglossary-prop-glt (Glossary-Term), semanticglossary-prop-gld (Glossary-Definition), semanticglossary-prop-gll (Glossary-Link), and semanticglossary-prop-gls (Glossary-Style). Or just use the default English property names, they should always work.

Функции, унаследованные от расширения Lingo

You can exclude an article from markup by including the magic word __NOGLOSSARY__ anywhere in that article's text.

In some cases it may be necessary to exclude only portions of a page, e.g. because Lingo interferes with some JavaScript. This can be achieved by wrapping that part in an HTML element (e.g. a span or a div) and specifying class="noglossary". As a shorthand for <span class="noglossary"> you can just use the ‎<noglossary> tag.

For inherited configuration parameters see Customization below.

Установка

The way to install this extension is by using Composer.

  1. Add the following to the MediaWiki composer.local.json file and run the php composer.phar update mediawiki/semantic-glossary command:
    {
    	"require": {
    		"mediawiki/semantic-glossary": "~4.0"
    	}
    }
    

    (Alternatively, if using Composer is not an option for you, you can download a tar ball or zip file from GitHub and extract it into the extensions directory of your MediaWiki installation.)

  2. Add the following line to your "LocalSettings.php" file:
    wfLoadExtension( 'SemanticGlossary' );
    
    Starting with version 4.0.0 you have to invoke the required Lingo extension with the following call:
    wfLoadExtension( 'Lingo' );
    
  3. Do some customization if necessary (see below)
  4. Go to the Special:Version page of your wiki and verify that an entry for Semantic Glossary exists

Any future update is then just a call to php composer.phar update mediawiki/semantic-glossary.

You do not have to take care of any dependencies, those are solved by Composer. It is in particular NOT necessary to install the Lingo extension separately. Doing so will result in errors.

Настройка

Semantic Glossary has inherited most of the settings available for the Lingo extension:

  • $wgexLingoPage - specify a different name for the terminology page; Example: $wgexLingoPage = 'Glossary';
  • $wgexLingoDisplayOnce - specify that each term should be annotated only once per page; Example: $wgexLingoDisplayOnce = true;
  • $wgexLingoUseNamespaces - specify what namespaces should or should not be used; Example: $wgexLingoUseNamespaces[NS_TALK] = false;
  • $wgexLingoCacheType - set default cache type (null = use main cache); Example: $wgexLingoCacheType = CACHE_NONE;

If you want to use these settings, just include them in LocalSettings.php.

If you did not use Composer for the installation, they must come after the

wfLoadExtension( 'SemanticGlossary' );

Finally you can provide your own styling. For the classes used by Lingo for the various HTML elements, please have a look at the style file.

Еще не реализовано

The extension should be able to

  • store a context (page, category, namespace, concept) for every term and only markup the term on wiki pages belonging to the context;
  • invalidate affected pages when a term is changed;

Снимки экрана и примеры настройки

Please find information for a detailed example here.

Контакты

Comments, questions and suggestions should be sent or posted to:

См. также