Справка MediaWiki API
This is an auto-generated MediaWiki API documentation page.
Documentation and examples: https://www.mediawiki.org/wiki/API
action=wbformatvalue
(main | wbformatvalue)
- Этот модуль требует прав на чтение.
- Источник: Wikibase Repository
- Лицензия: GPL-2.0+
Форматирует DataValues.
Параметры:
- generate
The desired output format to generate.
- Одно из следующих значений: text/plain, text/x-wiki, text/html, text/html; disposition=widget
- По умолчанию: text/x-wiki
- datavalue
The data to format. This has to be the JSON serialization of a DataValue object.
- Это обязательный параметр.
- datatype
The value's data type. This is distinct from the value's type
- Одно из следующих значений: commonsMedia, geo-shape, globe-coordinate, monolingualtext, quantity, string, tabular-data, time, url, external-id, wikibase-item, wikibase-property
- property
Property ID the data value belongs to, should be used instead of the datatype parameter.
- options
The options the formatter should use. Provided as a JSON object.
Примеры:
- Format a simple string value.
- api.php?action=wbformatvalue&datavalue=%7B%22value%22%3A%22hello%22%2C%22type%22%3A%22string%22%7D [open in sandbox]
- Format a string value as a URL in HTML.
- api.php?action=wbformatvalue&datavalue=%7B%22value%22%3A%22http%3A%5C%2F%5C%2Facme.org%22%2C%22type%22%3A%22string%22%7D&datatype=url&generate=text%2Fhtml [open in sandbox]