Docusaurus OpenRPC Plugin
A Docusaurus plugin for OpenRPC.
Installation
npm install @metamask/docusaurus-openrpc
Usage
There are two ways to use this plugin
1. Use it as a standalone plugin
Uses its own sidebar and path.
To use the plugin as a standalone plugin, add the following to your docusaurus.config.js
file:
[
'@metamask/docusaurus-openrpc',
{
path: '/api-playground',
openrpcDocument: './path/to/openrpc.json',
},
];
To use the plugin as an enhanced plugin-content-docs plugin, add the following to your docusaurus.config.js
file:
[
"@metamask/docusaurus-openrpc/dist/content-docs-enhanced-open-rpc",
({
id: "default",
path: "wallet",
routeBasePath: "wallet",
sidebarPath: require.resolve("./wallet-sidebar.js"),
breadcrumbs: false,
remarkPlugins: [
require("remark-docusaurus-tabs"),
],
openrpc: {
openrpcDocument: "https://metamask.github.io/api-specs/latest/openrpc.json",
path: "reference",
}
}),
],
Development
In development, you can use yarn link
in this repo, then run yarn link "@metamask/docusaurus-openrpc"
in your project (metamask-docs, for example). Finally, run yarn build:watch
in this repo to rebuild the plugin as you make changes.