Skip to content

Commit

Permalink
chore: test synced tabs (#42)
Browse files Browse the repository at this point in the history
* Test synced tabs

* Add starlight link
  • Loading branch information
huijing authored May 15, 2024
1 parent 202e08d commit b8198a7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.22.1",
"@astrojs/starlight": "^0.22.3",
"@interledger/docs-design-system": "^0.5.0",
"astro": "^4.7.1",
"astro": "^4.8.3",
"rehype-mathjax": "^6.0.0",
"remark-math": "^6.0.0",
"sharp": "^0.33.3"
Expand Down
57 changes: 57 additions & 0 deletions src/content/docs/content/starlight.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Starlight components
---

import { Tabs, TabItem } from "@astrojs/starlight/components";

Starlight has a number of [built-in components](https://starlight.astro.build/guides/components/#built-in-components) that are useful for documentation sites.

## Synced tabs

In the future, when our Open Payments SDK has been ported to various languages, we would probably want to show the same feature in different languages and synced tabs might be a good way to present those code snippets.

_Initialize Open Payments client_:

<Tabs syncKey="walletAddress">
<TabItem label="Javascript">
```js
const client = await createAuthenticatedClient({
walletAddressUrl: WALLET_ADDRESS,
privateKey: PRIVATE_KEY_PATH,
keyId: KEY_ID,
});
```
</TabItem>
<TabItem label="Ruby">
```ruby
=begin
I have no idea how the
Ruby code should look like
And that is why we do not
have a Ruby SDK today
=end
```
</TabItem>
</Tabs>

_Get wallet address:_

<Tabs syncKey="walletAddress">
<TabItem label="Javascript">
```js
const walletAddress = await client.walletAddress.get({
url: WALLET_ADDRESS,
});
```
</TabItem>
<TabItem label="Ruby">
```ruby
=begin
I have no idea how the
Ruby code should look like
And that is why we do not
have a Ruby SDK today
=end
```
</TabItem>
</Tabs>

0 comments on commit b8198a7

Please sign in to comment.