Describe the parameter definitions of functions and API, which is useful for writing documentation.
1{{% params [data] %}}
data
Name | Type | Required | Default | Since |
---|---|---|---|---|
data | string | ✓ | - | - |
The data filename.
heading
Name | Type | Required | Default | Since |
---|---|---|---|---|
heading | string | - | Parameters | - |
The heading.
headingStartLevel
Name | Type | Required | Default | Since |
---|---|---|---|---|
headingStartLevel | number | - | 2 | - |
The heading start level.
name
Name | Type | Required | Default | Since |
---|---|---|---|---|
name | string | ✓ | - | - |
The parameter name.
type
Name | Type | Required | Default | Since |
---|---|---|---|---|
type | string | - | string | - |
The type of parameter.
required
Name | Type | Required | Default | Since |
---|---|---|---|---|
required | boolean | - | false | - |
Indicates whether if the parameter is required.
default
Name | Type | Required | Default | Since |
---|---|---|---|---|
default | string | - | - | - |
The default value of parameter.
since
Name | Type | Required | Default | Since |
---|---|---|---|---|
since | string | - | - | - |
Indicates the version in which the parameter is added.
description
Name | Type | Required | Default | Since |
---|---|---|---|---|
description | string/object | ✓ | - | - |
The description, support Markdown.
description.default
Name | Type | Required | Default | Since |
---|---|---|---|---|
description.default | string | - | - | - |
The default description.
description.[lang]
Name | Type | Required | Default | Since |
---|---|---|---|---|
description.[lang] | string | - | - | - |
Language-specific description.
options
Name | Type | Required | Default | Since |
---|---|---|---|---|
options | array | - | - | - |
Available options.
deprecated
Name | Type | Required | Default | Since |
---|---|---|---|---|
deprecated | string | - | false | - |
Indicates whether if the parameter is deprecated.
1- name: foo
2 required: true
3 description:
4 default: Foo description.
5 zh-hans: Foo 描述。
6 zh-hant: Foo 描述。
7
8- name: bar
9 type: number
10 since: v0.2.0
11 deprecated: true
12 description:
13 default: Bar description.
14 zh-hans: Bar 描述。
15 zh-hant: Bar 描述。
16
17- name: fizz
18 description: Single description without translations.
19 options:
20 - one
21 - two
Result as follows.
1{{% params data="data/example-params.yaml" heading="Example Parameters" headingStartLevel=3 %}}
foo
Name | Type | Required | Default | Since |
---|---|---|---|---|
foo | string | ✓ | - | - |
Foo description.
bar
Name | Type | Required | Default | Since |
---|---|---|---|---|
bar | number | - | - | v0.2.0 |
Bar description.
fizz
Name | Type | Required | Default | Since |
---|---|---|---|---|
fizz | string | - | - | - |
Single description without translations.
Available options: one
, two
.