1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Generate rest-api docs from API.md

This commit is contained in:
Akshay 2022-02-23 17:31:49 +01:00
parent badeecf22b
commit 26f7f29b37
3 changed files with 37 additions and 37 deletions

View File

@ -96,7 +96,7 @@ module.exports = {
}, },
{ {
name: 'provider', name: 'provider',
url: 'https://v4.provider.mainnet.oceanprotocol.com' url: 'https://provider.mainnet.oceanprotocol.com/spec'
} }
] ]
} }

View File

@ -11,12 +11,12 @@
- group: Aquarius REST API - group: Aquarius REST API
items: items:
- title: API Reference - title: API Reference
link: /references/aquarius/ link: /references/aquarius-rest-api/
- group: provider REST API - group: provider REST API
items: items:
- title: API Reference - title: API Reference
link: /references/provider/ link: /references/provider-rest-api/
- group: Provider Py Module - group: Provider Py Module
items: items:

View File

@ -165,26 +165,26 @@ exports.createPages = ({ graphql, actions }) => {
const providerList = filterMarkdownList(markdowns, 'provider') const providerList = filterMarkdownList(markdowns, 'provider')
const subgraphList = filterMarkdownList(markdowns, 'ocean-subgraph') const subgraphList = filterMarkdownList(markdowns, 'ocean-subgraph')
// const aquariusRestApi = getRestApiPageFromMarkdownList( const aquariusRestApi = getRestApiPageFromMarkdownList(
// markdowns, markdowns,
// 'aquarius' 'aquarius'
// )[0].node )[0].node
// await createRestApiPage( await createRestApiPage(
// createPage, createPage,
// aquariusRestApi, aquariusRestApi,
// `/references/aquarius` `/references/aquarius-rest-api`
// ) )
// const providerRestApi = getRestApiPageFromMarkdownList( const providerRestApi = getRestApiPageFromMarkdownList(
// markdowns, markdowns,
// 'provider' 'provider'
// )[0].node )[0].node
// await createRestApiPage( await createRestApiPage(
// createPage, createPage,
// providerRestApi, providerRestApi,
// `/references/provider` `/references/provider-rest-api`
// ) )
await createReadTheDocsPage(createPage, 'ocean-py', oceanPyList) await createReadTheDocsPage(createPage, 'ocean-py', oceanPyList)
await createReadTheDocsPage(createPage, 'provider', providerList) await createReadTheDocsPage(createPage, 'provider', providerList)
@ -314,20 +314,20 @@ const filterMarkdownList = (markdownList, string) => {
return markdownList.filter(({ node }) => node.frontmatter.app === string) return markdownList.filter(({ node }) => node.frontmatter.app === string)
} }
// const createRestApiPage = async (createPage, node, slug) => { const createRestApiPage = async (createPage, node, slug) => {
// const template = path.resolve('./src/templates/RestApi.jsx') const template = path.resolve('./src/templates/RestApi.jsx')
// createPage({ createPage({
// path: slug, path: slug,
// component: template, component: template,
// context: { context: {
// node, node,
// slug slug
// } }
// }) })
// } }
// const getRestApiPageFromMarkdownList = (markdownList, string) => { const getRestApiPageFromMarkdownList = (markdownList, string) => {
// return markdownList.filter(({ node }) => { return markdownList.filter(({ node }) => {
// return node.frontmatter.app === string && node.frontmatter.slug === 'API.md' return node.frontmatter.app === string && node.frontmatter.slug === 'API.md'
// }) })
// } }