Map all symbols to modules
This commit is contained in:
@@ -14,11 +14,10 @@ info.symbols.forEach(symbol => {
|
|||||||
if (!mod) {
|
if (!mod) {
|
||||||
throw new Error(`No module for symbol ${symbol.name}`);
|
throw new Error(`No module for symbol ${symbol.name}`);
|
||||||
}
|
}
|
||||||
const kind = symbol.kind;
|
if (!mod.symbols) {
|
||||||
if (!mod[kind]) {
|
mod.symbols = [];
|
||||||
mod[kind] = [];
|
|
||||||
}
|
}
|
||||||
mod[kind].push(symbol);
|
mod.symbols.push(symbol);
|
||||||
});
|
});
|
||||||
|
|
||||||
function getModuleName(longname) {
|
function getModuleName(longname) {
|
||||||
@@ -41,7 +40,9 @@ class Docs extends Component {
|
|||||||
<a name={slug} href={`#${slug}`}>
|
<a name={slug} href={`#${slug}`}>
|
||||||
<h1>{getModuleName(mod.name)}</h1>
|
<h1>{getModuleName(mod.name)}</h1>
|
||||||
<h2>Classes</h2>
|
<h2>Classes</h2>
|
||||||
{mod.class.map(cls => this.renderClass(cls, mod))}
|
{mod.symbols
|
||||||
|
.filter(sym => sym.kind === 'class')
|
||||||
|
.map(cls => this.renderClass(cls, mod))}
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@@ -59,7 +60,7 @@ class Docs extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>{modules.filter(mod => !!mod.class).map(this.renderModule)}</div>
|
<div>{modules.filter(mod => !!mod.symbols).map(this.renderModule)}</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user