Skip to content

Commit ef0a24e

Browse files
committed
【doc】优化doc打包
1 parent 3f7deb0 commit ef0a24e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

build/jsdocs/template/publish.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function attachModuleSymbols(doclets, modules) {
243243
function buildNav(members, view, templatePath) {
244244
var sorted = sortNav(members);
245245
view.categories = buildCategories(sorted, templatePath);
246-
view.navMap = buildNavMap(sorted);
246+
view.navMap = buildNavMap(sorted,view.linkto);
247247
}
248248

249249
function sortNav(members) {
@@ -291,7 +291,7 @@ function buildCategories(members, templatePath) {
291291
* @param {array<object>} members.events
292292
* @return {string} The HTML for the navigation sidebar.
293293
*/
294-
function buildNavMap(members) {
294+
function buildNavMap(members,linkto) {
295295
this.navMap = {};
296296
_.each(members, function (v) {
297297
var nav;
@@ -320,6 +320,7 @@ function buildNavMap(members) {
320320
};
321321
} else if (v.kind == 'class') {
322322
nav = {
323+
fileName:linkto(v.meta.filename),
323324
type: 'class',
324325
longname: v.longname,
325326
name: v.name,

build/jsdocs/template/tmpl/navigation.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function build(nav,navOrder,level){
6969
}
7070
function buildLi(obj){
7171
?>
72-
<li class="item" data-name="<?js= obj.longname ?>">
72+
<li class="item" file-name="<?js= obj.fileName ?>" data-name="<?js= obj.longname ?>">
7373
<span class="title" title="<?js= obj.longname ?>">
7474
<?js= self.linkto(obj.longname, obj.longname) ?>
7575
</span>

0 commit comments

Comments
 (0)