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

Unify tabs configuration #1034

Merged
merged 7 commits into from
Jul 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ snippets), while keeping the language agnostic instructions outside the tabs.

#### Tabs Example

<Tabs groupId="language">
<Tabs groupId="language" queryString>
<TabItem value="java" label="Java">
Java specific code and text goes here.
</TabItem>
<TabItem value="nodejs" label="Nodejs">
<TabItem value="node" label="Node.js">
Nodejs specific code and text goes here.
</TabItem>
</Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,15 @@ This test suite is available in newer versions of the framework, but not yet in

This section shows the Rust and TypeScript `MemStore` implementations, which are thoroughly commented.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/tree/support/v0.5/bindings/wasm/examples-account/src/memory_storage.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/tree/support/v0.5/identity-account-storage/src/storage/memstore.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,15 @@ Select your programming language of choice and press the green play button to ex

:::

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/create_did.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/create_did.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,15 @@ https://github.com/iotaledger/identity.rs/tree/support/v0.5/examples/account/con

### Low-level API

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/tree/support/v0.5/bindings/wasm/examples/src/private_tangle.js
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/tree/support/v0.5/examples/low-level-api/private_tangle.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ the W3C specification.

The following example demonstrates how to resolve the DID: "did:iota:H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV" from the `main` network.

<Tabs>
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
use identity::iota::Resolver;
Expand Down Expand Up @@ -62,8 +62,8 @@ the resolver needs to be configured to have a client capable of operating on sai

The following example demonstrates how one can setup a `Resolver` with a given `client` and then attempt resolving a specified `did` which may be on any Tangle (public or private).

<Tabs>
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
use identity::iota::Resolver;
Expand Down Expand Up @@ -122,8 +122,8 @@ advanced use cases where more control is desired. To accommodate for such situat
The fact that a DID Document [can be updated](./update.mdx) implies that the state of the DID Document can change over time, or in other words the result of resolving a DID
also depends on when this operation was carried out. The `Resolver` provides a way to view the entire history of a DID Document (up to the time when the method is called).

<Tabs>
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
use identity::iota::Resolver;
Expand Down Expand Up @@ -158,22 +158,15 @@ async function callResolveHistory(did) {

This section shows complete examples from the Iota Identity Framework code base. The first example creates a DID Document, publishes it to the Tangle and then resolves it.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples/src/resolve_did.js
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/low-level-api/resolve_did.rs
Expand All @@ -184,22 +177,15 @@ https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/low-level-a

This second example demonstrates creating, publishing changes and then resolving the history of a DID Document.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples/src/resolve_history.js
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rushttps://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/low-level-api/resolve_history.rs
t reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,15 @@ The following properties can be specified for a service:

The following example demonstrates adding verification methods and services to a DID Document.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/manipulate_did.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/manipulate_did.rs
Expand All @@ -100,8 +93,8 @@ https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/man

The Example above starts by [creating an identity using the account](./create.mdx).

<Tabs groupId="code-examples">
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
let mut account: Account = Account::builder()
Expand Down Expand Up @@ -162,8 +155,8 @@ Note that the Account does not allow removing all capability invocation keys.

Another verification method can be added to the DID document using the Account:

<Tabs groupId="code-examples">
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
account
Expand Down Expand Up @@ -226,8 +219,8 @@ Since the `MethodScope` is not specified, the verification method will be create

Verification relationship can be attached to a verification method by referencing its fragment.

<Tabs groupId="code-examples">
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
account
Expand Down Expand Up @@ -297,8 +290,8 @@ property now has both an embedded and a referenced verification method.

Similar to verification methods, services can be added to a DID Document.

<Tabs groupId="code-examples">
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
account
Expand Down Expand Up @@ -373,8 +366,8 @@ The updated Document with the newly created service looks as follows.

Verification methods and/or their relationships can be removed from the DID Document. The following code removes the verification method that we created previously.

<Tabs groupId="code-examples">
<TabItem value="Rust" label="Rust">
<Tabs groupId="language" queryString>
<TabItem value="rust" label="Rust">

```rust
account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,15 @@ A [verifiable presentation](./verifiable_presentations.mdx) is the recommended d
The following code exemplifies how an issuer can create, sign, and validate a verifiable credential. In this example, the issuer signs a UniversityDegreeCredential with Alice's name and DID.
This Verifiable Credential can be [verified by anyone](./verifiable_presentations.mdx), allowing Alice to take control of it and share it with anyone.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/create_vc.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/create_vc.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,15 @@ Revocation List 2020 is not yet supported in the IOTA Identity Framework

The following code exemplifies how you can revoke a [Verifiable Credential(VC)](overview.mdx) by removing a verification method (public key) from the DID Document of the Issuer. This means the VC can no longer be validated. This would invalidate every VC signed with the same public key, meaning the Issuer would have to sign every VC with a different key.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/revoke_vc.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/revoke_vc.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,15 @@ so setting a signature expiration alone should not be relied upon.
The following code demonstrates how to use the IOTA Identity Framework end-to-end to create and sign a verifiable presentation as a holder,
serialize it to JSON for transmission, deserialize it on the receiving side as a verifier, and finally validate it with various options.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/create_vp.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/create_vp.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,15 @@ Select your programming language of choice and press the green play button to ex

:::

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/bindings/wasm/examples-account/src/create_did.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/blob/support/v0.5/examples/account/create_did.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,15 @@ The `StorageTestSuite` can be used to test the basic functionality of storage im

This section shows the Rust and TypeScript `MemStore` implementations, which are thoroughly commented.

<Tabs
groupId="programming-languages"
defaultValue="nodejs"
values={[
{ label: "Node.js", value: "nodejs" },
{ label: "Rust", value: "rust" }
]}
>
<TabItem value="nodejs">
<Tabs groupId="language" queryString>
<TabItem value="node" label="Node.js">

```ts reference
https://github.com/iotaledger/identity.rs/tree/support/v0.6/bindings/wasm/examples-account/src/custom_storage.ts
```

</TabItem>
<TabItem value="rust">
<TabItem value="rust" label="Rust">

```rust reference
https://github.com/iotaledger/identity.rs/tree/support/v0.6/identity_account_storage/src/storage/memstore.rs
Expand Down