Extension:External Data/Inline
Appearance
From mediawiki.org
You can use External Data to get data from a structured piece of text (in a format like CSV, JSON, XML, etc.) contained directly within the relevant parser function or Lua function.
The recommended way to do this is to use one of the display functions (#external_value, #for_external_table, etc.), passing in the necessary parameters for the data retrieval. You can also retrieve inline data by calling either #get_inline_data or #get_external_data, though this approach is deprecated.
For any of these parser functions, you can also call its corresponding Lua function.
Usage
[edit ]| Wikitext | Result |
|---|---|
{{#for_external_table:
* Title: {{{title}}}.
* Description: {{description}}}.
| text = {
"title": "JSON",
"description": "An example of JSON"
}
| format = json with jsonpath
| data = title = $.title, description = $.description
}}
|
|
{{#for_external_table:
* Format: {{{__format}}}
* Title: {{{title}}}.
* Description: {{{description}}}.
| text =
title,description
CSV,An example of comma-separated values
}}
|
|
{{#for_external_table:
* Title: {{{title}}}.
* Description: {{{description}}}.
| text =
title: YAML
description: An example of YAML
}}
|
|