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

SDK: New Docs #1766

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ To contribute changes:

> **Notes:**
>
> - All documentation content is located in the `wallet`, `snaps`, `services`, and
> - All documentation content is located in the `wallet`, `sdk`, `snaps`, `services`, and
> `developer-tools` directories.
> - If you add a new documentation page, edit `wallet-sidebar.js`, `snaps-sidebar.js`,
> - If you add a new documentation page, edit `wallet-sidebar.js`, `sdk-sidebar.js`, `snaps-sidebar.js`,
> `services-sidebar.js`, or `dashboard-sidebar.js` to add the page to the
> [sidebar](https://docs-template.consensys.io/create/configure-docusaurus#sidebar).
> - If you delete, rename, or move a documentation file, add a
Expand Down Expand Up @@ -120,7 +120,7 @@ Refer to the [Consensys documentation style guide](https://docs-template.consens

## Add images

All images are located in the `wallet/assets`, `snaps/assets`, `services/images`, and
All images are located in the `wallet/assets`, `sdk/_assets`, `snaps/assets`, `services/images`, and
`developer-tools/images` directories.
When adding a new image, such as a screenshot or diagram, make sure the image has a white or
`#1b1b1d` color background in order for it to be compatible with the site's light and dark modes.
Expand Down
21 changes: 20 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ const config = {
}
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "sdk",
path: "sdk",
routeBasePath: "sdk",
editUrl: "https://github.com/MetaMask/metamask-docs/edit/main/",
sidebarPath: require.resolve("./sdk-sidebar.js"),
breadcrumbs: false,
},
],
"./src/plugins/plugin-json-rpc.ts",
isProd
? [
Expand Down Expand Up @@ -178,9 +189,13 @@ const config = {
width: 150,
},
items: [
{
to: "sdk",
label: "SDK",
},
{
to: "wallet",
label: "Wallet",
label: "Wallet API",
},
{
to: "snaps",
Expand Down Expand Up @@ -248,6 +263,10 @@ const config = {
label: "Wallet",
to: "/wallet",
},
{
label: "SDK",
to: "/sdk",
},
{
label: "Snaps",
to: "/snaps",
Expand Down
68 changes: 68 additions & 0 deletions sdk-sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebar = {
sdkSidebar: [
{
type: 'category',
label: 'Introduction',
collapsible: false,
collapsed: false,
items: [
'introduction/welcome',
'introduction/supported-platforms',
'introduction/supported-networks',
'introduction/llm-prompt',
{
type: 'link',
label: 'Try Demo App',
href: 'https://example.com',
},
],
},
{
type: 'category',
label: 'Quick Start',
collapsible: false,
collapsed: false,
items: [
'quick-start/javascript-+-wagmi',
'quick-start/javascript',
'quick-start/react-native',
],
},
{
type: 'category',
label: 'Guides',
collapsible: false,
collapsed: false,
items: [
'guides/user-authentication',
'guides/network-management',
'guides/transaction-handling',
'guides/interact-with-contracts',
{
type: 'category',
label: 'Advanced',
collapsible: true,
collapsed: true,
items: [
'guides/advanced/connect-and-sign',
'guides/advanced/batch-requests',
],
},
],
},
{
type: 'category',
label: 'API Reference',
collapsible: false,
collapsed: false,
items: [
'api-reference/sdk-api'
],
}
],
};

module.exports = sidebar;
Binary file added sdk/_assets/connect.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sdk/_assets/network.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sdk/_assets/quickstart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading