← 返回 Skills 市场
tobewin

Epub Studio

作者 ToBeWin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
192
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install epub-studio
功能描述
EPUB电子书生成器。Use when user wants to create professional EPUB ebooks from Markdown, text, or structured content. Supports chapters, TOC, cover image, metadata....
使用说明 (SKILL.md)

EPUB Studio

专业EPUB电子书生成器,支持Markdown转EPUB、多章节、目录、封面。

Features

  • 📚 EPUB格式: 标准EPUB 3.0格式
  • 📑 多章节: 自动生成章节
  • 📋 目录: 自动生成TOC
  • 🖼️ 封面: 支持封面图片
  • 📝 Markdown输入: 从Markdown生成
  • 跨平台: 支持所有电子书阅读器

Trigger Conditions

  • "生成电子书" / "Create ebook"
  • "做一本EPUB" / "Make EPUB"
  • "Markdown转EPUB"
  • "epub-studio"

Python Code

import os
from ebooklib import epub

class EpubGenerator:
    def __init__(self, title, author='Unknown', language='zh'):
        self.book = epub.EpubBook()
        self.book.set_title(title)
        self.book.set_language(language)
        self.book.add_author(author)
        self.chapters = []
        
    def add_chapter(self, title, content, filename=None):
        """Add a chapter"""
        if filename is None:
            filename = f'chapter_{len(self.chapters)+1}.xhtml'
        
        chapter = epub.EpubHtml(title=title, file_name=filename)
        chapter.content = f'\x3Ch1>{title}\x3C/h1>{content}'
        
        self.book.add_item(chapter)
        self.chapters.append(chapter)
        return chapter
    
    def add_markdown_chapters(self, markdown_content):
        """Split markdown into chapters"""
        sections = markdown_content.split('\
# ')
        
        for i, section in enumerate(sections):
            if not section.strip():
                continue
            
            lines = section.split('\
')
            title = lines[0].replace('#', '').strip()
            content = '\x3Cbr>'.join(lines[1:])
            
            self.add_chapter(title, content)
    
    def add_cover(self, image_path):
        """Add cover image"""
        with open(image_path, 'rb') as f:
            cover_image = f.read()
        
        self.book.set_cover('cover.jpg', cover_image)
    
    def set_toc(self):
        """Generate table of contents"""
        self.book.toc = self.chapters
        
        # Add navigation
        self.book.add_item(epub.EpubNcx())
        self.book.add_item(epub.EpubNav())
    
    def add_spine(self):
        """Set reading order"""
        self.book.spine = ['nav'] + self.chapters
    
    def save(self, output_path):
        """Save EPUB file"""
        self.set_toc()
        self.add_spine()
        
        epub.write_epub(output_path, self.book, {})
        return output_path

# Example
gen = EpubGenerator('My Book', author='Author Name')
gen.add_chapter('Chapter 1', '\x3Cp>Content here...\x3C/p>')
gen.add_chapter('Chapter 2', '\x3Cp>More content...\x3C/p>')
gen.save('output.epub')

Usage

User: "帮我把这篇Markdown做成电子书"
Agent: 使用 EpubGenerator 生成EPUB

User: "创建一本3章的电子书"
Agent: 分章生成EPUB

Notes

  • 使用ebooklib库
  • 支持标准EPUB 3.0格式
  • 兼容所有电子书阅读器
  • 支持中英文
安全使用建议
This skill appears to do what it says: generate EPUB files from Markdown using Python and ebooklib. Before installing/running: (1) ensure python3 and the ebooklib package are installed in a safe environment (the skill does not auto-install it); (2) avoid passing paths to sensitive local files as the cover image argument (the code will read any file you provide); (3) be aware the Markdown splitting is simple and not sanitized — review or sanitize input if it may contain untrusted HTML; (4) if you need network-isolated execution or bundle installation policies, run this in a sandbox or virtualenv. Overall the skill is coherent and proportionate to its stated purpose.
功能分析
Type: OpenClaw Skill Name: epub-studio Version: 1.0.0 The epub-studio skill bundle is a legitimate utility for generating EPUB ebooks from Markdown or text. The Python code in SKILL.md uses the standard 'ebooklib' library to handle ebook structure, chapters, and covers, with no evidence of data exfiltration, malicious execution, or harmful prompt injection. All functions are aligned with the stated purpose of the tool.
能力评估
Purpose & Capability
Name and description describe an EPUB generator. The SKILL.md provides Python code using ebooklib and the skill declares python3 as a required binary. These requirements are appropriate and proportionate for producing EPUB files from Markdown/cover images.
Instruction Scope
The runtime instructions include a complete Python EpubGenerator implementation that stays within ebook creation: adding chapters, cover image (reads a local image path), building TOC/spine, and writing an output EPUB. There is no network access, external endpoints, or requests for unrelated files/env vars. Note: the Markdown-to-chapter splitting is simplistic and there is no input sanitization — it will read any local image path provided as a cover, so users should avoid passing sensitive filesystem paths.
Install Mechanism
This is an instruction-only skill with no install spec. The metadata mentions the dependency string 'pip install ebooklib' but the skill does not perform or declare an automated install. Users or the runtime will need to ensure ebooklib is available; missing dependency will cause runtime failure, but this is not a security concern by itself.
Credentials
No environment variables, credentials, or config paths are requested. The skill does not attempt to access unrelated secrets or cloud credentials — environment/credential requirements are minimal and appropriate.
Persistence & Privilege
The skill does not request permanent/always-on presence and uses normal model invocation rules. It does not modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install epub-studio
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /epub-studio 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
EPUB电子书生成器:支持多章节、目录、封面,兼容所有电子书阅读器
元数据
Slug epub-studio
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Epub Studio 是什么?

EPUB电子书生成器。Use when user wants to create professional EPUB ebooks from Markdown, text, or structured content. Supports chapters, TOC, cover image, metadata.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 192 次。

如何安装 Epub Studio?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install epub-studio」即可一键安装,无需额外配置。

Epub Studio 是免费的吗?

是的,Epub Studio 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Epub Studio 支持哪些平台?

Epub Studio 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Epub Studio?

由 ToBeWin(@tobewin)开发并维护,当前版本 v1.0.0。

💬 留言讨论