Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix link #3459

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/old-maps-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
15 changes: 15 additions & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Table of contents](#table-of-contents)
- [Building](#building)
- [Testing](#testing)
- [Referencing snippets](#referencing-snippets)

## Building

Expand Down Expand Up @@ -42,3 +43,17 @@ If no environment is specified, it will run in the browser and node environments
```sh
pnpm test
```

## Referencing snippets

To reference a snippet outside of the current directory, you need to use the following syntax (`<<< @/`):

```md
`<<< @/../../path/to/snippet.ts#snippet-name{language:line-numbers}
```

To reference a snippet in the current directory, you can use the following syntax (`<<< @./`):

```md
`<<< @./snippets/transaction-request/fetch-resources.ts#transaction-request-5{ts:line-numbers}
```
2 changes: 1 addition & 1 deletion apps/docs/src/guide/transactions/transaction-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If needed, you can manually include specific coins or messages in the transactio

Imagine that you have a Sway script that manually calls a contract:

<<< @../../../../sway/script-call-contract/src/main.sw#transaction-request-7{rs:line-numbers}
<<< @/../../docs/sway/script-call-contract/src/main.sw#transaction-request-7{rs:line-numbers}

In those cases, you will need to add both an `InputContract` and `OutputContract` to the transaction request:

Expand Down
Loading