File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 3
3
### Features
4
4
5
5
- Added support for ` *.ghe.com ` and ` *.github.us ` GitHub enterprise domains for source links, #2001 .
6
+ - Expose ` Converter.parseRawComment ` for plugins to parse additional markdown files, #2004 .
6
7
7
8
### Thanks!
8
9
Original file line number Diff line number Diff line change @@ -183,6 +183,18 @@ export class Converter extends ChildableComponent<
183
183
return convertType ( context , node ) ;
184
184
}
185
185
186
+ /**
187
+ * Parse the given file into a comment. Intended to be used with markdown files.
188
+ */
189
+ parseRawComment ( file : MinimalSourceFile ) {
190
+ return parseComment (
191
+ lexCommentString ( file . text ) ,
192
+ this . config ,
193
+ file ,
194
+ this . application . logger
195
+ ) ;
196
+ }
197
+
186
198
/**
187
199
* Compile the files within the given context and convert the compiler symbols to reflections.
188
200
*
@@ -264,11 +276,8 @@ export class Converter extends ChildableComponent<
264
276
265
277
if ( entryPoint . readmeFile ) {
266
278
const readme = readFile ( entryPoint . readmeFile ) ;
267
- const comment = parseComment (
268
- lexCommentString ( readme ) ,
269
- context . converter . config ,
270
- new MinimalSourceFile ( readme , entryPoint . readmeFile ) ,
271
- context . logger
279
+ const comment = this . parseRawComment (
280
+ new MinimalSourceFile ( readme , entryPoint . readmeFile )
272
281
) ;
273
282
274
283
if ( comment . blockTags . length || comment . modifierTags . size ) {
Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import type { Context } from "../context";
7
7
import { BindOption , EntryPointStrategy , readFile } from "../../utils" ;
8
8
import { getCommonDirectory } from "../../utils/fs" ;
9
9
import { nicePath } from "../../utils/paths" ;
10
- import { lexCommentString } from "../comments/rawLexer" ;
11
- import { parseComment } from "../comments/parser" ;
12
10
import { MinimalSourceFile } from "../../utils/minimalSourceFile" ;
13
11
14
12
/**
@@ -105,11 +103,8 @@ export class PackagePlugin extends ConverterComponent {
105
103
const project = context . project ;
106
104
if ( this . readmeFile ) {
107
105
const readme = readFile ( this . readmeFile ) ;
108
- const comment = parseComment (
109
- lexCommentString ( readme ) ,
110
- context . converter . config ,
111
- new MinimalSourceFile ( readme , this . readmeFile ) ,
112
- context . logger
106
+ const comment = context . converter . parseRawComment (
107
+ new MinimalSourceFile ( readme , this . readmeFile )
113
108
) ;
114
109
115
110
if ( comment . blockTags . length || comment . modifierTags . size ) {
You can’t perform that action at this time.
0 commit comments