output

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator struct {
	// Epub is the data model containing all book information.
	Epub *epub.Epub
	// contains filtered or unexported fields
}

Creator handles the physical assembly of the EPUB file. It coordinates the writing of structural files, stylesheets, images, and content into a ZIP-compressed stream.

func NewCreator

func NewCreator(e *epub.Epub, writer io.Writer) *Creator

NewCreator initializes a new Creator with a target io.Writer (e.g., an os.File) and prepares the underlying ZIP engine.

func (*Creator) AddFile

func (c *Creator) AddFile(fileContent files.FileContent[[]byte]) error

AddFile is a method that creates a new file entry in the ZIP archive and writes the provided byte content to it.

func (*Creator) Create

func (c *Creator) Create() error

Create executes the multi-step process of building an EPUB. It handles mandatory files (mimetype, container), resources (CSS, images), recursive content generation, and final manifest (OPF/NCX) creation. It automatically closes the ZIP writer upon completion.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL