chore(doc-gen): render enum doctypes correctly
This commit is contained in:
parent
106a28b8dc
commit
c4296285f3
|
@ -0,0 +1 @@
|
||||||
|
{% extends 'class.template.html' -%}
|
|
@ -63,10 +63,11 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||||
var exportDoc = createExportDoc(exportSymbol.name, resolvedExport, moduleDoc, basePath, parseInfo.typeChecker);
|
var exportDoc = createExportDoc(exportSymbol.name, resolvedExport, moduleDoc, basePath, parseInfo.typeChecker);
|
||||||
log.debug('>>>> EXPORT: ' + exportDoc.name + ' (' + exportDoc.docType + ') from ' + moduleDoc.id);
|
log.debug('>>>> EXPORT: ' + exportDoc.name + ' (' + exportDoc.docType + ') from ' + moduleDoc.id);
|
||||||
|
|
||||||
|
exportDoc.members = [];
|
||||||
|
|
||||||
// Generate docs for each of the export's members
|
// Generate docs for each of the export's members
|
||||||
if (resolvedExport.flags & ts.SymbolFlags.HasMembers) {
|
if (resolvedExport.flags & ts.SymbolFlags.HasMembers) {
|
||||||
|
|
||||||
exportDoc.members = [];
|
|
||||||
for(var memberName in resolvedExport.members) {
|
for(var memberName in resolvedExport.members) {
|
||||||
// FIXME(alexeagle): why do generic type params appear in members?
|
// FIXME(alexeagle): why do generic type params appear in members?
|
||||||
if (memberName === 'T') {
|
if (memberName === 'T') {
|
||||||
|
@ -91,6 +92,17 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||||
exportDoc.newMember = memberDoc;
|
exportDoc.newMember = memberDoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exportDoc.docType === 'enum') {
|
||||||
|
for(var memberName in resolvedExport.exports) {
|
||||||
|
log.silly('>>>>>> member: ' + memberName + ' from ' + exportDoc.id + ' in ' + moduleDoc.id);
|
||||||
|
var memberSymbol = resolvedExport.exports[memberName];
|
||||||
|
var memberDoc = createMemberDoc(memberSymbol, exportDoc, basePath, parseInfo.typeChecker);
|
||||||
|
docs.push(memberDoc);
|
||||||
|
exportDoc.members.push(memberDoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sortClassMembers) {
|
if (sortClassMembers) {
|
||||||
exportDoc.members.sort(function(a, b) {
|
exportDoc.members.sort(function(a, b) {
|
||||||
|
@ -99,14 +111,6 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (exportDoc.docType == 'enum') {
|
|
||||||
exportDoc.members = [];
|
|
||||||
for (var etype in resolvedExport.exports) {
|
|
||||||
exportDoc.members.push(etype);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add this export doc to its module doc
|
// Add this export doc to its module doc
|
||||||
moduleDoc.exports.push(exportDoc);
|
moduleDoc.exports.push(exportDoc);
|
||||||
|
|
Loading…
Reference in New Issue