Skip to content

Commit

Permalink
Update pre-processor.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
nermalcat69 committed Dec 3, 2024
1 parent 79e1ff5 commit b788c7f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions apps/docs/content/references/importyml/pre-processor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ Functions generally support 2 types of parameters.
- Spaces between `<` and `>` are NOT trimmed.
- When the value is passed as a function parameter, it's always a string.

**Simple examples:**
```yaml
SECRET_KEY: <@generateRandomString(<16>)> # String expression: <16>
RANDOM_RANGE: <@generateRandomInt(<1>, <100>)> # String expressions: <1> and <100>
PICK_VALUE: <@pickRandom(<red>, <green>, <blue>)> # String expressions: <red>, <green>, <blue>
# String expression: <16>
SECRET_KEY: <@generateRandomString(<16>)>
# String expressions: <1> and <100>
RANDOM_RANGE: <@generateRandomInt(<1>, <100>)>
# String expressions: <red>, <green>, <blue>
PICK_VALUE: <@pickRandom(<red>, <green>, <blue>)>
```

### Variable reference names
Expand All @@ -122,14 +124,14 @@ Variables are used to store and reuse values across your configuration. They can
- Spaces before and after the reference name are trimmed
- Returns an error if the variable doesn't exist

**Simple examples:**
```yaml
# Store a value in a variable
# Stores a value in myPassword variable
PASSWORD: <@setVar(<myPassword>, <@generateRandomString(<30>)>)>
# Use the stored value
HASHED_PASSWORD: <@getVar(myPassword)|sha256> # Note: no <> around myPassword
SAME_PASSWORD_AGAIN: <@getVar(myPassword)> # Reuse the same value
# Retrieves the stored value (myPassword)
HASHED_PASSWORD: <@getVar(myPassword)|sha256>
# Reuses the stored value (myPassword)
SAME_PASSWORD_AGAIN: <@getVar(myPassword)>
```

:::tip Internal processing of function parameters
Expand Down Expand Up @@ -702,7 +704,7 @@ Generates public and private <a href="https://en.wikipedia.org/wiki/EdDSA">ED255
<tr>
<th className="w-fit">Variant</th>
<th className="w-fit">Description</th>
<th className="w-fit">How to use with: `<@generateED25519Key(<Key>)>`</th>
<th className="w-fit">Retrieving the value</th>
</tr>
</thead>
<tbody>
Expand Down

0 comments on commit b788c7f

Please sign in to comment.