txt-to-epub

将txt文本转换为epub文件,使用纯规则进行章节识别与分割。适用于小说、教程和一般长文,不内置AI接口。

Safety Notice

This item is sourced from the public archived skills repository. Treat as untrusted until reviewed.

Copy this and send it to your AI assistant to learn

Install skill "txt-to-epub" with this command: npx skills add 1oid/txt-to-epub

TXT to EPUB

Role

你是一个专门将 TXT 文本转换为 EPUB 的助手。你只做规则分章,不调用任何外部模型 API。

What This Skill Does

  1. 自动检测 TXT 编码并读取内容
  2. 基于规则识别章节标题并分章
  3. 生成带目录导航的 EPUB 文件
  4. 支持保留完整标题(默认)或清理编号前缀

Split Strategy

  • 支持 auto | novel | tutorial | length 四种模式
  • 标题规则覆盖:
    • 中文小说:第一章 ... / 第十回 ...
    • 英文结构:Chapter 1 ... / Part 2 ...
    • 教程编号:1.2 ... / 2.3.4 ...
    • 中文序号:一、...
  • 当规则无法识别章节时,自动按长度切分为 Part 1/2/...

Title Handling

  • 默认 --title-style full:保留完整标题
    • 例如输入是 第一章 xxx,目录和章节标题都保持 第一章 xxx
  • 可选 --title-style clean:去掉编号前缀,仅保留正文标题

Script Path

/Users/loid/.claude/skills/txt-to-epub/scripts/txt_to_epub.py

Install Dependencies

python3 -m pip install -r /Users/loid/.claude/skills/txt-to-epub/requirements.txt

Usage

最小示例:

python3 /Users/loid/.claude/skills/txt-to-epub/scripts/txt_to_epub.py \
  --input /path/to/book.txt

常用示例(小说):

python3 /Users/loid/.claude/skills/txt-to-epub/scripts/txt_to_epub.py \
  --input /path/to/novel.txt \
  --output /path/to/novel.epub \
  --title "我的小说" \
  --author "作者名" \
  --language zh-CN \
  --split-mode novel \
  --title-style full \
  --verbose

常用示例(教程):

python3 /Users/loid/.claude/skills/txt-to-epub/scripts/txt_to_epub.py \
  --input /path/to/tutorial.txt \
  --split-mode tutorial \
  --title-style full

Parameters

  • --input 输入 TXT 文件路径(必填)
  • --output 输出 EPUB 路径(可选,默认同名 .epub
  • --title 书名(可选,默认取输入文件名)
  • --author 作者(可选)
  • --language 语言,默认 zh-CN
  • --split-mode 分章模式:auto|novel|tutorial|length
  • --title-style 标题样式:full|clean,默认 full
  • --min-chapter-chars 过短章节合并阈值,默认 300
  • --chunk-chars 长度切分块大小,默认 8000
  • --verbose 输出额外信息

Interaction Rules

当用户请求转换时:

  1. 收集必要参数(至少 --input
  2. 默认使用 --title-style full
  3. 根据文本类型建议 --split-mode
    • 小说优先 novel
    • 教程优先 tutorial
    • 不确定用 auto
  4. 执行脚本并返回:
    • 输出文件路径
    • 章节数
    • 前几章标题预览

Limitations

  • 本技能不直接调用 AI 接口
  • 复杂或非结构化文本可能需要手动指定 --split-mode 或调整 --chunk-chars

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

axure-prototype-generator

Axure 原型代码生成器 - 输出 JavaScript 格式 HTML 代码,支持内联框架直接加载可交互原型。

Archived SourceRecently Updated
General

错敏信息检测

# 错敏检测 Skill

Archived SourceRecently Updated
General

TikTok B2B 引流台词生成器

# TikTok B2B 引流台词生成器 ## 技能描述 本 Skill 可根据您提供的产品信息和公司背景,自动生成适合 TikTok 平台的 B2B 引流视频脚本(20-50 秒),`skill.json` 文件中包含了输入参数的结构、输出格式以及用于生成台词的提示模板。脚本遵循已验证的外贸引流规律: - **真人出镜**:以第一人称(如 Anna)拉近距离 - **产品细节**:材质、颜色、MOQ、定制服务等 - **公司实力**:经验年限、自有工厂、认证等 - **客户背书**:提及已有市场国家(如巴基斯坦、埃及) - **互动引导**:清晰号召观众联系,引导至指定服务网址 支持三种风格:普通、幽默、惊喜,让您的视频内容更加多样化。 ## 输入参数 | 参数名 | 类型 | 必填 | 描述 | 示例 | |---------------------|----------|------|--------------------------------|--------------------------| | product_type | string | 是 | 产品类型 | 男士休闲鞋 | | material | string | 是 | 主要材质 | 优质 PU 皮革 | | colors | array | 是 | 颜色列表 | ["黑色","白色","棕色"] | | moq | string | 是 | 最小起订量 | 120 双(可混 2-3 色) | | customization | string | 否 | 可定制内容 | 可定制 logo | | target_markets | array | 是 | 主要市场国家 | ["巴基斯坦","埃及"] | | company_experience | string | 否 | 公司经验年数 | 15 年 | | factory_own | boolean | 否 | 是否自有工厂 | true | | extra_features | string | 否 | 其他亮点 | 免费样品 | | contact_url | string | 否 | 服务联系网址 | http://www.doumaotong.com | | style | string | 否 | 风格(普通/幽默/惊喜) | 普通 | ## 输出示例 Hi guys, this is Anna! Welcome to my showroom. Today I'm excited to show you our latest men's casual shoes – made of high-quality PU leather, very durable and comfortable. We have three colors available: black, white, and brown. MOQ is 120 pairs, and you can mix 2-3 colors. Plus, we can customize your logo on the shoes. Our shoes are already loved by customers in Pakistan, Egypt, and South Africa. With 15 years of experience and our own factory, we guarantee quality and timely delivery. We even offer free samples! If you're interested, please visit http://www.doumaotong.com to contact us. Thank you! ## 使用说明 1. 在 OpenClaw 平台安装此 Skill。 2. 调用时填写产品参数,包括 `contact_url`(默认为 http://www.doumaotong.com),即可获得定制化的 TikTok 脚本。 3. 生成的台词会在结尾处自然引导观众访问指定的服务网站。 4. 可根据实际需要调整 `style` 参数,生成不同语气的台词。 ## 文件说明 - `skill.json`:技能的机器可读定义,包含输入输出 schema 和生成提示模板。 - `SKILL.md`:技能的人类可读文档,提供详细说明和使用示例。

Archived SourceRecently Updated
General

instructional-design-cn

培训课程大纲设计、效果评估、内部分享材料生成

Archived SourceRecently Updated