mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
output all entities in sidebar as menu items
This commit is contained in:
parent
95b1aba1f9
commit
86471beb8d
@ -85,10 +85,11 @@
|
|||||||
.toc {
|
.toc {
|
||||||
ul {
|
ul {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
padding-left: $spacer / 2;
|
border-left: 1px solid $brand-grey-lighter;
|
||||||
margin: 0;
|
margin-left: $spacer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,15 +17,29 @@ const showKindOfProperty = ['Method', 'Property']
|
|||||||
|
|
||||||
const toc = typedoc => {
|
const toc = typedoc => {
|
||||||
const items = typedoc
|
const items = typedoc
|
||||||
.map(
|
.map(({ name, children }) => {
|
||||||
({ name }) => `
|
const parentName = name
|
||||||
|
|
||||||
|
return `
|
||||||
<li>
|
<li>
|
||||||
<a href="#${slugify(name)}"><code>
|
<a href="#${slugify(name)}"><code>
|
||||||
${name}
|
${name}
|
||||||
</code></a>
|
</code></a>
|
||||||
|
<ul>
|
||||||
|
${children
|
||||||
|
.map(
|
||||||
|
({ name }) =>
|
||||||
|
`<li key={name}>
|
||||||
|
<a href="#${parentName}-${slugify(name)}">
|
||||||
|
<code>${name}</code>
|
||||||
|
</a>
|
||||||
|
</li>`
|
||||||
|
)
|
||||||
|
.join('')}
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
`
|
`
|
||||||
)
|
})
|
||||||
.join('')
|
.join('')
|
||||||
|
|
||||||
return `<ul>${items}</ul>`
|
return `<ul>${items}</ul>`
|
||||||
@ -167,7 +181,7 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
id={`${parentAnchor}/${slugify(name)}`}
|
id={`${parentAnchor}-${slugify(name)}`}
|
||||||
className={styles.property}
|
className={styles.property}
|
||||||
data-private={!isPublic}
|
data-private={!isPublic}
|
||||||
data-deprecated={!!deprecation}
|
data-deprecated={!!deprecation}
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
margin-bottom: $spacer;
|
margin-bottom: $spacer;
|
||||||
|
|
||||||
code {
|
code {
|
||||||
// stylelint-disable-next-line
|
// stylelint-disable declaration-no-important
|
||||||
background: none !important;
|
background: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
// stylelint-enable declaration-no-important
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user