File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,18 +301,9 @@ class ComponentVisitor extends RecursiveElementVisitor<void> {
301301 ComponentInfo parseBaseInfo (ClassElement element) {
302302 ComponentInfo componentInfo = ComponentInfo ();
303303 componentInfo.name = element.displayName;
304- List <String > comments = [];
305304 if (element.documentationComment != null ) {
306- comments = element.documentationComment! .split ('///' );
307- }
308- for (final String item in comments) {
309- if (item.trim ().isNotEmpty) {
310- // print('注解:$item');
311- if (componentInfo.introduction! .isNotEmpty) {
312- componentInfo.introduction = '${componentInfo .introduction } \n ' ;
313- }
314- componentInfo.introduction = '${componentInfo .introduction }${item .trim ()}' ;
315- }
305+ componentInfo.introduction = removeDocumentationComment (
306+ element.documentationComment! );
316307 }
317308 // print('\n组件基本信息:');
318309 // print('$componentInfo');
Original file line number Diff line number Diff line change @@ -244,16 +244,13 @@ class SmartCreator {
244244## API''' ;
245245 StringBuffer sb = StringBuffer (fileContent);
246246 for (final apiInfo in parsedComponentInfoList) {
247- if (parsedComponentInfoList.length > 0 ) {
248- sb.write ('\n ' );
249- if (parsedComponentInfoList.indexOf (apiInfo) >= 1 ) {
250- sb.write ('''```\n ```\n\n ''' );
251- }
252- sb.write ('### ${apiInfo .componentInfo !.name }' );
253- if (commandInfo? .isGetComments ?? false ) {
254- sb.write ('\n #### 简介\n ' );
255- sb.write ('${apiInfo .componentInfo !.introduction }' );
256- }
247+ if (parsedComponentInfoList.length > 1 && parsedComponentInfoList.indexOf (apiInfo) >= 1 ) {
248+ sb.write ('\n\n ' );
249+ }
250+ sb.write ('### ${apiInfo .componentInfo !.name }' );
251+ if (commandInfo? .isGetComments ?? false ) {
252+ sb.write ('\n #### 简介\n ' );
253+ sb.write ('${apiInfo .componentInfo !.introduction }' );
257254 }
258255 if (apiInfo.propertyList.isNotEmpty) {
259256
You can’t perform that action at this time.
0 commit comments