# md-web-editor **Repository Path**: jpw_code/md-web-editor ## Basic Information - **Project Name**: md-web-editor - **Description**: md文档的web预览,可以配合chrome-manual-vite-pass的浏览器插件,将录制的用户手册截图导出后,导入到这里进行编辑预览 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-23 - **Last Updated**: 2026-06-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # md-web-editor Markdown 在线预览、编辑、Word 导出工具。配合 Chrome 扩展「手册录制器」使用。 > 📦 最新运行文件:https://gitee.com/jpw_code/md-web-editor > 🧩 Chrome 扩展:https://gitee.com/jpw_code/chrome-manual-vite-press > 如果 ZIP 中的运行文件版本过旧,可从仓库下载最新 `server.py` / `index.html` / `export_word.py` 替换 ## 快速开始 ### Python(推荐,支持 Word 导出) ```bash # 1. 安装依赖(Word 导出需要) pip3 install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simple # 2. 赋予执行权限(ZIP 解压后需要) chmod +x preview.sh # 3. 启动服务 ./preview.sh start # 或者直接运行(无需 chmod) python3 server.py # 停止 ./preview.sh stop ``` ### Windows **PowerShell(推荐):** ```powershell # 安装依赖 pip install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simple # 启动服务 .\preview.ps1 start # 停止 .\preview.ps1 stop ``` **CMD:** ```cmd preview.bat start preview.bat stop ``` ### Node.js(备选,不支持 Word 导出) ```bash npm install && npm run dev # 浏览器自动打开 http://localhost:8765 ``` > ⚠️ Node.js 方式无法导出 Word 文档,如需 Word 导出请使用 Python ### 打开页面 浏览器访问 **http://localhost:8765** ## 目录结构 ``` md-web-editor/ ├── modules/ # Markdown 文档(自动检测) ├── images/ # 截图(按模块名分目录) ├── .backups/ # 编辑自动备份 ├── server.py # 后端服务 ├── index.html # 前端页面 ├── export_word.py # Word 导出模块 ├── preview.sh # macOS/Linux 启动脚本 ├── preview.ps1 # Windows PowerShell 启动脚本 └── preview.bat # Windows CMD 启动脚本 ``` ## 导入录制内容 1. 点击工具栏「📥 导入」 2. 选择 Chrome 扩展导出的 ZIP 文件 3. 自动解压到 `modules/` 和 `images/` 或手动粘贴:将 `.md` 放入 `modules/`,截图放入 `images/模块名/`。 ## Word 导出(可选) **方案一(推荐):python-docx** ```bash pip3 install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simple ``` **方案二:pypandoc** | 平台 | 安装 pandoc | 安装 pypandoc | |------|-----------|-------------| | macOS | `brew install pandoc` | `pip3 install pypandoc` | | Linux | `sudo apt install pandoc` | `pip3 install pypandoc` | | Windows | `winget install --id JohnMacFarlane.Pandoc` | `pip install pypandoc` |