Open vthierry opened 1 year ago
Hello @instance defines its own scope, so most probably you need to define where that scope should appear, like global other than that instance is not related to class (so it is not a method or property, etc) so it would not appear in the class definitions
Thanks for your prompt and helpful comment, yes i must define the scope, which i expect to have done with the @memberof tag, for instance : /**
@description Returns the value as a wJSON string. */ appears both in the doc page and in the left menu whereas a member variable does appear in the doc page only unless i tag it as @global or @static which then appears in the menu but not at the right place or not with the proper documentation tag, because it is not the case here. I also tried @inner which has the same behavior as @instance (adding (inner) in the doc of course), i also tried to replace @member with @var which are synonyms thus same effect.
Best regards.
Hmm, that is true if I use example from JSDoc: https://jsdoc.app/tags-memberof.html
/** @class Observable */
create(
'Observable',
{
/**
* This will be a static member, Observable.cache.
* @memberof Observable
*/
cache: [],
/**
* This will be an instance member, Observable#publish.
* @memberof Observable.prototype
*/
publish: function(msg) {},
/**
* This will also be an instance member, Observable#save.
* @memberof Observable#
*/
save: function() {},
/**
* This will also be an instance member, Observable#end.
* @memberof Observable
* @instance
*/
end: function() {}
}
);
It correctly adds method end:
Oh yes as static members it works, i also confirm.
The caveat id for an instance member.
Nevertheless thanks a lot i will further investigate …
Best regards.
you can try this: 1.set docdash in your jsdoc.json
"docdash": {
"search": true,
"collapse": false,
"sort":false,
"static":true
}
open the node_modules/docdash/publish.js, find the line No.362, and change the code。
if (docdash.static && members.find(function (m) { return (m.scope === 'static'||m.scope==='instance'); } )) {
itemsNav += "<ul class='members'>";
itemsNav+="<span style='font-weight:bold;font-size:12px'>└ Members</span>"
members.forEach(function (member) {
// if (!member.scope === 'static') return;
itemsNav += "<li data-type='member'";
if(docdash.collapse)
itemsNav += " style='display: none;'";
itemsNav += ">";
if(member.scope==='static'){
itemsNav += linkto(member.longname, '[static] '+member.name);
}else{
itemsNav += linkto(member.longname, member.name);
}
itemsNav += "</li>";
});
itemsNav += "</ul>";
}
if (methods.length) { itemsNav += "
itemsNav+="└ Methods"
methods.forEach(function (method) { if (docdash.static === false && method.scope === 'static') return; if (docdash.private === false && method.access === 'private') return; var navItem = ''; var navItemLink if(method.scope==='static'){ navItemLink=linkto(method.longname, '[static] '+method.name); }else{ navItemLink=linkto(method.longname, method.name); }
navItem += "<li data-type='method'";
if(docdash.collapse)
navItem += " style='display: none;'";
navItem += ">";
navItem += navItemLink;
navItem += "</li>";
itemsNav += navItem;
});
itemsNav += ""; }
![001](https://user-images.githubusercontent.com/16486126/211549777-874db128-a0cd-4a36-aae3-052a6f386604.png)
![002](https://user-images.githubusercontent.com/16486126/211549814-97a5d096-7ad1-4552-9307-8653fabfb235.png)
Dear, Oh thank you very much this is very kind, I'll do that Huge thanks.
-- Thierry Viéville http://www-sop.inria.fr/members/Thierry.Vieville Tel: +(33)613286459
De: "闪刀浪子" @.> À: "clenemt/docdash" @.> Cc: "Thierry Vieville" @.>, "Author" @.> Envoyé: Mardi 10 Janvier 2023 13:21:10 Objet: Re: [clenemt/docdash] instance member in menu (Issue #112)
you can try this: 1.set docdash in your jsdoc.json "docdash": {
"search": true, "collapse": false, "sort":false, "static":true
}
- ";
open the node_modules/docdash/publish.js, find the line No.362, and change the code。 if (docdash.static && members.find(function (m) { return (m.scope === 'static'||m.scope==='instance'); } )) {
itemsNav += "
";
itemsNav+="└ Members"
members.forEach(function (member) {
// if (!member.scope === 'static') return;
itemsNav += "<li data-type='member'";
if(docdash.collapse)
itemsNav += " style='display: none;'";
itemsNav += ">";
if(member.scope==='static'){
itemsNav += linkto(member.longname, '[static] '+member.name);
}else{
itemsNav += linkto(member.longname, member.name);
}
itemsNav += "
});
itemsNav += "";
}
if (methods.length) {
itemsNav += "
";
itemsNav+="└ Methods"
methods.forEach(function (method) {
if (docdash.static === false && method.scope === 'static') return; if (docdash.private === false && method.access === 'private') return; var navItem = ''; var navItemLink if(method.scope==='static'){ navItemLink=linkto(method.longname, '[static] '+method.name); }else{ navItemLink=linkto(method.longname, method.name); } navItem += "<li data-type='method'"; if(docdash.collapse) navItem += " style='display: none;'"; navItem += ">"; navItem += navItemLink; navItem += "</li>"; itemsNav += navItem;
});
itemsNav += "";
}
— Reply to this email directly, [ https://github.com/clenemt/docdash/issues/112#issuecomment-1377180993 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AAOVM2YALDHEIOEWHB6YP6LWRVH3NANCNFSM6AAAAAASKQF4FI | unsubscribe ] . You are receiving this because you authored the thread. Message ID: @.***>
Dear dacdosh developers, This is beautiful tool, thank you !
My question: when i document an instance member, e.g., /**