Params

Describe the parameter definitions of functions and API, which is useful for writing documentation.

Syntax

1{{% params [data] %}}

Parameters

data

NameContextTypeRequiredDefaultSinceExample
data-string---

The data filename.

heading

NameContextTypeRequiredDefaultSinceExample
heading-string-Parameters--

The heading.

headingStartLevel

NameContextTypeRequiredDefaultSinceExample
headingStartLevel-number-2--

The heading start level.

context

NameContextTypeRequiredDefaultSinceExample
context-string--0.20.0-

The default context for all parameters.

Data Item Properties

name

NameContextTypeRequiredDefaultSinceExample
name-string---

The parameter name.

type

NameContextTypeRequiredDefaultSinceExample
type-string/array-string--

The type of parameter.

required

NameContextTypeRequiredDefaultSinceExample
required-boolean-false--

Indicates whether if the parameter is required.

default

NameContextTypeRequiredDefaultSinceExample
default-string----

The default value of parameter.

since

NameContextTypeRequiredDefaultSinceExample
since-string----

Indicates the version in which the parameter is added.

description

NameContextTypeRequiredDefaultSinceExample
description-string/object---

The description, support Markdown.

description.default

NameContextTypeRequiredDefaultSinceExample
description.default-string----

The default description.

description.[lang]

NameContextTypeRequiredDefaultSinceExample
description.[lang]-string----

Language-specific description.

options

NameContextTypeRequiredDefaultSinceExample
options-array----

Available options.

deprecated

NameContextTypeRequiredDefaultSinceExample
deprecated-string-false--

Indicates whether if the parameter is deprecated.

Example

data/example-params.yaml
  <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="ln"> 1</span><span class="cl">- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">foo</span><span class="w">

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.

Source
1{{% params data="data/example-params.yaml" heading="Example Parameters" headingStartLevel=3 %}}
Result

Example Parameters

foo

NameContextTypeRequiredDefaultSinceExample
foo-string---

Foo description.

bar

NameContextTypeRequiredDefaultSinceExample
bar-number--v0.2.0-

Bar description.

fizz

NameContextTypeRequiredDefaultSinceExample
fizz-string----

Single description without translations.

Available options: one, two.