> For the complete documentation index, see [llms.txt](https://wwydev.gitbook.io/mkdc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wwydev.gitbook.io/mkdc/zhi-nan/bian-liang.md).

# Variable

You can use the "v" command to use variables.

### define variables

Define variables in the JSON file

{% code title="main.json" %}

```json
{
    "variable1": "hello",
    "variable2": "world"
}
```

{% endcode %}

### use variables

To use variables in a markdown file, it is necessary to start with the "v -" directive

{% code title="main.md" %}

```markdown
# variable
<!--{v-variable1}--> : <!--{v-variable2}-->
```

{% endcode %}

### compiler results

{% code title="dist/build.md" %}

```markdown
# variable
hello : world
```

{% endcode %}
