Skip to content

Commit

Permalink
add a 'validate-exists' section to 'snippets.md'
Browse files Browse the repository at this point in the history
  • Loading branch information
ganicke authored Nov 2, 2023
1 parent f22a811 commit 38d80a8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/writing-docs/snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,28 @@ you can add the namespace it should open in parentheses after the normal one

This will appear in tutorials as the `variables` category, but clicking it will toggle the `sprites` category.

### validate-exists

The ``@validate-exists`` tag marks the code block following it as subject to validation. This means that, when [code validation](/writing-docs/tutorials/basics.md#code-validation-validationlocal-and-validationglobal-sections) is enabled in a tutorial, the user is warned that their code isn't matching a block that the tutorial intended.

Use `// @validate-exists` in blocks and TypeScript, and `# @validate-exists`
in Python.

````
```blocks
// @validate-exists
basic.showString("HELLO!")
```
````

### highlight

When used in snippets, the renderer will higlight the next line of code or block following a comment containing
**@highlight**. Use `// @highlight` in blocks and TypeScript, and `# @highlight`
in Python.

Another feature of **@highlight**, like with **@validate-exists**, is that the highlighted block is also validated when [code validation](/writing-docs/tutorials/basics.md#code-validation-validationlocal-and-validationglobal-sections) is enabled.

````
```blocks
console.log(":)")
Expand Down

0 comments on commit 38d80a8

Please sign in to comment.