Change prettyname of classes

Now also includes the class name if it is different than its module name.
`ol/source/Vector` -> `ol/source/Vector~VectorSource`.
This commit is contained in:
Maximilian Krög
2020-02-09 17:19:11 +01:00
parent 7640bcd163
commit 8b857eed26

View File

@@ -189,9 +189,15 @@ function attachModuleSymbols(doclets, modules) {
}
function getPrettyName(longname) {
return longname
.split('~')[0]
.replace('module:', '');
const fullname = longname.replace('module:', '');
const parts = fullname.split(/[~\.]/);
if (parts.length > 1) {
const pathParts = parts[0].split('/');
if (parts[parts.length - 1] === pathParts[pathParts.length - 1]) {
return parts[0];
}
}
return fullname;
}
/**