Skip to content

Commit

Permalink
Merge branch 'main' into mm-sdk-tutorial-wagmi-viem
Browse files Browse the repository at this point in the history
  • Loading branch information
joaniefromtheblock authored Oct 24, 2024
2 parents b0879ea + 393a09c commit e29e8e5
Show file tree
Hide file tree
Showing 58 changed files with 12,194 additions and 15,308 deletions.
52 changes: 25 additions & 27 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require("dotenv").config();
const { themes } = require("prism-react-renderer");
const { REF_ALLOW_LOGIN_PATH } = require("./src/lib/constants");
const { fetchAndGenerateDynamicSidebarItems, NETWORK_NAMES, MM_REF_PATH, MM_RPC_URL } = require("./src/plugins/plugin-json-rpc");
const codeTheme = themes.dracula;
const remarkCodesandbox = require("remark-codesandbox");
const isProd = process.env.NODE_ENV === "production";
Expand Down Expand Up @@ -61,35 +62,20 @@ const config = {

presets: [
[
"@metamask/docusaurus-openrpc/dist/preset",
/** @type {import('@metamask/docusaurus-openrpc/dist/preset').Options} */
({
"classic",
{
docs: {
path: "wallet",
routeBasePath: "wallet",
sidebarPath: require.resolve("./wallet-sidebar.js"),
breadcrumbs: false,
id: "docs",
path: "docs",
routeBasePath: "/",
editUrl: "https://github.com/MetaMask/metamask-docs/edit/main/",
remarkPlugins: [
[
remarkCodesandbox,
{
mode: "iframe",
autoDeploy: process.env.NODE_ENV === "production",
},
],
],
openrpc: {
openrpcDocument:
"https://metamask.github.io/api-specs/0.10.5/openrpc.json",
path: "reference",
sidebarLabel: "JSON-RPC API",
},
sidebarPath: false,
breadcrumbs: false,
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
}
],
],
plugins: [
Expand Down Expand Up @@ -144,12 +130,24 @@ const config = {
[
"@docusaurus/plugin-content-docs",
{
id: "docs",
path: "docs",
routeBasePath: "/",
id: "wallet",
path: "wallet",
routeBasePath: "wallet",
editUrl: "https://github.com/MetaMask/metamask-docs/edit/main/",
sidebarPath: false,
sidebarPath: require.resolve("./wallet-sidebar.js"),
breadcrumbs: false,
sidebarItemsGenerator: async function ({ defaultSidebarItemsGenerator, ...args }) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
const dymanicItems = await fetchAndGenerateDynamicSidebarItems(
MM_RPC_URL,
MM_REF_PATH,
NETWORK_NAMES.metamask
)
if (args.item.dirName === "reference/json-rpc-methods") {
return [...sidebarItems, ...dymanicItems]
}
return sidebarItems;
}
},
],
"./src/plugins/plugin-json-rpc.ts",
Expand Down
Loading

0 comments on commit e29e8e5

Please sign in to comment.