# excel-to-markdown **Repository Path**: david0624/excel-to-markdown ## Basic Information - **Project Name**: excel-to-markdown - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-26 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Excel 转 Markdown(多 Sheet) 把 `.xlsx` 文件转换成 Markdown 文档: - 一级标题:Excel 文件名(不含扩展名) - 每个工作表(sheet):一个二级标题(`## {sheet名}`) - 二级标题下面:纯文本 Markdown 表格(管道表格),没有复杂样式 ## 输出示例 ```md # test_multi ## Sheet1 | 姓名 | 分数 | | --- | --- | | 张三 | 90 | ## 数据表二 | A | B | | --- | --- | | 1 | 2 | ``` ## 安装与使用(uv) 在项目目录执行: ```bash uv sync ``` 直接打印到终端: ```bash uv run excel-to-markdown ./input.xlsx ``` 导出到 `.md` 文件: ```bash uv run excel-to-markdown ./input.xlsx -o ./output.md ``` 也可以用 `python -m`: ```bash uv run python -m excel_to_markdown ./input.xlsx -o ./output.md ``` ## 使用配置文件(优先) 如果项目目录存在 `config.toml`,程序会优先从其中读取 `input` / `output`。 `config.toml` 示例: ```toml input = "./input.xlsx" output = "./output.md" ``` 运行(可不传入 input/output 参数): ```bash uv run excel-to-markdown ``` 如需指定配置文件路径: ```bash uv run excel-to-markdown --config ./config.toml ``` ## 转换规则说明 - 表格内容会把单元格转成字符串(数值/日期时间做了简单格式化)。 - 会去掉表格两端完全为空的行;并尽量裁掉最右侧全为空的列。 - 单元格中如果包含 `|`,会进行转义(写成 `\|`),避免破坏 Markdown 表格结构。