Skip to content

Variables

Giorgio Garofalo edited this page Jan 18, 2025 · 7 revisions

.var {name} {value} defines a variable. value is a dynamic value, meaning it may be of any type.

.var {name} {Quarkdown}

The variable can be accessed as a parameter-less function:

Hello, **.name**!

Hello, Quarkdown!

 

A variable can be reassigned, either via .myvar {newvalue} or .var {myvar} {newvalue}:

.var {num} {5}

.num

.num {.sum {.num} {1}}
<!-- Or, equivalently -->
.var {num} {.sum {.num} {1}}

.num

5

6

 

As mentioned in Syntax of a function call:

A body argument always refers to the last parameter of the signature [...]

This allows the variable's value to be either inline or block:

.var {myrow}
  .row gap:{2cm}
    A

    B

    C

.container background:{yellow} padding:{1cm}
  .myrow
Result
Clone this wiki locally