convert-documents-to-markdown
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConvert documents to Markdown
将文档转换为Markdown
Run the anydoc CLI. It needs Node 20+ and no install:
bash
npx -y @firecrawl/anydoc <file> # Markdown to stdout
npx -y @firecrawl/anydoc <file> -o out.md # write to a file
npx -y @firecrawl/anydoc - --format csv < f # read stdinRules:
- Supported inputs: ,
.doc,.docx,.docm,.odt,.rtf,.epub,.pdf,.ppt,.pps,.pot,.pptx,.pptm,.ppsx,.ppsm,.odp,.xls,.xlsx,.xlsm,.xlsb,.ods..csv - The format is detected from the file content. Pass only when detection cannot work: CSV from stdin, or a missing or wrong extension.
--format <name> - Exit codes: 0 success, 1 the document could not be converted, 2 usage error. Failures print one line to stderr. The CLI never prompts.
anydoc: <message> - For a large document, write to a file with and read the parts you need instead of streaming everything into context.
-o - Scanned and image-only PDFs need OCR, which anydoc does not do; they fail as unsupported. The hosted Firecrawl Parse API handles those.
- Inside a Node, Python, or Rust codebase, prefer the library over shelling out: on npm,
@firecrawl/anydocon PyPI,firecrawl-anydocon crates.io. Each exposes the sameanydoc/to_markdownAPI.toMarkdown
运行anydoc CLI。它需要Node 20+环境,无需安装:
bash
npx -y @firecrawl/anydoc <file> # 将Markdown输出到标准输出
npx -y @firecrawl/anydoc <file> -o out.md # 写入到文件
npx -y @firecrawl/anydoc - --format csv < f # 从标准输入读取规则:
- 支持的输入格式:、
.doc、.docx、.docm、.odt、.rtf、.epub、.pdf、.ppt、.pps、.pot、.pptx、.pptm、.ppsx、.ppsm、.odp、.xls、.xlsx、.xlsm、.xlsb、.ods。.csv - 格式会从文件内容自动检测。仅当检测失效时才需传入参数:比如从标准输入读取CSV,或文件扩展名缺失、错误的情况。
--format <name> - 退出码:0表示成功,1表示文档无法转换,2表示使用错误。失败时会向标准错误输出一行信息。CLI不会进行任何提示。
anydoc: <message> - 对于大型文档,请使用参数写入文件,然后按需读取所需部分,而非将所有内容流式传输到上下文。
-o - 扫描件和纯图片PDF需要OCR处理,anydoc不支持此功能,这类文件会转换失败。托管的Firecrawl Parse API可处理此类文件。
- 在Node、Python或Rust代码库中,优先使用对应库而非调用shell命令:npm上的、PyPI上的
@firecrawl/anydoc、crates.io上的firecrawl-anydoc。每个库都提供相同的anydoc/to_markdownAPI。toMarkdown