Skip to content

Commit

Permalink
updated docs file structure fro api URL redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
RumeelHussain committed Jun 20, 2024
1 parent 01220a2 commit 469b7db
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/API/corescan.md → docs/API/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Introducing the Core Scan Open API, a powerful tool that gives developers direct

We've written some tutorials to help you get started with Core Scan Open API. For advanced users, we've included guides for advanced endpoints, such as API-facilitated programmatic contract verification.

Check out the Core Scan Open API tutorials [here](category/core-api-tutorials).
Check out the Core Scan Open API tutorials [here](api/core-api-tutorials).

## API Endpoints

Core Scan Open API provides endpoints for many things, including interacting with deployed smart contracts, fetching a user's CORE balance, and viewing detailed information about transactions.

Check out the full endpoint documentation [here](category/core-api-docs).
Check out the full endpoint documentation [here](api/core-api-docs).

## Support

Expand Down
40 changes: 33 additions & 7 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,34 @@ const config = {
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/coredao-org/CoreDAO-Docs/blob/main',

path: 'docs',
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],

editUrl: 'https://github.com/coredao-org/CoreDAO-Docs/blob/main',
routeBasePath: 'docs',
path: 'docs',
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},

theme: {
customCss: './src/css/custom.css',
},
},
],
],


// plugins: [
// [
// '@docusaurus/plugin-content-docs',
// {
// id: 'api',
// path: 'api',
// routeBasePath: 'api',
// sidebarPath: './sidebarsAPI.js',
// // ... other options
// },
// ],
// ],

stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
Expand Down Expand Up @@ -102,36 +115,49 @@ const config = {
sidebarId: 'learnSidebar',
position: 'left',
label: 'Learn',
activeBaseRegex: `/docs/`,
},
{
type: 'docSidebar',
sidebarId: 'devGuideSidebar',
position: 'left',
label: 'Developer Guide',
activeBaseRegex: `/docs/`,
},
{
type: 'docSidebar',
sidebarId: 'nodeSidebar',
position: 'left',
label: 'Run a Node',
activeBaseRegex: `/docs/`,
},
{
type: 'docSidebar',
sidebarId: 'stakeDelegateSidebar',
position: 'left',
label: 'Staking & Delegation',
activeBaseRegex: `/docs/`,
},
{
type: 'docSidebar',
docId:'api',
sidebarId: 'apiSidebar',
position: 'left',
label: 'Core API',
activeBaseRegex: `/api/`,
},
// {
// to: '/api', // ./docs-api/Intro.md
// label: 'Core API',
// position: 'left',
// activeBaseRegex: `/api/`,
// },
{
type: 'docSidebar',
sidebarId: 'faqSidebar',
position: 'left',
label: 'FAQs',
activeBaseRegex: `/docs/`,
},

{
Expand Down
24 changes: 12 additions & 12 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const sidebars = {
type: 'category',
collapsed: true,
label: '🔗 Connect with CORE API',
link: {type: 'doc', id: 'API/corescan'},
link: {type: 'doc', id: 'api/api'},
items: [
{
type: 'category',
Expand All @@ -285,12 +285,12 @@ const sidebars = {
type: 'generated-index',
title: 'Core Scan Tutorials',
description: 'Learn about how to use the Core Scan API',
slug: '/API/category/core-api-tutorials',
slug: '/api/core-api-tutorials',
},
items: [
'API/tutorials/creating-an-account',
'API/tutorials/generate-an-api-key',
'API/tutorials/common-error-messages',
'api/tutorials/creating-an-account',
'api/tutorials/generate-an-api-key',
'api/tutorials/common-error-messages',
]
},
{
Expand All @@ -301,15 +301,15 @@ const sidebars = {
type: 'generated-index',
title: 'Core Scan API Documentation',
description: 'Explore the various Core Scan API Endpoints',
slug: '/API/category/core-api-docs',
slug: '/api/core-api-docs',
},
items: [
'API/api-documents/accounts',
'API/api-documents/blocks',
'API/api-documents/contracts',
'API/api-documents/geth-proxy',
'API/api-documents/statistics',
'API/api-documents/transactions',
'api/api-documents/accounts',
'api/api-documents/blocks',
'api/api-documents/contracts',
'api/api-documents/geth-proxy',
'api/api-documents/statistics',
'api/api-documents/transactions',
]
}
]
Expand Down
66 changes: 66 additions & 0 deletions sidebarsAPI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure

apiSidebar:[
{
type: 'category',
collapsed: true,
label: '🔗 Connect with CORE API',
link: {type: 'doc', id: 'api'},
items: [
{
type: 'category',
collapsed: true,
label: '📚 Tutorials',
link: {
type: 'generated-index',
title: 'Core Scan Tutorials',
description: 'Learn about how to use the Core Scan API',
slug: '/api/category/core-api-tutorials',
},
items: [
'tutorials/creating-an-account',
'tutorials/generate-an-api-key',
'tutorials/common-error-messages',
]
},
{
type: 'category',
collapsed: true,
label: '📑 API Documents',
link: {
type: 'generated-index',
title: 'Core Scan API Documentation',
description: 'Explore the various Core Scan API Endpoints',
slug: '/api/category/core-api-docs',
},
items: [
'api-documents/accounts',
'api-documents/blocks',
'api-documents/contracts',
'api-documents/geth-proxy',
'api-documents/statistics',
'api-documents/transactions',
]
}
]
},
],

};

export default sidebars;

0 comments on commit 469b7db

Please sign in to comment.