Skip to content

Commit

Permalink
Add quality and value to calc doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vetlek committed Sep 25, 2023
1 parent 6d73d22 commit c184d1b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions server/src/septic/docFormatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,27 @@ export function formatCalcMarkdown(
calc: SepticCalcInfo,
short: boolean = false
) {
let formattedParameters = calc.parameters.map((param) => {
return formatCalcParameter(param);
});
let markdown = [
"```js\n" + `function ${calc.signature}` + "\n```",
horizontalRule(),
`${calc.briefDescription.replace(/\r\n/g, "\n")}`,
`${calc.detailedDescription.replace(/\r\n/g, "\n")}`,
];

let formattedParameters = calc.parameters.map((param) => {
return formatCalcParameter(param);
});
if (formattedParameters.length) {
markdown.push(
"\n```\n" + formattedParameters[0],
"```\n" + formattedParameters[0],
...formattedParameters.slice(1),
`@return - ${calc.retr}` + "\n```\n"
"\n```"
);
}

if (!short) {
markdown.push(calc.detailedDescription.replace(/\r\n/g, "\n"));
}
markdown.push(
"```\n" + `@return - ${calc.retr}`,
`@value - ${calc.value}`,
`@quality - ${calc.quality}` + "\n```"
);

return markdown.join("\n\n");
}
Expand Down

0 comments on commit c184d1b

Please sign in to comment.