diff --git a/build/jsdocs/plugins/moduleCategories.js b/build/jsdocs/plugins/moduleCategories.js index 93ca5c623..60b657b3a 100644 --- a/build/jsdocs/plugins/moduleCategories.js +++ b/build/jsdocs/plugins/moduleCategories.js @@ -25,7 +25,7 @@ exports.handlers = { e.doclet.modulecategory.className = modulecategory.name; if (!modulecategory.name.startsWith('SuperMap')) { const matchTag = e.doclet.tags.find(tag => tag.title === 'browsernamespace') || {}; - const prefix = matchTag.value || globalParams.namespace; + const prefix = matchTag.value || (globalParams && globalParams.namespace); e.doclet.modulecategory.name = `${prefix}.${modulecategory.name}`; } e.doclet.modulecategory.des = (e.doclet.classdesc || '').split('。')[0].replace('
', '').replace('类', ''); diff --git a/build/jsdocs/template/publish.js b/build/jsdocs/template/publish.js index 03ac220aa..9023a9667 100644 --- a/build/jsdocs/template/publish.js +++ b/build/jsdocs/template/publish.js @@ -250,8 +250,15 @@ function buildNav(members, view, templatePath) { for (const key in view.navMap ) { if (Object.hasOwnProperty.call(view.navMap , key)) { const element = view.navMap[key]; - const m = element.methods.map(e => { - return e.name; + if(element.scope === 'global'){ + element.methods = [element]; + } + const m = element.methods.filter((e)=>{ +return !e.inherited + }).map(e => { + var commentLength = e.comment && !e.meta.range?e.comment.split('\n').length:0; + var funLineNo = e.meta.lineno + commentLength; + return {name:e.name,lineNo:funLineNo,version:e.version || element.version}; }); if(!element.fileName && m.length>0){ console.log("没有文件名的类:", element.longname,element.type,m) @@ -432,7 +439,8 @@ function buildNavMap(members,linkto) { events: find({ kind: 'event', memberof: v.longname - }) + }), + ...v }; } navMap[v.longname] = nav; diff --git a/build/jsdocs/template/tmpl/navigation.tmpl b/build/jsdocs/template/tmpl/navigation.tmpl index 37f0a1eac..6afde0d8b 100644 --- a/build/jsdocs/template/tmpl/navigation.tmpl +++ b/build/jsdocs/template/tmpl/navigation.tmpl @@ -25,6 +25,7 @@ var self = this; //} function build(nav,navOrder,level){ + if(!nav){ return; } @@ -68,6 +69,7 @@ function build(nav,navOrder,level){ } } function buildLi(obj){ + ?>