Skip to content

Commit

Permalink
Merge pull request #261 from sCrypt-Inc/btc
Browse files Browse the repository at this point in the history
Add menu BTC
  • Loading branch information
gitzhou authored May 21, 2024
2 parents fc87906 + d726d4c commit c18df9a
Show file tree
Hide file tree
Showing 25 changed files with 10,714 additions and 28,256 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ Most changes are reflected live without having to restart the server.
yarn start
```

### Generate Open API docs

After updating the `open-api/btc.yaml`, this command need to be run to re-generate all docs in `open-api/btc`:

```
yarn gen-api-docs
```

### Build

This command generates static content in the `/build` directory and can be served using a static content hosting service like S3 or GitHub Pages.
Expand Down
43 changes: 43 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ const config = {
src: 'img/scrypt.png',
},
items: [
{
type: "doc",
docId: "overview",
position: "left",
label: "SDK",
},
{
position: "left",
label: "OpenAPI",
to: "/open-api/overview",
},
{
/* Only visible under docs. See src/custom/custom.css */
href: 'https://github.com/sCrypt-Inc/scryptTS-docs',
Expand Down Expand Up @@ -86,6 +97,38 @@ const config = {
indexName: 'scryptTS-docs',
},
}),

plugins: [
// use multi-instance to render open-api docs, see ref: https://docusaurus.io/docs/docs-multi-instance
[
'@docusaurus/plugin-content-docs',
{
id: 'open-api',
path: 'open-api',
routeBasePath: 'open-api',
sidebarPath: './open-api/sidebars.js',
docLayoutComponent: "@theme/DocPage",
docItemComponent: "@theme/ApiItem" // derived from docusaurus-theme-openapi-docs
},
],
[
'docusaurus-plugin-openapi-docs',
{
id: "open-api-doc-generator", // plugin id
docsPluginId: "open-api", // id of plugin-content-docs or preset for rendering docs
config: {
btc: {
specPath: "open-api/btc.yaml",
outputDir: "open-api/btc",
sidebarOptions: {
groupPathsBy: "tag",
},
},
},
},
]
],
themes: ["docusaurus-theme-openapi-docs"], // export theme components
};

module.exports = config;
Loading

0 comments on commit c18df9a

Please sign in to comment.