From 2a39daaea0500ae2af0866b1a19b1a599bdfec78 Mon Sep 17 00:00:00 2001 From: chenjiafeng-opneharmony Date: Tue, 23 Sep 2025 22:20:52 +0800 Subject: [PATCH] add editor_02 --- richEditor/editor_02.md | 2 + richEditor/interface/getTitle.py | 82 +++++++ .../interface/test-getTitle-RichEditor.md | 215 ++++++++++++++++++ richEditor/interface/test-getTitle-Search.md | 106 +++++++++ richEditor/interface/test-getTitle-Text.md | 101 ++++++++ .../interface/test-getTitle-TextArea.md | 112 +++++++++ .../interface/test-getTitle-TextInput.md | 142 ++++++++++++ 7 files changed, 760 insertions(+) create mode 100644 richEditor/editor_02.md create mode 100644 richEditor/interface/getTitle.py create mode 100644 richEditor/interface/test-getTitle-RichEditor.md create mode 100644 richEditor/interface/test-getTitle-Search.md create mode 100644 richEditor/interface/test-getTitle-Text.md create mode 100644 richEditor/interface/test-getTitle-TextArea.md create mode 100644 richEditor/interface/test-getTitle-TextInput.md diff --git a/richEditor/editor_02.md b/richEditor/editor_02.md new file mode 100644 index 0000000..4901d99 --- /dev/null +++ b/richEditor/editor_02.md @@ -0,0 +1,2 @@ +# 输入框样式介绍 + diff --git a/richEditor/interface/getTitle.py b/richEditor/interface/getTitle.py new file mode 100644 index 0000000..93c0f82 --- /dev/null +++ b/richEditor/interface/getTitle.py @@ -0,0 +1,82 @@ +import re +import os + +def extract_headers_from_markdown(input_file, output_file=None): + """ + 从Markdown文件中提取以##和###开头的标题,保持二级标题原有顺序,三级标题按字母顺序排序 + + Args: + input_file (str): 输入的Markdown文件路径 + output_file (str): 输出文件路径,如果未提供则根据一级标题自动生成 + """ + # 存储一级标题 + level1_header = "" + # 存储二级标题和其下的三级标题 + headers_dict = {} + # 存储二级标题的顺序 + level2_order = [] + current_level2_header = None + + # 读取输入文件 + with open(input_file, 'r', encoding='utf-8') as f: + for line in f: + # 检查是否以#开头的一级标题 + if line.strip().startswith('# ') and not line.strip().startswith('##'): + if not level1_header: # 只获取第一个一级标题 + # 提取一级标题文本,去除标签及其内容 + header_text = line.strip()[2:].strip() + header_text = re.sub(r'.*?', '', header_text) + level1_header = header_text + + # 检查是否以##开头的二级标题 + elif line.strip().startswith('## ') and not line.strip().startswith('###'): + # 提取二级标题文本,去除标签及其内容 + header_text = line.strip()[3:].strip() + header_text = re.sub(r'.*?', '', header_text) + current_level2_header = header_text + # 记录二级标题顺序 + if current_level2_header not in level2_order: + level2_order.append(current_level2_header) + # 初始化该二级标题下的三级标题列表 + headers_dict[current_level2_header] = [] + + # 检查是否以###开头的三级标题 + elif line.strip().startswith('### '): + if current_level2_header is not None: + # 提取三级标题文本,去除标签及其内容 + header_text = line.strip()[4:].strip() + header_text = re.sub(r'.*?', '', header_text) + # 添加到当前二级标题的列表中 + headers_dict[current_level2_header].append(header_text) + + # 对每个二级标题下的三级标题按字母顺序排序 + for level2_header in headers_dict: + headers_dict[level2_header].sort() + + # 如果未指定输出文件名,则根据一级标题生成 + if output_file is None: + if level1_header: + # 清理文件名中的非法字符 + safe_header = re.sub(r'[<>:"/\\|?*]', '', level1_header) + output_file = f"test-getTitle-{safe_header}.md" + else: + output_file = "test-getTitle-output.md" + + # 写入输出文件,保持二级标题原有顺序 + with open(output_file, 'w', encoding='utf-8') as f: + for level2_header in level2_order: + # 写入二级标题,保留##符号 + f.write('## ' + level2_header + '\n') + # 写入排序后的三级标题,不保留###符号 + for level3_header in headers_dict.get(level2_header, []): + f.write(level3_header + '\n') + # 在每个二级标题组后添加空行以分隔 + f.write('\n') + + print(f"已成功处理标题并保存到 {output_file}") + return output_file + +# 使用示例 +if __name__ == "__main__": + input_file = "zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md" + output_file = extract_headers_from_markdown(input_file) \ No newline at end of file diff --git a/richEditor/interface/test-getTitle-RichEditor.md b/richEditor/interface/test-getTitle-RichEditor.md new file mode 100644 index 0000000..603a6c4 --- /dev/null +++ b/richEditor/interface/test-getTitle-RichEditor.md @@ -0,0 +1,215 @@ +## 子组件 + +## 接口 +RichEditor +RichEditor + +## 属性 +barState +bindSelectionMenu +caretColor +copyOptions +customKeyboard +dataDetectorConfig +editMenuOptions +enableAutoSpacing +enableDataDetector +enableHapticFeedback +enableKeyboardOnFocus +enablePreviewText +enterKeyType +keyboardAppearance +maxLength +maxLines +placeholder +scrollBarColor +selectedBackgroundColor +stopBackPress +undoStyle + +## 事件 +aboutToDelete +aboutToIMEInput +onCopy +onCut +onDeleteComplete +onDidChange +onDidIMEInput +onEditingChange +onIMEInputComplete +onPaste +onReady +onSelect +onSelectionChange +onSubmit +onWillChange + +## RichEditorInsertValue + +## RichEditorDeleteValue + +## RichEditorDeleteDirection + +## RichEditorTextSpanResult + +## RichEditorSpanPosition + +## RichEditorSpanType + +## RichEditorResponseType + +## UndoStyle + +## RichEditorTextStyleResult + +## RichEditorSymbolSpanStyleResult + +## RichEditorImageSpanResult + +## RichEditorImageSpanStyleResult + +## RichEditorLayoutStyle + +## RichEditorOptions + +## RichEditorStyledStringOptions + +## RichEditorChangeValue + +## RichEditorBaseController +closeSelectionMenu +getCaretOffset +getCaretRect +getLayoutManager +getPreviewText +getTypingStyle +isEditing +setCaretOffset +setSelection +setTypingParagraphStyle +setTypingStyle +stopEditing + +## RichEditorController +addBuilderSpan +addImageSpan +addSymbolSpan +addTextSpan +deleteSpans +fromStyledString +getParagraphs +getSelection +getSpans +toStyledString +updateParagraphStyle +updateSpanStyle +导入对象 + +## RichEditorStyledStringController +getSelection +getStyledString +onContentChanged +setStyledString +导入对象 + +## RichEditorSelection + +## RichEditorRange + +## RichEditorSpanStyleOptions + +## RichEditorUpdateTextSpanStyleOptions + +## RichEditorUpdateImageSpanStyleOptions + +## RichEditorUpdateSymbolSpanStyleOptions + +## RichEditorParagraphStyleOptions + +## RichEditorParagraphStyle + +## LeadingMarginPlaceholder + +## RichEditorParagraphResult + +## RichEditorTextSpanOptions + +## RichEditorTextStyle + +## PlaceholderStyle + +## RichEditorImageSpanOptions + +## RichEditorImageSpanStyle + +## RichEditorSymbolSpanOptions + +## RichEditorSymbolSpanStyle + +## RichEditorBuilderSpanOptions + +## RichEditorSpan + +## SelectionMenuOptions + +## PreviewMenuOptions + +## PasteEvent + +## CutEvent + +## CopyEvent + +## RichEditorGesture + +## KeyboardOptions + +## SubmitCallback + +## MenuOnAppearCallback + +## MenuCallback + +## PasteEventCallback + +## OnHoverCallback + +## RichEditorTextSpan + +## RichEditorImageSpan + +## RichEditorUrlStyle + +## 示例 +示例10(使用和管理组件内的BuilderSpan) +示例11(设置文本识别配置) +示例12(设置光标、手柄和底板颜色) +示例13(设置行高和字符间距) +示例14(自定义粘贴事件) +示例15(配置文字特性效果) +示例16(自定义键盘避让) +示例17(查看编辑状态) +示例18(配置文本变化回调) +示例19(配置输入法enter键功能) +示例1(更新文本样式) +示例20(设置段落折行规则) +示例21(属性字符串基本功能) +示例22(获取布局信息) +示例23(设置系统默认菜单扩展项) +示例24(组件部分常用属性) +示例25(获取光标相对组件位置的矩形) +示例26(设置最大行数和最大字符数) +示例27(文本设置Url样式) +示例28(开启带样式的撤销还原能力) +示例29(文本设置预设段落样式) +示例2(绑定自定义键盘) +示例30(设置装饰线粗细和多装饰线) +示例31(设置开启中西文自动间距) +示例3(绑定自定义菜单) +示例4(更新图片样式) +示例5(Span绑定手势事件) +示例6(更新和获取段落样式) +示例7(更新预设样式与缩进) +示例8(设置文本字重与阴影) +示例9(添加用户自定义布局Span) + diff --git a/richEditor/interface/test-getTitle-Search.md b/richEditor/interface/test-getTitle-Search.md new file mode 100644 index 0000000..15b243c --- /dev/null +++ b/richEditor/interface/test-getTitle-Search.md @@ -0,0 +1,106 @@ +## 子组件 + +## 接口 + +## SearchOptions对象说明 + +## 属性 +autoCapitalizationMode +cancelButton +caretStyle +copyOption +customKeyboard +decoration +editMenuOptions +enableAutoSpacing +enableHapticFeedback +enableKeyboardOnFocus +enablePreviewText +enterKeyType +fontColor +fontFeature +halfLeading +inputFilter +keyboardAppearance +letterSpacing +lineHeight +maxFontScale +maxFontSize +maxLength +minFontScale +minFontSize +placeholderColor +placeholderFont +searchButton +searchIcon +selectedBackgroundColor +selectionMenuHidden +stopBackPress +strokeColor +strokeWidth +textAlign +textFont +textIndent +type + +## IconOptions对象说明 + +## SearchButtonOptions对象说明 + +## CancelButtonStyle枚举说明 + +## SearchType枚举说明 + +## CancelButtonOptions对象说明 + +## CancelButtonSymbolOptions对象说明 + +## 事件 +onChange +onContentScroll +onCopy +onCut +onDidDelete +onDidInsert +onEditChange +onPaste +onSubmit +onSubmit +onTextSelectionChange +onWillAttachIME +onWillChange +onWillDelete +onWillInsert + +## SearchController +caretPosition +constructor +setTextSelection +stopEditing +导入对象 + +## SearchSubmitCallback + +## 示例 +示例10(文本扩展自定义菜单) +示例11(设置symbol类型清除按钮) +示例12(设置文本是否可复制) +示例13(设置文本水平对齐/光标样式/选中背景色) +示例14(设置默认获焦并拉起软键盘) +示例15(关闭系统文本选择菜单) +示例16(对输入的文本进行过滤) +示例17(设置选中指定区域的文本内容) +示例18(设置文本滚动事件) +示例19(设置最小字体范围与最大字体范围) +示例1(设置与获取光标位置) +示例20(设置文本描边) +示例21(设置中西文自动间距) +示例2(设置搜索和删除图标) +示例3(设置自定义键盘) +示例4(设置输入法回车键类型) +示例5(设置文本样式) +示例6(设置文字特性效果) +示例7(自定义键盘避让) +示例8(设置文本自适应) +示例9(支持插入和删除回调) + diff --git a/richEditor/interface/test-getTitle-Text.md b/richEditor/interface/test-getTitle-Text.md new file mode 100644 index 0000000..b286636 --- /dev/null +++ b/richEditor/interface/test-getTitle-Text.md @@ -0,0 +1,101 @@ +## 子组件 + +## 接口 + +## 属性 +baselineOffset +bindSelectionMenu +caretColor +contentTransition +copyOption +dataDetectorConfig +decoration +draggable +editMenuOptions +ellipsisMode +enableAutoSpacing +enableDataDetector +enableHapticFeedback +font +font +fontColor +fontFamily +fontFeature +fontSize +fontStyle +fontWeight +fontWeight +halfLeading +heightAdaptivePolicy +letterSpacing +lineBreakStrategy +lineHeight +lineSpacing +lineSpacing +marqueeOptions +maxFontScale +maxFontSize +maxLines +minFontScale +minFontSize +optimizeTrailingSpace +privacySensitive +selectedBackgroundColor +selection +shaderStyle +textAlign +textCase +textContentAlign +textIndent +textOverflow +textSelectable +textShadow +textVerticalAlign +wordBreak + +## TextSpanType枚举说明 + +## TextResponseType枚举说明 + +## TextOverflowOptions对象说明 + +## 事件 +onCopy +onMarqueeStateChange +onTextSelectionChange + +## TextOptions + +## TextController +closeSelectionMenu +getLayoutManager +setStyledString +导入对象 + +## TextMarqueeOptions对象说明 + +## MarqueeStartPolicy枚举说明 + +## MarqueeState枚举说明 + +## 示例 +示例10(获取文本信息) +示例11(实现键盘框选文本) +示例12(文本扩展自定义菜单) +示例13(配置隐私隐藏) +示例14(设置中西文自动间距) +示例15(文本颜色按线性或径向渐变) +示例16(配置除去行尾空格) +示例17(文本垂直对齐) +示例18(文本翻牌动效) +示例19(文本内容区垂直对齐) +示例1(设置文本布局) +示例2(设置文本样式) +示例3(设置文本超长省略) +示例4(设置文本断行及折行) +示例5(设置文本选中和复制) +示例6(设置文本自适应和缩放倍数限制范围) +示例7(设置文本识别) +示例8(文本绑定自定义菜单) +示例9(设置文本特性与行间距) + diff --git a/richEditor/interface/test-getTitle-TextArea.md b/richEditor/interface/test-getTitle-TextArea.md new file mode 100644 index 0000000..cf13e05 --- /dev/null +++ b/richEditor/interface/test-getTitle-TextArea.md @@ -0,0 +1,112 @@ +## 子组件 + +## 接口 + +## TextAreaOptions对象说明 + +## 属性 +autoCapitalizationMode +barState +caretColor +caretStyle +contentType +copyOption +customKeyboard +decoration +editMenuOptions +ellipsisMode +enableAutoFill +enableAutoSpacing +enableHapticFeedback +enableKeyboardOnFocus +enablePreviewText +enterKeyType +fontColor +fontFamily +fontFeature +fontSize +fontStyle +fontWeight +halfLeading +heightAdaptivePolicy +inputFilter +keyboardAppearance +letterSpacing +lineBreakStrategy +lineHeight +lineSpacing +lineSpacing +maxFontScale +maxFontSize +maxLength +maxLines +maxLines +minFontScale +minFontSize +minLines +placeholderColor +placeholderFont +selectedBackgroundColor +selectionMenuHidden +showCounter +stopBackPress +strokeColor +strokeWidth +style +textAlign +textIndent +textOverflow +type +wordBreak + +## 事件 +onChange +onContentScroll +onCopy +onCut +onDidDelete +onDidInsert +onEditChange +onPaste +onSubmit +onSubmit +onTextSelectionChange +onWillChange +onWillDelete +onWillInsert + +## TextAreaController +caretPosition +constructor +setTextSelection +stopEditing +导入对象 + +## TextAreaType枚举说明 + +## TextAreaSubmitCallback + +## 示例 +示例10(设置文本行间距) +示例11(设置自动填充) +示例12(设置折行规则) +示例13(支持插入和删除回调) +示例14(文本扩展自定义菜单) +示例15(文本设置省略模式) +示例16(自定义复制、剪切、粘贴) +示例17(设置最小字体范围与最大字体范围) +示例18(设置选中指定区域的文本内容) +示例19(设置文本描边) +示例1(设置与获取光标位置) +示例20(设置中西文自动间距) +示例21(设置最大行数) +示例22(设置最小行数) +示例2(设置计数器) +示例3(设置自定义键盘) +示例4(设置输入法回车键类型) +示例5(设置文本断行规则) +示例6(设置文本样式) +示例7(设置文字特性效果) +示例8(自定义键盘避让) +示例9(设置文本自适应) + diff --git a/richEditor/interface/test-getTitle-TextInput.md b/richEditor/interface/test-getTitle-TextInput.md new file mode 100644 index 0000000..75490d3 --- /dev/null +++ b/richEditor/interface/test-getTitle-TextInput.md @@ -0,0 +1,142 @@ +## 子组件 + +## 接口 + +## TextInputOptions对象说明 + +## 属性 +autoCapitalizationMode +barState +cancelButton +cancelButton +caretColor +caretPosition +caretStyle +contentType +copyOption +customKeyboard +decoration +editMenuOptions +ellipsisMode +enableAutoFill +enableAutoFillAnimation +enableAutoSpacing +enableHapticFeedback +enableKeyboardOnFocus +enablePreviewText +enterKeyType +fontColor +fontFamily +fontFeature +fontSize +fontStyle +fontWeight +halfLeading +heightAdaptivePolicy +inputFilter +keyboardAppearance +letterSpacing +lineBreakStrategy +lineHeight +maxFontScale +maxFontSize +maxLength +maxLines +minFontScale +minFontSize +passwordIcon +passwordRules +placeholderColor +placeholderFont +selectAll +selectedBackgroundColor +selectionMenuHidden +showCounter +showError +showPassword +showPasswordIcon +showUnderline +showUnit +stopBackPress +strokeColor +strokeWidth +style +textAlign +textIndent +textOverflow +type +underlineColor +wordBreak + +## InputType枚举说明 + +## ContentType枚举说明 + +## TextInputStyle枚举说明 + +## PasswordIcon对象说明 + +## EnterKeyType枚举说明 + +## 事件 +onChange +onContentScroll +onCopy +onCut +onDidDelete +onDidInsert +onEditChange +onEditChanged +onPaste +onSecurityStateChange +onSubmit +onTextSelectionChange +onWillAttachIME +onWillChange +onWillDelete +onWillInsert + +## TextInputController +caretPosition +constructor +setTextSelection +stopEditing +导入对象 + +## UnderlineColor对象说明 + +## SubmitEvent +keepEditableState +属性 + +## OnPasteCallback + +## OnSubmitCallback + +## OnTextSelectionChangeCallback + +## OnContentScrollCallback + +## 示例 +示例10(自定义键盘避让) +示例11(设置文本自适应) +示例12(设置折行规则) +示例13(支持插入和删除回调) +示例14(文本扩展自定义菜单) +示例15(设置symbol类型清除按钮) +示例16(文本设置省略模式) +示例17(输入框支持输入状态变化等回调) +示例18(设置最小字体范围与最大字体范围) +示例19(设置选中指定区域的文本内容) +示例1(设置与获取光标位置) +示例20(设置文本描边) +示例21(设置中西文自动间距) +示例2(设置下划线) +示例3(设置自定义键盘) +示例4(设置右侧清除按钮样式) +示例5(设置计数器) +示例6(电话号码格式化) +示例7(设置文本断行规则) +示例8(设置文本样式) +示例9(设置文字特性效果) + -- Gitee