Skip to content

Commit

Permalink
add components for auto-generation of RPC API documents
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeom committed Jan 25, 2024
1 parent c1dd27f commit 6faee55
Show file tree
Hide file tree
Showing 7 changed files with 6,463 additions and 13,034 deletions.
94 changes: 83 additions & 11 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ const config = {
showReadingTime: true,
},
docs: {
// beforeDefaultRemarkPlugins: [
// [remarkCodeHike, { theme: "nord" }],
// ],
beforeDefaultRemarkPlugins: [
[remarkCodeHike, { theme: "monokai" }],
],
sidebarPath: require.resolve('./sidebars.js'),
sidebarCollapsible: true,
showLastUpdateTime: true,
Expand All @@ -80,13 +80,13 @@ const config = {
'https://github.com/klaytn/klaytn-docs/tree/main/',

// TODO-Klaytn : it will be activated after dacusaurus-openapi bugfix
// docLayoutComponent: "@theme/DocPage",
// docItemComponent: "@theme/ApiItem"
docRootComponent: "@theme/DocRoot",
docItemComponent: "@theme/ApiItem"
},
theme: {
customCss: [
require.resolve('./src/css/custom.css'),
require.resolve("@code-hike/mdx/dist/index.css"),
require.resolve("@code-hike/mdx/styles.css"),
]
},
}),
Expand All @@ -97,18 +97,90 @@ const config = {
[
'docusaurus-plugin-openapi-docs',
{
id: "openapi", // plugin id
id: "api", // plugin id
docsPluginId: "classic", // id of plugin-content-docs or preset for rendering docs
config: {
web3rpc: {
web3rpcKlay: {
// template: "api.mustache",
specPath: "web3rpc.yaml",
outputDir: "docs/klaytn-json-rpc",
specPath: "./web3rpc/yaml/web3rpc-klay.yaml",
outputDir: "docs/klaytn-json-rpc/klay",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
}
},
web3rpcEth: {
specPath: "./web3rpc/yaml/web3rpc-eth.yaml",
outputDir: "docs/klaytn-json-rpc/eth",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcDebug: {
specPath: "./web3rpc/yaml/web3rpc-debug.yaml",
outputDir: "docs/klaytn-json-rpc/debug",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcAdmin: {
specPath: "./web3rpc/yaml/web3rpc-admin.yaml",
outputDir: "docs/klaytn-json-rpc/admin",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcPersonal: {
specPath: "./web3rpc/yaml/web3rpc-personal.yaml",
outputDir: "docs/klaytn-json-rpc/personal",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcNet: {
specPath: "./web3rpc/yaml/web3rpc-net.yaml",
outputDir: "docs/klaytn-json-rpc/net",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcGovernance: {
specPath: "./web3rpc/yaml/web3rpc-governance.yaml",
outputDir: "docs/klaytn-json-rpc/governance",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcTxpool: {
specPath: "./web3rpc/yaml/web3rpc-txpool.yaml",
outputDir: "docs/klaytn-json-rpc/txpool",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcMainbridge: {
specPath: "./web3rpc/yaml/web3rpc-mainbridge.yaml",
outputDir: "docs/klaytn-json-rpc/mainbridge",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
web3rpcSubbridge: {
specPath: "./web3rpc/yaml/web3rpc-subbridge.yaml",
outputDir: "docs/klaytn-json-rpc/subbridge",
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
groupPathsBy: "tag", // group sidebar items by operation "tag"
categoryLinkSource: "tag",
},
},
}
},
]
Expand Down
Loading

0 comments on commit 6faee55

Please sign in to comment.