Skip to content

Commit

Permalink
fix(core): fix missing index descriptions for some signatures (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Sep 1, 2024
1 parent 24ebfbb commit ba8956c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-shirts-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'typedoc-plugin-markdown': patch
---

- Fix missing index descriptions for some signatures (#670)
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './get-angle-bracket';
export * from './get-comment-for-reflection';
export * from './get-comment-parts';
export * from './get-declaration-type';
export * from './get-description-for-comment';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function getGroupIndexTable(
return child.frontmatter.description as string;
}

const comment = this.helpers.getCommentForReflection(child);
const comment = child.comment || child.signatures?.[0]?.comment;

if (!comment) {
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ export const resourceHelpers = (context: MarkdownThemeContext) => {
return {
getAngleBracket: (bracket: '<' | '>') =>
helpers.getAngleBracket.apply(context, [bracket]) as string,
getCommentForReflection: (model: DeclarationReflection) =>
helpers.getCommentForReflection.apply(context, [model]) as
| Comment
| undefined,
getCommentParts: (model: CommentDisplayPart[]) =>
helpers.getCommentParts.apply(context, [model]) as string,
getDeclarationType: (model: DeclarationReflection) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export const basicFunction = (someParam: number) => {
return 0;
};

/**
* This is a function that is assigned to a variable.
*
* @returns This is a return value
*/
export const basicFunctionWithReturns = () => {
return 0;
};

/**
* This is a function with a parameter that has a default value.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4408,6 +4408,11 @@ exports[`Navigation should gets Navigation Json for single entry point: (Output
"kind": 64,
"path": "functions/basicFunction.md"
},
{
"title": "basicFunctionWithReturns",
"kind": 64,
"path": "functions/basicFunctionWithReturns.md"
},
{
"title": "functionReturningAFunction",
"kind": 64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ Module commments
| Function | Description |
| :------ | :------ |
| [basicFunction](functions/basicFunction.md) | This is a function that is assigned to a variable. |
| [basicFunctionWithReturns](functions/basicFunctionWithReturns.md) | This is a function that is assigned to a variable. |
| [functionReturningAFunction](functions/functionReturningAFunction.md) | Comments for function |
| [functionReturningAPromise](functions/functionReturningAPromise.md) | Comments for function |
| [functionReturningAString](functions/functionReturningAString.md) | Comments for function |
| [functionReturningAUnionType](functions/functionReturningAUnionType.md) | Comments for function |
| [functionReturningAnObject](functions/functionReturningAnObject.md) | Comments for function |
| [functionWithComplexParams](functions/functionWithComplexParams.md) | Function with function parmas |
| [functionWithDefaultParameters](functions/functionWithDefaultParameters.md) | This is a function with a parameter that has a default value. |
| [functionWithMultipleSignatures](functions/functionWithMultipleSignatures.md) | This is the first signature of a function with multiple signatures. |
| [functionWithMultipleSignatures](functions/functionWithMultipleSignatures.md) | Main function comment. |
| [functionWithNamedParams](functions/functionWithNamedParams.md) | - |
| [functionWithNestedParameters](functions/functionWithNestedParameters.md) | Some nested params. |
| [functionWithOptionalParameters](functions/functionWithOptionalParameters.md) | This is a function with a parameters. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ exports[`Urls should gets Urls for single entry points: outputFileStrategy: memb
"enumerations/BasicEnum.md",
"enumerations/EnumWithValues.md",
"functions/basicFunction.md",
"functions/basicFunctionWithReturns.md",
"functions/functionReturningAFunction.md",
"functions/functionReturningAPromise.md",
"functions/functionReturningAString.md",
Expand Down Expand Up @@ -881,6 +882,7 @@ exports[`Urls should gets Urls for single entry points: outputFileStrategy: memb
"enumerations/BasicEnum.md",
"enumerations/EnumWithValues.md",
"functions/basicFunction.md",
"functions/basicFunctionWithReturns.md",
"functions/functionReturningAFunction.md",
"functions/functionReturningAPromise.md",
"functions/functionReturningAString.md",
Expand Down

0 comments on commit ba8956c

Please sign in to comment.