|
1 | | -# Word2MD |
| 1 | +# Word2MD Converter | 文档转换工具 |
2 | 2 |
|
3 | | -A GitHub Pages website that automatically converts various file formats to Markdown using GitHub Actions and the `markitdown` package. |
| 3 | +一个简单的在线文档转换工具,可以将各种格式的文件转换为 Markdown 格式。基于 GitHub Pages 和 GitHub Actions 构建。 |
4 | 4 |
|
5 | | -## Features |
| 5 | +A user-friendly online document converter that transforms various file formats into Markdown. Built with GitHub Pages and GitHub Actions. |
6 | 6 |
|
7 | | -- Drag-and-drop file upload interface |
8 | | -- Supports multiple file formats (PDF, Word, PowerPoint, Excel, Images, etc.) |
9 | | -- Automatic conversion to Markdown using GitHub Actions |
10 | | -- Download converted files directly from the website |
| 7 | +## 🌟 特性 | Features |
11 | 8 |
|
12 | | -## Setup Instructions |
| 9 | +- 🚀 简单易用的拖放上传界面 | Easy drag-and-drop upload interface |
| 10 | +- 📝 支持多种文件格式 | Multiple file formats supported |
| 11 | +- ⚡ 自动转换处理 | Automatic conversion |
| 12 | +- 💾 一键下载转换结果 | One-click download of converted files |
13 | 13 |
|
14 | | -1. **Fork and Clone the Repository** |
15 | | - ```bash |
16 | | - git clone https://github.com/YOUR_USERNAME/Word2MD.git |
17 | | - cd Word2MD |
18 | | - ``` |
| 14 | +### 支持的文件格式 | Supported Formats |
19 | 15 |
|
20 | | -2. **Configure GitHub Pages** |
21 | | - - Go to your repository settings |
22 | | - - Navigate to "Pages" under "Code and automation" |
23 | | - - Set the source branch to `main` and the folder to `/docs` |
24 | | - - Save the settings |
| 16 | +- 📄 PDF 文件 | PDF files |
| 17 | +- 📘 Word 文档 (.docx, .doc) | Word documents |
| 18 | +- 📊 PowerPoint 演示文稿 (.pptx, .ppt) | PowerPoint presentations |
| 19 | +- 📈 Excel 表格 (.xlsx, .xls) | Excel spreadsheets |
| 20 | +- 🖼️ 图片文件 (包含 EXIF 数据和 OCR) | Images (with EXIF data and OCR) |
| 21 | +- 🎵 音频文件 (包含元数据和语音转写) | Audio (with metadata and transcription) |
| 22 | +- 🌐 HTML 网页 | HTML pages |
| 23 | +- 📋 文本格式 (CSV, JSON, XML) | Text formats |
25 | 24 |
|
26 | | -3. **Configure GitHub Token** |
27 | | - - Generate a new Personal Access Token (PAT): |
28 | | - - Go to GitHub Settings → Developer Settings → Personal Access Tokens |
29 | | - - Generate a new token with `repo` scope |
30 | | - - Store the token securely (you'll need to add it to the website later) |
| 25 | +## ⚠️ 重要说明 | Important Notes |
31 | 26 |
|
32 | | -4. **Update Configuration** |
33 | | - - Open `docs/js/main.js` |
34 | | - - Replace the `REPO_OWNER` constant with your GitHub username |
35 | | - - Save the changes |
| 27 | +### 使用前必读 | Must Read Before Use |
36 | 28 |
|
37 | | -5. **Create Required Directories** |
38 | | - ```bash |
39 | | - mkdir uploads |
40 | | - mkdir docs/converted |
41 | | - ``` |
| 29 | +1. **Fork 项目(必需步骤)| Fork Repository (Required)** |
| 30 | + - 本工具需要在你自己的 GitHub 仓库中运行 |
| 31 | + - This tool needs to run in your own GitHub repository |
| 32 | + - 👉 [点击这里 Fork 项目 | Click here to Fork](https://github.com/BH3GEI/Word2MD/fork) |
| 33 | + - 如果不 Fork 项目,即使提供了 GitHub Token 也无法使用 |
| 34 | + - Without forking, the tool won't work even with a GitHub Token |
| 35 | + |
| 36 | +2. **为什么需要 Fork?| Why Fork is Required** |
| 37 | + - 文件转换过程在你的 GitHub Actions 中进行 |
| 38 | + - File conversion happens in your GitHub Actions |
| 39 | + - 需要向仓库写入文件的权限 |
| 40 | + - Requires permission to write files to the repository |
| 41 | + - 确保你的文件安全和隐私 |
| 42 | + - Ensures your file security and privacy |
| 43 | + |
| 44 | +## 🚀 快速开始 | Quick Start |
| 45 | + |
| 46 | +### 在线使用 | Online Usage |
| 47 | + |
| 48 | +1. **Fork 项目(必需)| Fork Repository (Required)** |
| 49 | + - 访问 [Word2MD 项目主页](https://github.com/BH3GEI/Word2MD) |
| 50 | + - Visit [Word2MD Project Homepage](https://github.com/BH3GEI/Word2MD) |
| 51 | + - 点击 [Fork](https://github.com/BH3GEI/Word2MD/fork) 创建你的副本 |
| 52 | + - Click [Fork](https://github.com/BH3GEI/Word2MD/fork) to create your copy |
| 53 | + |
| 54 | +2. **启用 GitHub Pages | Enable GitHub Pages** |
| 55 | + - 在你 fork 的仓库中启用 GitHub Pages |
| 56 | + - Enable GitHub Pages in your forked repository |
| 57 | + - 选择 `main` 分支和 `/docs` 目录 |
| 58 | + - Select `main` branch and `/docs` folder |
| 59 | + |
| 60 | +3. **访问你的转换网站 | Visit Your Converter** |
| 61 | + - 打开 `https://[你的用户名].github.io/Word2MD` |
| 62 | + - Open `https://[your-username].github.io/Word2MD` |
| 63 | + - 示例 | Example: https://bh3gei.github.io/Word2MD |
42 | 64 |
|
43 | | -6. **Push Changes** |
| 65 | +4. 设置 GitHub Token | Set up GitHub Token |
| 66 | + - 点击 "Update Token" 按钮 | Click the "Update Token" button |
| 67 | + - 按照提示创建并输入 Token | Follow prompts to create and enter your token |
| 68 | + |
| 69 | +5. 上传文件 | Upload Files |
| 70 | + - 拖放文件到上传区域 | Drag and drop files to the upload area |
| 71 | + - 或点击 "Select Files" 按钮选择文件 | Or click "Select Files" button |
| 72 | + |
| 73 | +6. 等待转换 | Wait for Conversion |
| 74 | + - 文件上传后会自动开始转换 | Conversion starts automatically after upload |
| 75 | + - 可以在列表中查看转换进度 | Check progress in the list |
| 76 | + |
| 77 | +7. 下载结果 | Download Results |
| 78 | + - 转换完成后点击 "Download" 下载文件 | Click "Download" when conversion is complete |
| 79 | + - 或点击 "View" 在线预览 | Or click "View" for online preview |
| 80 | + |
| 81 | +### 部署自己的版本 | Deploy Your Own |
| 82 | + |
| 83 | +1. 复制仓库 | Fork Repository |
44 | 84 | ```bash |
45 | | - git add . |
46 | | - git commit -m "Initial setup" |
47 | | - git push |
| 85 | + # 克隆仓库 | Clone the repository |
| 86 | + git clone https://github.com/[你的用户名]/Word2MD.git |
| 87 | + cd Word2MD |
48 | 88 | ``` |
49 | 89 |
|
50 | | -## Usage |
| 90 | +2. 设置 GitHub Pages | Set up GitHub Pages |
| 91 | + - 转到仓库设置 | Go to repository settings |
| 92 | + - 找到 Pages 设置 | Find Pages settings |
| 93 | + - 选择 `main` 分支和 `/docs` 目录 | Select `main` branch and `/docs` folder |
| 94 | + - 保存设置 | Save settings |
| 95 | + |
| 96 | +3. 配置 GitHub Token | Configure GitHub Token |
| 97 | + - 转到 GitHub 设置 → 开发者设置 → 个人访问令牌 | Go to GitHub Settings → Developer Settings → Personal Access Tokens |
| 98 | + - 生成新的令牌,选择 `repo` 权限 | Generate new token with `repo` scope |
| 99 | + - 保存令牌备用 | Save the token for later use |
| 100 | + |
| 101 | +## ⚠️ 注意事项 | Notes |
| 102 | + |
| 103 | +- 文件大小限制:100MB | File size limit: 100MB |
| 104 | +- Token 安全:请勿分享你的 GitHub Token | Token security: Never share your GitHub Token |
| 105 | +- 转换时间:根据文件大小可能需要几秒到几分钟不等 | Conversion time: May take seconds to minutes depending on file size |
| 106 | +- 隐私考虑:所有文件都会上传到你的 GitHub 仓库 | Privacy: All files are uploaded to your GitHub repository |
| 107 | + |
| 108 | +## 🔧 常见问题 | Troubleshooting |
51 | 109 |
|
52 | | -1. Visit your GitHub Pages site at `https://YOUR_USERNAME.github.io/Word2MD` |
53 | | -2. When prompted, enter your GitHub token |
54 | | -3. Upload files using the drag-and-drop interface or file selector |
55 | | -4. Wait for the conversion process to complete |
56 | | -5. Download the converted Markdown files from the list |
| 110 | +1. **文件上传失败 | File Upload Failed** |
| 111 | + - 检查文件大小是否超过限制 | Check if file size exceeds limit |
| 112 | + - 确认 Token 权限是否正确 | Verify token permissions |
| 113 | + - 检查网络连接 | Check network connection |
57 | 114 |
|
58 | | -## Limitations |
| 115 | +2. **转换失败 | Conversion Failed** |
| 116 | + - 确认文件格式是否支持 | Verify file format is supported |
| 117 | + - 检查文件是否损坏 | Check if file is corrupted |
| 118 | + - 查看 GitHub Actions 日志了解详情 | Check GitHub Actions logs for details |
59 | 119 |
|
60 | | -- Maximum file size: 100 MB (GitHub limitation) |
61 | | -- Supported file formats: |
62 | | - - PDF |
63 | | - - PowerPoint |
64 | | - - Word |
65 | | - - Excel |
66 | | - - Images (EXIF metadata and OCR) |
67 | | - - Audio (EXIF metadata and speech transcription) |
68 | | - - HTML |
69 | | - - Text-based formats (CSV, JSON, XML) |
70 | | - - ZIP files |
| 120 | +3. **找不到转换后的文件 | Cannot Find Converted File** |
| 121 | + - 等待几分钟让转换完成 | Wait a few minutes for conversion |
| 122 | + - 刷新页面 | Refresh the page |
| 123 | + - 检查 GitHub Actions 运行状态 | Check GitHub Actions status |
71 | 124 |
|
72 | | -## Security Notes |
| 125 | +## 🤝 贡献 | Contributing |
73 | 126 |
|
74 | | -- The GitHub token is stored in your browser's local storage |
75 | | -- Never share your GitHub token |
76 | | -- Consider implementing a more secure token storage solution for production use |
| 127 | +欢迎提交 Pull Request 或提出建议!| Contributions are welcome! |
77 | 128 |
|
78 | | -## Contributing |
| 129 | +## 📄 许可证 | License |
79 | 130 |
|
80 | | -Contributions are welcome! Please feel free to submit a Pull Request. |
| 131 | +本项目采用 MIT 许可证 | This project is licensed under the MIT License |
0 commit comments