Skip to content

Commit b1d8e31

Browse files
author
Conor Okus
committed
Add CodeSwitcher for tab syncing
1 parent 29edeeb commit b1d8e31

File tree

1 file changed

+83
-71
lines changed

1 file changed

+83
-71
lines changed

docs/tutorials/getting-started.md

Lines changed: 83 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,34 @@ If you have any questions about anything related to LDK, feel free to ask our co
66

77
## System Requirements
88
MacOS, Windows and Linux are supported.
9-
109
## Installation
1110
To add LDK to a project, run:
1211

13-
:::: tabs
14-
15-
::: tab Rust
16-
```toml
17-
18-
# Add the following dependencies to your cargo.toml and replace {VERSION} with the version number you want to use.
19-
20-
[dependencies]
21-
lightning = { version = {VERSION}, features = ["max_level_trace"] }
22-
lightning-block-sync = { version = {VERSION}, features = [ "rpc-client" ] }
23-
lightning-invoice = { version = {VERSION} }
24-
lightning-net-tokio = { version = {VERSION} }
25-
lightning-persister = { version = {VERSION} }
26-
lightning-background-processor = { version = {VERSION} }
27-
lightning-rapid-gossip-sync = { version = {VERSION} }
28-
```
29-
:::
30-
31-
::: tab Java
12+
<CodeSwitcher :languages="{rust:'Rust', java:'Java', kotlin:'Kotlin', javascript:'JavaScript'}">
13+
<template v-slot:rust>
14+
15+
```toml
16+
# Add the following dependencies to your cargo.toml and replace {VERSION} with the version number you want to use.
17+
18+
[dependencies]
19+
lightning = { version = {VERSION}, features = ["max_level_trace"] }
20+
lightning-block-sync = { version = {VERSION}, features = [ "rpc-client" ] }
21+
lightning-invoice = { version = {VERSION} }
22+
lightning-net-tokio = { version = {VERSION} }
23+
lightning-persister = { version = {VERSION} }
24+
lightning-background-processor = { version = {VERSION} }
25+
lightning-rapid-gossip-sync = { version = {VERSION} }
26+
```
27+
28+
</template>
29+
30+
<template v-slot:java>
31+
3232
```xml
33-
<!--
34-
For Maven, add the following dependency to your POM and replace {VERSION} with the
35-
version number you want to use.
36-
-->
33+
<!--
34+
For Maven, add the following dependency to your POM and replace {VERSION} with the
35+
version number you want to use.
36+
-->
3737

3838
<dependency>
3939
<groupId>org.lightningdevkit</groupId>
@@ -42,7 +42,7 @@ version number you want to use.
4242
</dependency>
4343
```
4444

45-
```kotlin
45+
```kotlin
4646
/*
4747
For Gradle, add the following dependency to your build.gradle and replace {VERSION} with
4848
the version number you want to use.
@@ -54,57 +54,69 @@ dependencies {
5454
// ...
5555
}
5656
```
57-
:::
58-
::: tab Kotlin
59-
```kotlin
60-
/* To include the LDK Kotlin bindings in an Android project download the latest binary from https://github.com/lightningdevkit/ldk-garbagecollected/releases and place it in your libs directory.
61-
Then add to your build.gradle file:
62-
*/
6357

64-
dependencies {
65-
// ...
66-
implementation fileTree(include: ['*.aar'], dir: 'libs')
67-
// ...
68-
}
69-
```
70-
:::
58+
</template>
59+
<template v-slot:kotlin>
7160

72-
::: tab Javascript/Typescript
73-
```javascript
74-
npm i lightningdevkit --save
75-
```
76-
:::
61+
```kotlin
62+
/* To include the LDK Kotlin bindings in an Android project download the latest binary from https://github.com/lightningdevkit/ldk-garbagecollected/releases and place it in your libs directory.
63+
Then add to your build.gradle file:
64+
*/
65+
66+
dependencies {
67+
// ...
68+
implementation fileTree(include: ['*.aar'], dir: 'libs')
69+
// ...
70+
}
71+
```
72+
73+
</template>
74+
<template v-slot:javascript>
7775

78-
::::
76+
```javascript
77+
npm i lightningdevkit --save
78+
```
79+
80+
</template>
81+
</CodeSwitcher>
7982

8083
Example usage after installation is complete:
81-
:::: tabs
82-
::: tab Rust
83-
```rust
84-
use lightning::chain::chaininterface::FeeEstimator;
85-
```
86-
:::
8784

88-
::: tab Java
89-
```java
90-
import org.ldk.structs.FeeEstimator
91-
```
92-
:::
85+
<CodeSwitcher :languages="{rust:'Rust', java:'Java', kotlin:'Kotlin', javascript:'JavaScript'}">
86+
<template v-slot:rust>
9387

94-
::: tab Kotlin
95-
```kotlin
96-
import org.ldk.structs.FeeEstimator
97-
```
98-
:::
88+
```rust
89+
use lightning::chain::chaininterface::FeeEstimator;
90+
```
9991

100-
::: tab "JavaScript/Typescript"
101-
```javascript
102-
import { FeeEstimator } from "lightningdevkit";
103-
import * as fs from "fs";
104-
import { strict as assert } from "assert";
105-
106-
const wasm_file = fs.readFileSync("node_modules/lightningdevkit/liblightningjs.wasm");
107-
await ldk.initializeWasmFromBinary(wasm_file);
108-
```
109-
:::
110-
::::
92+
</template>
93+
94+
<template v-slot:java>
95+
96+
```java
97+
import org.ldk.structs.FeeEstimator
98+
```
99+
100+
</template>
101+
102+
<template v-slot:kotlin>
103+
104+
```kotlin
105+
import org.ldk.structs.FeeEstimator
106+
```
107+
108+
</template>
109+
110+
<template v-slot:javascript>
111+
112+
```javascript
113+
import { FeeEstimator } from "lightningdevkit";
114+
import * as fs from "fs";
115+
import { strict as assert } from "assert";
116+
117+
const wasm_file = fs.readFileSync("node_modules/lightningdevkit/liblightningjs.wasm");
118+
await ldk.initializeWasmFromBinary(wasm_file);
119+
```
120+
121+
</template>
122+
</CodeSwitcher>

0 commit comments

Comments
 (0)