Skip to content

Commit

Permalink
feat: Support for @module tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Nov 26, 2020
1 parent ef41514 commit 15cb73c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/lib/converter/plugins/CommentPlugin.ts
Expand Up @@ -226,6 +226,14 @@ export class CommentPlugin extends ConverterComponent {
this.removeExcludedTags(comment);
reflection.comment = comment;
}

if (reflection.kindOf(ReflectionKind.Module)) {
const tag = reflection.comment?.getTag("module");
if (tag) {
reflection.name = tag.text.trim();
removeIfPresent(reflection.comment?.tags, tag);
}
}
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/test/converter/class/clodule-with-subclass.ts
@@ -1,3 +1,8 @@
/**
* @packageDocumentation
* @module clodule
*/

// see https://github.com/TypeStrong/typedoc/issues/869
export class Foo {}
export namespace Foo {
Expand Down
4 changes: 3 additions & 1 deletion src/test/converter/class/specs-with-lump-categories.json
Expand Up @@ -1366,10 +1366,12 @@
},
{
"id": 81,
"name": "clodule-with-subclass",
"name": "clodule",
"kind": 1,
"kindString": "Module",
"flags": {},
"comment": {},
"originalName": "clodule-with-subclass",
"children": [
{
"id": 85,
Expand Down
4 changes: 3 additions & 1 deletion src/test/converter/class/specs.json
Expand Up @@ -1362,10 +1362,12 @@
},
{
"id": 81,
"name": "clodule-with-subclass",
"name": "clodule",
"kind": 1,
"kindString": "Module",
"flags": {},
"comment": {},
"originalName": "clodule-with-subclass",
"children": [
{
"id": 85,
Expand Down

0 comments on commit 15cb73c

Please sign in to comment.