Skip to content

Commit

Permalink
Add full example of snippet configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
franciszekjob committed Dec 2, 2024
1 parent 8feb680 commit 8224694
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docs/src/development/shell-snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,31 @@

To configure a snippet, you need to add a comment block right before it. The comment block should contain the configuration in JSON format. Example:

```markdown
`````markdown
<!-- { "package_name": "hello_starknet", "ignore_output": true } -->
```shell
$ sncast \
account create \
--url http://127.0.0.1:5055 \
--name new_account
```

<details>
<summary>Output:</summary>

```shell
command: account create
add_profile: --add-profile flag was not set. No profile added to snfoundry.toml
address: [..]
max_fee: [..]
message: Account successfully created. Prefund generated address with at least <max_fee> STRK tokens or an equivalent amount of ETH tokens. It is good to send more in the case of higher demand.

To see account creation details, visit:
account: https://sepolia.starkscan.co/contract/[..]
```
</details>
`````

## Available configuration options

- `ignored` - if set to `true`, the snippet will be ignored and not run.
Expand Down

0 comments on commit 8224694

Please sign in to comment.