本项目是基于原始 Markdownify 项目的增强版本,专为更好地支持 UTF - 8 编码而开发,能将多种格式文件转换为 Markdown,为您的工作带来便利。
git clone https://github.com/JDJR2024/markdownify-mcp-utf8.git
cd markdownify-mcp-utf8
npm install
pip install -r requirements.txt
node dist/index.js
UV_PATH 和 MARKDOWN_OUTPUT_DIR)。将网页转换为 Markdown:
python convert_utf8.py "https://example.com"
python convert_utf8.py "document.docx"
- PDF 文件:
python convert_utf8.py "document.pdf"
- PowerPoint 文件:
python convert_utf8.py "presentation.pptx"
- Excel 文件:
python convert_utf8.py "spreadsheet.xlsx"
python convert Utf8_py "https://www.youtube.com/watch?v=VIDEO_ID"
convert_batch.txt):https://example1.com
https://example2.com
file1.docx
file2.pdf
while read -r line; do python convert_utf8.py "$line"; done < convert_batch.txt
设置自定义路径:
export UV_PATH="/custom/path/to/uv"
export MARKDOWN_OUTPUT_DIR="/output/path"
在 Python 脚本中使用这些环境变量。
配置 Node.js 环境:
node dist/index.js
Python 脚本调用示例:
import subprocess
def convert_file(file_path):
subprocess.run(["python", "convert Utf8_py", file_path])
if __name__ == "__main__":
file_path = input("请输入文件路径:")
convert_file(file_path)
欢迎提交 Pull Request 和 Issue!
感谢您的支持!希望这个项目能为您的工作带来便利。