name: "MarkItDown Parser" description: "基于 MarkItDown 库将多种文档格式统一转换为 Markdown 文本。支持图片上传、远程图片下载与 Base64 转换。" language: "python" raw_id: "MarkItDownParser" version: "1.1.0" vendor: "DeepData" modal: "text" inputs: "text" outputs: "text" types: - 'collect' release: - "首次发布:支持多格式文档转 Markdown" - "新增图片外部上传图床功能" - "优化图片处理优先级与容错机制" settings: doc_formats: name: "处理的文档格式" description: "选择需要处理的文件格式。" type: "multiSelect" defaultVal: ["docx", "xlsx", "pptx", "csv", "txt", "xml", "doc", "xls", "ppt"] required: true options: - label: "Word (.docx)" value: "docx" - label: "Word (.doc)" value: "doc" - label: "Excel (.xlsx)" value: "xlsx" - label: "Excel (.xls)" value: "xls" - label: "PowerPoint (.pptx)" value: "pptx" - label: "PowerPoint (.ppt)" value: "ppt" - label: "纯文本 (.txt)" value: "txt" - label: "CSV (.csv)" value: "csv" - label: "XML (.xml)" value: "xml" - label: "HTML (.html)" value: "html" - label: "HTML (.htm)" value: "htm" # ================= 原有图片处理配置 ================= download_remote_images: name: "下载远程图片" description: "是否自动下载 HTML 中的远程图片。开启后,图片将被本地化或上传。" type: "switch" defaultVal: "true" checkedLabel: "是" unCheckedLabel: "否" embed_images_base64: name: "嵌入 Base64 图片" description: "将图片转为 Base64 内联到 Markdown 中。若关闭且未开启上传,图片将保存为本地文件。" type: "switch" defaultVal: "true" checkedLabel: "是" unCheckedLabel: "否" max_image_width: name: "图片最大宽度 (像素)" description: "超过此宽度的图片将被等比缩放,减少体积。" type: "slider" defaultVal: 1200 min: 400 max: 4096 step: 100 # ================= 新增:外部图床上传配置 ================= upload_images: name: "上传图片到外部服务" description: "开启后,将自动把文档中的图片上传至下方指定的 API,并替换为可访问的网络链接" type: "switch" defaultVal: "true" checkedLabel: "开启上传" unCheckedLabel: "使用 Base64/本地" upload_api_url: name: "图片上传 API 地址" description: "接收图片的 POST 接口 (支持 multipart/form-data),例如: http://example.com/upload/form" type: "input" defaultVal: "http://mfs.ailab.ccoop.cc:18585/upload/form" required: false preview_base_url: name: "图片预览基础地址" description: "用于拼接上传返回的相对路径,生成最终 URL。例如: http://example.com/file" type: "input" defaultVal: "http://mfs.ailab.ccoop.cc:18585" required: false