mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-02 08:20:22 +01:00
tinkering
This commit is contained in:
parent
4cd18e945e
commit
5674d78974
@ -154,39 +154,7 @@ const createTypeDocPage = async (createPage, name, downloadUrl) => {
|
||||
component: typedocTemplate,
|
||||
context: {
|
||||
slug,
|
||||
typedoc: await typedoc.json(),
|
||||
// We define the classes here so the data object passed as page context
|
||||
// is as small as possible.
|
||||
// Caveat: no live update during development when these values are changed.
|
||||
//
|
||||
// TODO: defining these classes for inclusion
|
||||
// needs to be handled somewhere else to keep
|
||||
// it generic for all TypeDoc specs
|
||||
classes: [
|
||||
'ocean/Ocean',
|
||||
'ocean/Account',
|
||||
'ocean/Assets',
|
||||
'ocean/Compute',
|
||||
'ocean/Versions',
|
||||
'ocean/DID',
|
||||
'ddo/DDO',
|
||||
'metadatacache/MetadataCache',
|
||||
'metadatacache/OnChainMetaDataCache',
|
||||
'provider/Provider',
|
||||
'datatokens/Datatokens',
|
||||
'datatokens/Network',
|
||||
'datatokens/Web3Provider',
|
||||
'balancer/OceanPool',
|
||||
'balancer/Pool',
|
||||
'balancer/PoolFactory',
|
||||
'exchange/FixedRateExchange',
|
||||
'models/Config',
|
||||
'utils/ConfigHelper',
|
||||
'utils/GasUtils',
|
||||
'ocean/utils/OceanUtils',
|
||||
'ocean/utils/WebServiceConnector',
|
||||
'utils/Logger'
|
||||
]
|
||||
typedoc: await typedoc.json()
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
|
10883
ocean.js.json
Normal file
10883
ocean.js.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -201,7 +201,7 @@ PropertyWrapper.propTypes = {
|
||||
|
||||
const Entities = ({ entities, sourceUrl }) =>
|
||||
entities.map(({ name, comment, children }) => (
|
||||
<div key={shortid.generate()} id={name && slugify(name)}>
|
||||
<div key={name} id={name && slugify(name)}>
|
||||
<h2 className={styles.entityName}>
|
||||
<code>{name}</code>
|
||||
</h2>
|
||||
|
@ -4,7 +4,7 @@ import slugify from 'slugify'
|
||||
import shortid from 'shortid'
|
||||
import Scrollspy from 'react-scrollspy'
|
||||
import Scroll from '../../components/Scroll'
|
||||
import { filterByKindOfProperty } from './utils'
|
||||
// import { filterByKindOfProperty } from './utils'
|
||||
import stylesSidebar from '../../components/Sidebar.module.scss'
|
||||
|
||||
export default class Toc extends PureComponent {
|
||||
@ -14,13 +14,13 @@ export default class Toc extends PureComponent {
|
||||
|
||||
subItems = (children, parentName) =>
|
||||
children &&
|
||||
children.filter(filterByKindOfProperty).map(({ name, decorators }) => {
|
||||
children.map(({ name, decorators }) => {
|
||||
const deprecation = (decorators || []).filter(
|
||||
({ name }) => name === 'deprecated'
|
||||
)[0] // Assuming deprecated annotation
|
||||
|
||||
return (
|
||||
<li key={shortid.generate()}>
|
||||
<li key={name}>
|
||||
<Scroll
|
||||
type="id"
|
||||
element={`${parentName}-${name && slugify(name)}`}
|
||||
@ -39,7 +39,7 @@ export default class Toc extends PureComponent {
|
||||
|
||||
subIds.push(
|
||||
children &&
|
||||
children.filter(filterByKindOfProperty).map(({ name }) => {
|
||||
children.map(({ name }) => {
|
||||
return `${parentName}-${name && slugify(name)}`
|
||||
})
|
||||
)
|
||||
|
@ -8,13 +8,15 @@ import HeaderSection from '../../components/HeaderSection'
|
||||
import Sidebar from '../../components/Sidebar'
|
||||
import DocHeader from '../../components/DocHeader'
|
||||
import Seo from '../../components/Seo'
|
||||
import { cleanTypedocData } from './utils'
|
||||
// import { cleanTypedocData } from './utils'
|
||||
|
||||
import Entities from './Entities'
|
||||
import Toc from './Toc'
|
||||
|
||||
import stylesDoc from '../Doc.module.scss'
|
||||
|
||||
import typedocSpecMock from '../../../ocean.js.json'
|
||||
|
||||
export default class TypedocTemplate extends Component {
|
||||
static propTypes = {
|
||||
data: PropTypes.object.isRequired,
|
||||
@ -22,11 +24,6 @@ export default class TypedocTemplate extends Component {
|
||||
pageContext: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
typedocCleaned = cleanTypedocData(
|
||||
this.props.pageContext.typedoc,
|
||||
this.props.pageContext.classes
|
||||
)
|
||||
|
||||
// output section title as defined in sections.yml
|
||||
sectionTitle = this.props.data.allSectionsYaml.edges.map(({ node }) => {
|
||||
// compare section against section title from sections.yml
|
||||
@ -37,8 +34,8 @@ export default class TypedocTemplate extends Component {
|
||||
|
||||
render() {
|
||||
const { location, pageContext } = this.props
|
||||
const { typedoc } = pageContext
|
||||
const { info } = typedoc
|
||||
// const { typedoc } = pageContext
|
||||
const { info } = typedocSpecMock
|
||||
const { title, description, version, sourceUrl } = info
|
||||
|
||||
return (
|
||||
@ -66,7 +63,7 @@ export default class TypedocTemplate extends Component {
|
||||
sidebar="references"
|
||||
collapsed
|
||||
toc
|
||||
tocComponent={<Toc data={this.typedocCleaned} />}
|
||||
tocComponent={<Toc data={typedocSpecMock.children} />}
|
||||
/>
|
||||
</aside>
|
||||
<article className={stylesDoc.main}>
|
||||
@ -77,7 +74,7 @@ export default class TypedocTemplate extends Component {
|
||||
/>
|
||||
|
||||
<Entities
|
||||
entities={this.typedocCleaned}
|
||||
entities={typedocSpecMock.children}
|
||||
sourceUrl={sourceUrl}
|
||||
/>
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user