1
0
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:
Matthias Kretschmann 2019-01-22 15:36:59 +01:00
parent 95b1aba1f9
commit 86471beb8d
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 24 additions and 7 deletions

View File

@ -85,10 +85,11 @@
.toc {
ul {
padding-left: 0;
margin: 0;
ul {
padding-left: $spacer / 2;
margin: 0;
border-left: 1px solid $brand-grey-lighter;
margin-left: $spacer;
}
}

View File

@ -17,15 +17,29 @@ const showKindOfProperty = ['Method', 'Property']
const toc = typedoc => {
const items = typedoc
.map(
({ name }) => `
.map(({ name, children }) => {
const parentName = name
return `
<li>
<a href="#${slugify(name)}"><code>
${name}
</code></a>
<ul>
${children
.map(
({ name }) =>
`<li key={name}>
<a href="#${parentName}-${slugify(name)}">
<code>${name}</code>
</a>
</li>`
)
.join('')}
</ul>
</li>
`
)
})
.join('')
return `<ul>${items}</ul>`
@ -167,7 +181,7 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
return (
<div
id={`${parentAnchor}/${slugify(name)}`}
id={`${parentAnchor}-${slugify(name)}`}
className={styles.property}
data-private={!isPublic}
data-deprecated={!!deprecation}

View File

@ -14,8 +14,10 @@
margin-bottom: $spacer;
code {
// stylelint-disable-next-line
// stylelint-disable declaration-no-important
background: none !important;
padding: 0 !important;
// stylelint-enable declaration-no-important
}
}