epub

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

EPUB Reader Skill

EPUB Reader 技能

Read EPUB ebook files and extract content as clean Markdown.
读取EPUB电子书文件并将内容提取为格式整洁的Markdown。

Instructions

使用说明

Use the epub-reader CLI tool to interact with EPUB files. The tool is located at:
~/.claude/skills/epub/scripts/epub-reader/dist/index.js
使用epub-reader CLI工具与EPUB文件交互。该工具的路径为:
~/.claude/skills/epub/scripts/epub-reader/dist/index.js

Available Commands

可用命令

1. View Metadata

1. 查看元数据

Get book information (title, author, publisher, date, description).
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js metadata "<path-to-epub>"
获取书籍信息(标题、作者、出版社、日期、简介)。
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js metadata "<path-to-epub>"

2. List Table of Contents

2. 列出目录

View all chapters and their structure. Each entry shows
[ch: N]
indicating the chapter number to use with the
chapter
command.
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js toc "<path-to-epub>"
查看所有章节及其结构。每个条目会显示
[ch: N]
,表示可在
chapter
命令中使用的章节编号。
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js toc "<path-to-epub>"

3. Read Specific Chapter

3. 读取指定章节

Read a single chapter by number (1-indexed).
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js chapter "<path-to-epub>" <chapter-number>
按编号读取单个章节(从1开始计数)。
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js chapter "<path-to-epub>" <chapter-number>

4. Read Entire Book

4. 读取整本书

Extract the complete book as Markdown.
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js full "<path-to-epub>"
将整本书的内容提取为Markdown格式。
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js full "<path-to-epub>"

5. Search Text

5. 文本搜索

Find text occurrences with surrounding context.
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js search "<path-to-epub>" "<search-query>"
查找文本出现的位置及上下文内容。
bash
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js search "<path-to-epub>" "<search-query>"

Recommended Workflow

推荐工作流程

  1. Start with metadata to understand what book you're working with
  2. View the TOC to see available chapters and structure
  3. Read specific chapters for targeted analysis, or use full for complete extraction
  4. Use search to find specific topics, quotes, or references
  1. 先查看元数据,了解你要处理的书籍
  2. 查看目录,了解可用章节和书籍结构
  3. 读取指定章节进行针对性分析,或使用full命令提取完整内容
  4. 使用搜索功能查找特定主题、引文或参考内容

Open-Ended Search

开放式搜索

For broad or conceptual queries like "what are the main themes in this book?" or "find all references to the protagonist's childhood", use query expansion:
  1. Expand the query into multiple specific search terms using domain knowledge
    • Example: "protagonist's childhood" → search for character name, "young", "childhood", "memory", "father", "mother", "grew up", etc.
  2. Run searches in parallel for each expanded term
  3. Synthesize results by deduplicating and consolidating findings across searches
This approach leverages Claude's domain knowledge to catch synonyms, related concepts, and terminology variations that a simple keyword search would miss.
对于宽泛或概念性的查询,比如“这本书的主题是什么?”或“找出所有关于主角童年的内容”,请使用查询扩展方法:
  1. 扩展查询词:利用领域知识将查询拆分为多个具体的搜索词
    • 示例:“主角的童年” → 搜索角色名、“young”、“childhood”、“memory”、“father”、“mother”、“grew up”等
  2. 并行执行搜索:对每个扩展后的词分别进行搜索
  3. 整合结果:去重并合并不同搜索的结果
这种方法借助Claude的领域知识,能够捕捉到同义词、相关概念和术语变体,而这些是简单关键词搜索无法做到的。

Example

示例

User asks: "What does the book say about the author's research methodology?"
Expand to searches:
  • "methodology"
  • "research"
  • "study"
  • "analysis"
  • "data"
  • "findings"
  • "evidence"
Then consolidate the results into a comprehensive answer.
用户提问:“这本书中关于作者的研究方法有什么内容?”
扩展为以下搜索词:
  • "methodology"
  • "research"
  • "study"
  • "analysis"
  • "data"
  • "findings"
  • "evidence"
然后将结果整合成全面的回答。

Output Format

输出格式

All output is clean Markdown:
  • Headings preserved as
    #
    ,
    ##
    , etc.
  • Lists, links, and emphasis converted properly
  • Excessive whitespace cleaned up
  • Chapter separators included for full extraction
所有输出均为格式整洁的Markdown:
  • 标题保留为
    #
    ##
    等格式
  • 列表、链接和强调格式正确转换
  • 清理多余空白
  • 完整提取时会包含章节分隔符

Examples

示例命令

bash
undefined
bash
undefined

What book is this?

这是哪本书?

node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js metadata "/path/to/book.epub"
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js metadata "/path/to/book.epub"

Show me the chapters

显示章节列表

node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js toc "/path/to/book.epub"
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js toc "/path/to/book.epub"

Read chapter 3

读取第3章

node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js chapter "/path/to/book.epub" 3
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js chapter "/path/to/book.epub" 3

Find all mentions of "democracy"

查找所有提到“democracy”的内容

node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js search "/path/to/book.epub" "democracy"
undefined
node ~/.claude/skills/epub/scripts/epub-reader/dist/index.js search "/path/to/book.epub" "democracy"
undefined

Notes

注意事项

  • Chapter numbers are 1-indexed (first chapter is 1, not 0)
  • Use the
    [ch: N]
    reference from the TOC output to find the correct chapter number
  • Paths with spaces must be quoted
  • Large books may produce substantial output with the
    full
    command
  • Search results show up to 5 matches per chapter with context
  • 章节编号从1开始计数(第一章是1,不是0)
  • 使用目录输出中的
    [ch: N]
    标识来找到正确的章节编号
  • 包含空格的路径必须加引号
  • 大型书籍使用
    full
    命令可能会产生大量输出
  • 搜索结果每个章节最多显示5条带上下文的匹配内容