-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
154 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/typedoc-plugin-markdown/src/theme/context/helpers/_index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/typedoc-plugin-markdown/src/theme/context/helpers/get-comment-flags.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { camelToTitleCase } from 'libs/utils'; | ||
import { MarkdownThemeContext } from 'theme'; | ||
import { DeclarationReflection, SignatureReflection } from 'typedoc'; | ||
|
||
export function getCommentFlags( | ||
this: MarkdownThemeContext, | ||
reflection: DeclarationReflection | SignatureReflection, | ||
): string[] { | ||
const flagsNotRendered: `@${string}`[] = [ | ||
'@showCategories', | ||
'@showGroups', | ||
'@hideCategories', | ||
'@hideGroups', | ||
]; | ||
const flags: string[] = []; | ||
if (reflection.comment) { | ||
for (const tag of reflection.comment.modifierTags) { | ||
if (!flagsNotRendered.includes(tag)) { | ||
flags.push(camelToTitleCase(tag.substring(1))); | ||
} | ||
} | ||
} | ||
return flags; | ||
} |
44 changes: 26 additions & 18 deletions
44
packages/typedoc-plugin-markdown/src/theme/context/helpers/get-reflection-flags.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import { camelToTitleCase } from 'libs/utils'; | ||
import { backTicks } from 'libs/markdown'; | ||
import { MarkdownThemeContext } from 'theme'; | ||
import { DeclarationReflection, SignatureReflection } from 'typedoc'; | ||
import { ReflectionFlags } from 'typedoc'; | ||
|
||
export function getReflectionFlags( | ||
this: MarkdownThemeContext, | ||
reflection: DeclarationReflection | SignatureReflection, | ||
): string[] { | ||
const flagsNotRendered: `@${string}`[] = [ | ||
'@showCategories', | ||
'@showGroups', | ||
'@hideCategories', | ||
'@hideGroups', | ||
]; | ||
const flags: string[] = []; | ||
if (reflection.comment) { | ||
for (const tag of reflection.comment.modifierTags) { | ||
if (!flagsNotRendered.includes(tag)) { | ||
flags.push(camelToTitleCase(tag.substring(1))); | ||
} | ||
} | ||
reflectionFlags: ReflectionFlags, | ||
): string { | ||
const result: string[] = []; | ||
if (reflectionFlags.isAbstract) { | ||
result.push(backTicks('abstract')); | ||
} | ||
return flags; | ||
if (reflectionFlags.isConst) { | ||
result.push(backTicks('const')); | ||
} | ||
if (reflectionFlags.isPrivate) { | ||
result.push(backTicks('private')); | ||
} | ||
if (reflectionFlags.isProtected) { | ||
result.push(backTicks('protected')); | ||
} | ||
if (reflectionFlags.isReadonly) { | ||
result.push(backTicks('readonly')); | ||
} | ||
if (reflectionFlags.isStatic) { | ||
result.push(backTicks('static')); | ||
} | ||
if (reflectionFlags.isOptional) { | ||
result.push(backTicks('optional')); | ||
} | ||
return result.join(' '); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters