Skip to content

Commit b7d9f7f

Browse files
committed
Merge branch 'main' into rss1102/ci/release-workflow
2 parents 4028542 + ee4c976 commit b7d9f7f

2 files changed

Lines changed: 9 additions & 21 deletions

File tree

lib/component_rule.dart

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff 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');

lib/smart_create.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)