简介

该微件用于使用特定格式转储式输出数据

短代码

参数

名称必要描述
(位置参数 1)数据的标识符使用 / 分割层级
(位置参数 2)输出格式json(默认)、tomlxmlyaml

示例

原始数据

{
  "name": "John Doe",
  "age": 30,
  "isStudent": false,
  "hobbies": ["reading", "cycling"],
  "address": {
    "city": "New York",
    "zipcode": "10001"
  }
}

输出示例

Markdown
{{< dumpdata "docs/example" >}}
渲染效果
{
   "address": {
      "city": "New York",
      "zipcode": "10001"
   },
   "age": 30,
   "hobbies": [
      "reading",
      "cycling"
   ],
   "isStudent": false,
   "name": "John Doe"
}
Markdown
{{< dumpdata "docs/example" "yaml" >}}
渲染效果
address:
  city: New York
  zipcode: '10001'
age: 30
hobbies:
- reading
- cycling
isStudent: false
name: John Doe
Markdown
{{< dumpdata "docs/example" "toml" >}}
渲染效果
age = 30
hobbies = ['reading', 'cycling']
isStudent = false
name = 'John Doe'

[address]
  city = 'New York'
  zipcode = '10001'
Markdown
{{< dumpdata "docs/example" "xml" >}}
渲染效果
<root>
	<address>
		<city>New York</city>
		<zipcode>10001</zipcode>
	</address>
	<age>30</age>
	<hobbies>reading</hobbies>
	<hobbies>cycling</hobbies>
	<isStudent>false</isStudent>
	<name>John Doe</name>
</root>