)`.
For example, the sentence:
`See [XRPL.org](http://xrpl.org) for solutions to all the world's problems.`
renders to:
See [XRPL.org](http://xrpl.org) for solutions to all the world's problems.
### Common Links
To make it easier to link to pages that are commonly cited, you can add a `{% raw-partial file="/docs/_snippets/common-links.md /%}` tag to a Markdown file, and then use centrally defined reference-style links such as `[account_info method][]` or `[Payment transaction][]`. The contents of the common-links file are in alphabetical order. (They were first generated by script, but are maintained manually.)
## Code Samples
Format method names and other code structures inline enclosing the code in backtick (`) characters. For example:
My favorite method ever is `nft_info`.
renders as
My favorite method ever is `nft_info`.
For longer code blocks, use three backtics (```) followed by the language name. Type a return, and enter the sample code. At the end of your code sample, type a return and close the block again with three backticks (```).
For example:
```javascript
const prepared = await client.autofill({
"TransactionType": "Payment",
"Account": standby_wallet.address,
"Amount": xrpl.xrpToDrops(sendAmount),
"Destination": standbyDestinationField.value
})
```
renders as
```javascript
const prepared = await client.autofill({
"TransactionType": "Payment",
"Account": standby_wallet.address,
"Amount": xrpl.xrpToDrops(sendAmount),
"Destination": standbyDestinationField.value
})
```
## Markdoc Components
The files are processed with [Markdoc](https://markdoc.dev/), which means they can contain special tags in `{% ... %}` syntax. In addition to Redocly's built-in tags, this repository has some custom tags defined in `/@theme/markdoc/`.
### Badges
See [New Features](#new-features).
### Partials
If you have text that you use frequently, or text that requires periodic update in a number of places in the documentation, you can create a _snippet file for reuse.
Store your file in the `_snippet` directory. To insert the partial file, use the syntax `{% partial file="" /%}`.
For example, here is the snippet `/docs/_snippets/secret-key-warning.md`.
{% admonition type="warning" name="Caution" %}
Never submit a secret key to a server you do not control. Do not send a secret key unencrypted over the network.
{% /admonition %}
To embed the text, use the tag `{% partial file="/docs/_snippets/secret-key-warning.md" /%}`.
For example:
There I was, happy as a lark, skipping through the daisies, when I shyly handed my secret
key to my one true love.
{% partial file="/docs/_snippets/secret-key-warning.md" /%}
Alas, if only I had heeded that sage advice, I would not rue the day as I do today.
renders as:
There I was, happy as a lark, skipping through the daisies, when I shyly handed my secret key to my one true love.
{% partial file="/docs/_snippets/secret-key-warning.md" /%}
Alas, if only I had heeded that sage advice, I would not rue the day as I do today.
### Not-Enabled Badge
The `{% not-enabled /%}` Markdoc component displays a yellow flask icon with a tooltip about how the feature is not available on the production XRP Ledger. Use this when discussing amendments that are open for voting but not currently enabled. Example: {% not-enabled /%}
This tag is self-closing, and it takes no parameters.
### Repo Link
This tag links to a particular file in the source code repository for this site, usually a code sample. For example:
{% repo-link path="_code-samples/build-a-desktop-wallet/js/1_ledger-index.js" %}`1-ledger-index/index.js`{% /repo-link %}
becomes: {% repo-link path="_code-samples/build-a-desktop-wallet/js/1_ledger-index.js" %}`1-ledger-index/index.js`{% /repo-link %}
If you are working from a fork or branch of the site, all such links can be updated at once with a site configuration change.
### Try It
The `{% try-it ... /%}` Markdoc tag provides a convenient shortcut for linking to the WebSocket tool as a button. This tag is self-closing.
Example:
{% try-it method="account_currencies" server="testnet" /%}
Example syntax:
{% try-it method="account_currencies" server="testnet" /%}
The text of the button is normally "Try it!" in English, and can be translated by setting the `component.tryit` key in the localization's `translations.yaml` file.
This tag takes the following parameters:
| Parameter | Required? | Description |
|---|---|---|
| `method` | Yes | The ID of the anchor to use on the WebSocket Tool page. For most WebSocket API methods, this is the API method exactly, but it could contain more. For example, different `ledger_entry` variations use a suffix like `ledger_entry-nft-page`. If you are documenting a new method, you must also add that method to the WebSocket tool by editing `/resources/dev-tools/components/websocket-api/data/command-list.json`. |
| `server` | No | A specific server to use for the request. You may want to specify the server if a method is specific to Clio or `rippled` servers, or if the example uses data or amendments that are only on a specific test network. |
The values you can provide to the `server` parameter are as follows:
| `server` value | Server to use |
|---|---|
| (Omitted) | The WebSocket tool's default server (currently `s1.ripple.com`) |
| `s1` | Ripple's `s1.ripple.com` Mainnet public cluster, typically served by Clio servers. |
| `s2` | Ripple's `s2.ripple.com` Mainnet full-history public cluster, typically served by Clio servers. |
| `xrplcluster` | The `xrplcluster.com` cluster of public servers, typically served by `rippled` servers with a lightweight proxy in front. |
| `devnet` | The `s.altnet.rippletest.net` cluster of Testnet servers. |
| `testnet` | The `s.devnet.rippletest.net` cluster of Devnet servers. |
### Tx Example
The `{% tx-example ... /%}` Markdoc tag provides a convenient shortcut for linking to the WebSocket tool as a button with a body pre-filled to look up a specific example transaction. This tag is self-closing. Example:
{% tx-example txid="1AF19BF9717DA0B05A3BFC5007873E7743BA54C0311CCCCC60776AAEAC5C4635" /%}
Example syntax:
{% tx-example txid="1AF19BF9717DA0B05A3BFC5007873E7743BA54C0311CCCCC60776AAEAC5C4635" /%}
The text of the button is normally "Query example transaction" in English, and can be translated by setting the `component.queryexampletx` key in the localization's `translations.yaml` file.
This tag takes the following parameters:
| Parameter | Required? | Description |
|---|---|---|
| `txid` | Yes | The unique hash of the transaction to look up. |
| `server` | No | A specific server to use for the request. Possible values are the same as `{% try-it %}` as defined above. For example, you may need to specify `devnet` to show a transaction added by an amendment that isn't enabled on Mainnet. |
{% child-pages /%}