Improve d.ts comments generation

- Remove " - " after @param paramname, and @return because it is
useless.
- Improve alignement of multiline param comments.
This commit is contained in:
vulvulune 2015-01-21 08:50:14 +01:00
parent af41e9919f
commit a5fde63486
3 changed files with 4320 additions and 4299 deletions

View file

@ -121,7 +121,15 @@ var TypeScriptDocGenerator = (function () {
if ((p.default != null) && (p.default !== "")) {
def = " - Default: " + p.default;
}
comments.push("@param " + p.name + " - " + p.description + def);
var paramComments = p.description.split("\n");
for (var k = 0; k < paramComments.length; k++) {
if (k === 0) {
comments.push("@param " + p.name + " " + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
}
else {
comments.push(this.repeatSpaces(("@param " + p.name + " ").length) + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
}
}
}
return comments;
}
@ -149,10 +157,23 @@ var TypeScriptDocGenerator = (function () {
if ((p.default != null) && (p.default !== "")) {
def = " - Default: " + p.default;
}
comments.push("@param " + p.name + " - " + p.description + def);
var paramComments = p.description.split("\n");
for (var k = 0; k < paramComments.length; k++)
{
if (k === 0)
{
comments.push("@param " + p.name + " " + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
}
else
{
comments.push(this.repeatSpaces(("@param " + p.name + " ").length) + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
}
}
}
if (f.returns != null) {
comments.push("@return - " + f.returns.description);
comments.push("@return " + f.returns.description);
}
return comments;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff