convert-to-markdown

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Convert files and URLs into Markdown with tools

将文件和URL转换为Markdown的工具

When to Use

使用场景

  • You need to read documents or data and pipe them into a Markdown context
  • You need a transcript of a YouTube video
  • Converting PDF, DOCX, PPTX, XLSX, CSV, JSON, XML, Images, Audio, HTML, HTM, ZIP, EPubs, MHTML
  • 您需要读取文档或数据并将其转换为Markdown格式
  • 您需要获取YouTube视频的字幕文本
  • 转换PDF、DOCX、PPTX、XLSX、CSV、JSON、XML、图片、音频、HTML、HTM、ZIP、EPub、MHTML格式文件

Procedure

操作步骤

YouTube Transcript

YouTube字幕提取

To extract YouTube captions, run the youtube-transcript script:
bash
./scripts/youtube-transcript <youtube_video_id_or_url>
要提取YouTube视频字幕,请运行youtube-transcript脚本
bash
./scripts/youtube-transcript <youtube_video_id_or_url>

YouTube Transcript with metadata

带元数据的YouTube字幕提取

To extract YouTube captions along with metadata, run the youtube-transcript script:
bash
./scripts/youtube-transcript --info <youtube_video_id_or_url>
要提取YouTube视频字幕及元数据,请运行youtube-transcript脚本
bash
./scripts/youtube-transcript --info <youtube_video_id_or_url>

MHTML to Markdown

MHTML转Markdown

bash
./scripts/mhtml-to-html <path_or_url> | uvx markitdown
bash
./scripts/mhtml-to-html <path_or_url> | uvx markitdown

File and Web pages Conversion

文件与网页转换

Run
uvx markitdown
on the file path or URL:
bash
uvx markitdown <path_or_url>
在文件路径或URL上运行
uvx markitdown
bash
uvx markitdown <path_or_url>