1
- import { TSDocParser , type ParserContext , type DocComment , TSDocConfiguration , TSDocTagDefinition , TSDocTagSyntaxKind } from '@microsoft/tsdoc' ;
1
+ import { TSDocParser , type ParserContext , TSDocConfiguration , TSDocTagDefinition , TSDocTagSyntaxKind } from '@microsoft/tsdoc' ;
2
2
import * as path from 'path' ;
3
3
import { readFile } from 'fs/promises' ;
4
- import { FormatterDefault } from './formatter/default .js' ;
4
+ import { FormatterDocPage } from './formatter/doc-page .js' ;
5
5
6
6
/**
7
7
* A class for parsing and rendering TSDoc documentation comments.
@@ -61,18 +61,6 @@ export class DocGen {
61
61
return parserContext ;
62
62
}
63
63
64
- /**
65
- * Renders all documentation nodes from a parsed documentation context.
66
- *
67
- * @param context - The parsed documentation context to render
68
- * @returns A formatted string containing the rendered documentation
69
- */
70
- render ( context : ParserContext ) : string {
71
- const docComment : DocComment = context . docComment ;
72
- const result = FormatterDefault . renderDocNodes ( docComment . getChildNodes ( ) ) ;
73
- return result ;
74
- }
75
-
76
64
/**
77
65
* Renders only the custom documentation blocks from a parsed documentation context.
78
66
* This specifically focuses on rendering blocks marked with custom tags like @demo.
@@ -85,8 +73,7 @@ export class DocGen {
85
73
if ( ! context || ! context . docComment ) {
86
74
throw new Error ( 'Invalid parser context: docComment is undefined' ) ;
87
75
}
88
- const docComment : DocComment = context . docComment ;
89
- const result = FormatterDefault . renderDocNodes ( docComment . customBlocks ) ;
90
- return result ;
76
+ const formatter = new FormatterDocPage ( context ) ;
77
+ return formatter . createDocPage ( ) ;
91
78
}
92
79
}
0 commit comments