tui.jsdoc-template
tui.jsdoc-template copied to clipboard
Change style of opt Param indicator
I think it's not the best idea if the indicator for the optional parameters have the same style as the parameter name.
In this example the 3rd parameter is optional and names oOptions
but because its optional the added opt
is confusing:
Yeah, I totally agree. A whole new design coming soon! Thanks!
+1
Hi, @minkyu-yi Any news regarding this issue? (and regarding the new design you mentioned?)
@yo35 fork the repo and go to publish.js and replace function getSignatureAttributes(item) with:
function getSignatureAttributes(item) {
var attributes = [];
if (item.optional) {
//or whatever string works for you
attributes.push(' *optional* ');
}
if (item.nullable === true) {
attributes.push('nullable');
}
else if (item.nullable === false) {
attributes.push('non-null');
}
return attributes;
}
@akoumari In my opinion, it would be better to fix function updateItemName
:
function updateItemName(item) {
var attributes = getSignatureAttributes(item);
var itemName = item.name || '';
if (item.variable) {
itemName = '…' + itemName;
}
if (attributes && attributes.length) {
itemName = util.format( '%s <span class="signature-attributes">%s</span>', itemName, attributes.join(', ') );
// instead of: ... '%s<span class="signature-attributes">%s</span>' ...
}
return itemName;
}
(this fixes the issue for all attributes, not only optional
)
Additionally, it might be relevant to customize the font for the signature attributes, so that those attributes could be easily distinguish from the parameter names.
@yo35 Ohh yeah! I was just going for the low hanging fix but this significantly better.
sorry. I'm not an maintainer at this time 😢. This repository is managed by nhn corp.