Skip to content

Commit

Permalink
chore: fix link (#3459)
Browse files Browse the repository at this point in the history
* chore: fix link

* docs: fix docs link

* chore: fix link
  • Loading branch information
petertonysmith94 authored Dec 9, 2024
1 parent 7390114 commit 6d0fe76
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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

0 comments on commit 6d0fe76

Please sign in to comment.