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: test synced tabs #42

Merged
merged 2 commits into from
May 15, 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
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>
Loading