Skip to content

Commit

Permalink
feat: update structure (#90)
Browse files Browse the repository at this point in the history
* feat: add docsearch features

Add some additional DOM structure to help with Algolia docsearch crawling.

* docs: adjust structure for paths

* chore: fix linting

* feat: upate docs template version

* docs: edit js ethers pages

* fix: build error
  • Loading branch information
itsacoyote authored Aug 27, 2024
1 parent 39a814b commit 7fcee4c
Show file tree
Hide file tree
Showing 173 changed files with 265 additions and 73 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
},
"editor.tabCompletion": "onlySnippets"
},
"eslint.experimental.useFlatConfig": true,
"workbench.colorCustomizations": {
"statusBar.background": "#ff8a66",
"statusBar.foreground": "#15202b",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
37 changes: 37 additions & 0 deletions composables/useCategory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const defaultCategory = 'SDK Docs';

// Order by most specific to least specific.
// e.g. `/js/ethers/api/v5` before `/js/ethers`
const categories = [
['/js/ethers/api/v5', 'Ethersv5 API'],
['/js/ethers/api/v6', 'Ethersv6 API'],
['/js/ethers', 'EthersJS'],
['/js/web3js', 'Web3JS'],
['/go/api', 'Go API'],
['/go', 'Go SDK'],
['/python/api', 'Python API'],
['/python', 'Python SDK'],
['/java/api', 'Java API'],
['/java', 'Java SDK'],
['/swift/api', 'Swift API'],
['/swift', 'Swift SDK'],
['/rust', 'Rust SDK'],
] as const;

/**
* Returns the category of the current route.
* Primarily this is for the algolia docsearch
*/
export const useCategory = () => {
const route = useRoute();
const category = ref(defaultCategory);
// for if we ever have i18n routes, remove the language prefix
// const langAgnosticPath = route.path.replace(/\/\w\w(-\w\w)?\//, '');
for (const [path, label] of categories) {
if (route.path.startsWith(path)) {
category.value = label;
break;
}
}
return category;
};
10 changes: 5 additions & 5 deletions content/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,39 @@ Integrate JS with ZKsync Era for secure transactions.
---
title: GO
icon: i-heroicons-cog
to: /go/introduction/overview
to: /go
---
Integrate ZKsync GO SDK for ZKsync Era features.
::
::card
---
title: Python
icon: i-heroicons-circle-stack
to: /python/introduction/overview
to: /python
---
Explore Nuxt built-in components for pages, layouts, head, and more.
::
::card
---
title: Java
icon: i-heroicons-rectangle-group
to: /java/introduction/overview
to: /java
---
Integrate ZKsync Era with Java for cost-effective transactions.
::
::card
---
title: Swift
icon: i-heroicons-rocket-launch
to: /swift/introduction/overview
to: /swift
---
Integrate ZKsync Era with Swift for efficiency.
::
::card
---
title: Rust
icon: i-heroicons-wrench
to: /rust/getting-started
to: /rust
---
Integrate ZKsync Era with Rust for scalable transactions.
::
Expand Down
9 changes: 7 additions & 2 deletions content/10.js/00.ethers/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Overview
description: Explore the zksync-ethers SDK versions
tags: ["zksync", "sdks", "zksync era sdk", "ethereum", "era network", "javascript versions"]
links:
- label: NPM
to: https://www.npmjs.com/package/zksync-ethers
icon: simple-icons:npm
target: _blank
---

The zksync-ethers SDK versions enable developers to interact seamlessly with the ZKsync Era blockchain. These SDKs
Expand All @@ -13,7 +18,7 @@ There are two main versions of the zksync-ethers SDK: V5 and V6. Each version ca
distinct features and improvements.

::callout{icon="i-heroicons-light-bulb"}
Check the [installation guide](/js/ethers/installation-js) for instructions.
Check the [installation guide](/js/ethers/installation) for instructions.
::

## Choosing the right version
Expand All @@ -29,5 +34,5 @@ Choosing the right version of the zksync-ethers SDK depends on your project requ
| Community Support| Extensive community resources | Growing community support |

::callout{icon="i-heroicons-light-bulb"}
To use the `zksync-ethers` v5 or v6, visit the [Getting Started](/js/ethers/guides/getting-started) page.
To use the `zksync-ethers` v5 or v6, visit the [Getting Started](/js/ethers/guides) page.
::
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions content/10.js/00.ethers/04.guides/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Guides
8 changes: 8 additions & 0 deletions content/10.js/00.ethers/05.api/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: ZKsync Ethers API
description: The ZKsync Ethers API documentation.
navigation: false
---

- [EthersV5](/js/ethers/api/v5)
- [EthersV6](/js/ethers/api/v6)
10 changes: 10 additions & 0 deletions content/10.js/00.ethers/05.api/10.v5/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: ZKsync EthersV5 API
description: The ZKsync EthersV5 API documentation.
navigation: false
---

- [Providers](/js/ethers/api/v5/providers)
- [Accounts](/js/ethers/api/v5/accounts)
- [Contract](/js/ethers/api/v5/contract)
- [Utilities](/js/ethers/api/v5/utilities)
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/10.v5/10.providers/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Providers
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/10.v5/20.accounts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Accounts
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/10.v5/30.contract/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Contract
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const l2ContractAddress = utils.applyL1ToL2Alias(l1ContractAddress);
```

::callout
See also [`undol1tol2alias`](/js/ethers/api/v5/utilities/utils#undol1tol2alias).
See also [`undol1tol2alias`](/js/ethers/api/v5/utilities#undol1tol2alias).
::

### `checkBaseCost`
Expand Down
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/10.v5/50.utilities/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Utilities
10 changes: 10 additions & 0 deletions content/10.js/00.ethers/05.api/20.v6/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: ZKsync EthersV6 API
description: The ZKsync EthersV6 API documentation.
navigation: false
---

- [Providers](/js/ethers/api/v6/providers)
- [Accounts](/js/ethers/api/v6/accounts)
- [Contract](/js/ethers/api/v6/contract)
- [Utilities](/js/ethers/api/v6/utilities)
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/20.v6/10.providers/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Providers
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/20.v6/20.accounts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Accounts
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/20.v6/30.contract/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Contract
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const l2ContractAddress = utils.applyL1ToL2Alias(l1ContractAddress);
```

::callout
See also [`undol1tol2alias`](/js/ethers/api/v6/utilities/utils#undol1tol2alias).
See also [`undol1tol2alias`](/js/ethers/api/v6/utilities#undol1tol2alias).
::

### `checkBaseCost`
Expand Down
1 change: 1 addition & 0 deletions content/10.js/00.ethers/05.api/20.v6/50.utilities/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Utilities
5 changes: 5 additions & 0 deletions content/10.js/01.web3js/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Overview
description: Explore the Web3.js plugin for ZKsync
tags: ["zksync", "sdks", "zksync era sdk", "ethereum", "era network", "web3.js", "web3.js plugin"]
links:
- label: NPM
to: https://www.npmjs.com/package/web3-plugin-zksync
icon: simple-icons:npm
target: _blank
---

The [Web3.js plugin for ZKsync](https://github.com/ChainSafe/web3-plugin-zksync) makes it easy for developers to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Overview
description: An introduction to zksync2-go
tags: ["zksync", "zksync2-go", "ethereum", "layer-2", "zero-knowledge rollups", "go library", "blockchain scalability", "crypto transactions"]
links:
- label: GitHub
to: https://github.com/zksync-sdk/zksync2-go
icon: simple-icons:github
target: _blank
---

This guide will help you understand the fundamentals of `zksync2-go` and how to get started.
Expand All @@ -20,5 +25,5 @@ interfaces and comprehensive documentation.
- **Interoperability**: Compatible with existing Ethereum tools and infrastructure.

::callout{icon="i-heroicons-light-bulb"}
To use the `zksync2-go`, visit the [Getting Started](/go/guides/getting-started) page.
To use the `zksync2-go`, visit the [Getting Started](/go/guides) page.
::
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This guide provides an overview of the most common operations developers need to

::callout{icon="i-heroicons-light-bulb"}
Ensure you have installed the `zksync2-go` SDK. If you still need to do so, please refer to
the [installation guide](/go/introduction/installation) for detailed instructions.
the [installation guide](/go/installation) for detailed instructions.
::

## Overview
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ description: Methods for handling transactions between L1 and L2 networks on ZKs
tags: ["zksync", "l1", "l2", "transactions", "go", "sdk"]
---

This section explores the methods which allow the [account](/go/api/accounts/introduction) to send transactions
This section explores the methods which allow the [account](/go/api/accounts) to send transactions
among both L1 to
L2 networks. For background on how L1<->L2 interaction works on ZKsync, go through the
[introduction](https://docs.zksync.io/build/developer-reference/l1-l2-interoperability).

::callout{icon="i-heroicons-light-bulb"}
Full examples of actions below are available on the [getting started](/go/guides/getting-started) page.
Full examples of actions below are available on the [getting started](/go/guides) page.
::

## Deposit
Expand Down Expand Up @@ -284,7 +284,7 @@ please refer to the method specification [`ClaimFailedDeposit`](/go/api/accounts
## Finalize withdraw
`WalletL1` and `Wallet` objects provide a finalize withdraw workflow. For more information,
please refer to the method specification [`FinalizeWithdraw`](/go/api/accounts/introduction#finalizewithdraw).
please refer to the method specification [`FinalizeWithdraw`](/go/api/accounts#finalizewithdraw).
## Withdrawal
Expand Down
1 change: 1 addition & 0 deletions content/20.go/30.guides/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Guides
12 changes: 12 additions & 0 deletions content/20.go/40.api/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: ZKsync Go API
description: The ZKsync Go API documentation.
navigation: false
---

- [Clients](/go/api/clients)
- [Accounts](/go/api/accounts)
- [EIP712](/go/api/eip712)
- [Contracts](/go/api/contracts)
- [Utilities](/go/api/utilities)
- [Types](/go/api/types)
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions content/20.go/40.api/10.clients/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Clients
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Returns a new instance of `Wallet` with the provided client for the L2 network.

| Parameter | Type | Description |
| --------- | ---------------------------- | ----------- |
| `client` | [`*clients.Client`](/go/api/clients/introduction) | L2 client. |
| `client` | [`*clients.Client`](/go/api/clients) | L2 client. |

```go
Connect(client *clients.Client) (*Wallet, error)
Expand Down
1 change: 1 addition & 0 deletions content/20.go/40.api/20.accounts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Accounts
File renamed without changes.
1 change: 1 addition & 0 deletions content/20.go/40.api/30.eip712/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: EIP712
1 change: 1 addition & 0 deletions content/20.go/40.api/40.contracts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Contracts
1 change: 1 addition & 0 deletions content/20.go/40.api/50.utilities/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Utilities
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ tags: ["go", "zksync", "sdk", "types"]
Types are placed in three packages for different purposes:

- [`types`](/go/api/types): Contains common and general types used to build basic features and other types.
- [`eip712`](/go/api/eip712/eip712): Contains types used for EIP-712 implementation.
- [`clients`](/go/api/clients/types): Contains types that are meant to be used along with [`Client`](/go/api/clients/introduction).
- [`eip712`](/go/api/eip712): Contains types used for EIP-712 implementation.
- [`clients`](/go/api/clients/types): Contains types that are meant to be used along with [`Client`](/go/api/clients).
- [`accounts`](/go/api/accounts/types): Contains types that are meant to be used along with an account, specifically
with the [`Adapter`](/go/api/accounts/types) abstraction. Many types are similar to those from the `geth` library, but
the `From` or `Signer` fields are omitted because these fields are inherited from `Adapter`, which already has an
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions content/20.go/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Overview
description: An introduction to the zksync2-python and its features.
tags: ["zksync", "python", "sdk", "overview"]
links:
- label: GitHub
to: https://github.com/zksync-sdk/zksync2-python
icon: simple-icons:github
target: _blank
---

The ZKsync Python SDK is a powerful tool designed to facilitate interaction with the ZKsync Layer-2 scaling solution
Expand Down Expand Up @@ -31,5 +36,5 @@ library. Most objects exported by `zksync2` inherit from `web3.py` objects and o
### Additional resources

::callout{icon="i-heroicons-light-bulb"}
To use the `zksync2-python`, visit the [Getting Started](/python/guides/getting-started) page.
To use the `zksync2-python`, visit the [Getting Started](/python/guides) page.
::
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ The SDK is actively developed and maintained by the ZKsync team. This ensures th
latest features and improvements, keeping your projects up to date with the evolving blockchain landscape.

::callout{icon="i-heroicons-light-bulb"}
Explore the [Python SDK documentation](/python/guides/getting-started) to get started and take advantage of all the
Explore the [Python SDK documentation](/python/guides) to get started and take advantage of all the
features and benefits it offers.
::
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags: ["zksync", "python", "sdk", "getting started"]
This guide will help you get started with the `zksync2-python`, from connecting to the network to performing basic operations.

::callout{icon="i-heroicons-light-bulb"}
Check the [installation guide](/python/introduction/installation) for instructions.
Check the [installation guide](/python/installation) for instructions.
::

## Connecting to ZKsync Era
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions content/30.python/30.guides/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Guides
11 changes: 11 additions & 0 deletions content/30.python/40.api/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: ZKsync Python API
description: The ZKsync Python API documentation.
navigation: false
---

- [Providers](/python/api/providers)
- [Accounts](/python/api/accounts)
- [Contracts](/python/api/contracts)
- [Utilities](/python/api/utilities)
- [Types](/python/api/types)
1 change: 1 addition & 0 deletions content/30.python/40.api/10.providers/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Providers
1 change: 1 addition & 0 deletions content/30.python/40.api/20.accounts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Accounts
1 change: 1 addition & 0 deletions content/30.python/40.api/30.contracts/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Contracts
1 change: 1 addition & 0 deletions content/30.python/40.api/40.utilities/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Utilities
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions content/30.python/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Python
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Overview
description: An introduction to zksync2-java and its features.
tags: ["zksync", "java", "sdk", "blockchain", "ethereum"]
links:
- label: GitHub
to: https://github.com/zksync-sdk/zksync2-java
icon: simple-icons:github
target: _blank
---

The `zksync2-java` is a powerful tool designed for developers working with the Ethereum blockchain.
Expand Down Expand Up @@ -41,5 +46,5 @@ The `zksync2-java` library is designed with simplicity in mind, offering straigh
documentation to help developers get started quickly and efficiently.

::callout{icon="i-heroicons-light-bulb"}
To use the `zksync2-java`, visit the [Getting started](/java/guides/getting-started) page.
To use the `zksync2-java`, visit the [Getting started](/java/guides) page.
::
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ blockchain functions.

::callout{icon="i-heroicons-light-bulb"}
Ensure you have installed the `zksync2-java` SDK. If you still need to do so, please refer to
the [installation guide](/java/introduction/installation) for detailed instructions.
the [installation guide](/java/installation) for detailed instructions.
::

## Examples
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions content/40.java/20.guides/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Guides
11 changes: 11 additions & 0 deletions content/40.java/30.api/00.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Java API
description: The Java ZKsync API documentation.
navigation: false
---

- [Providers](/java/api/providers)
- [Accounts](/java/api/accounts)
- [Contract](/java/api/contract)
- [Utilities](/java/api/utilities)
- [Types](/java/api/types)
Loading

0 comments on commit 7fcee4c

Please sign in to comment.