Skip to content

Latest commit

 

History

History
 
 

epub

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

epub

Minimal epub library written in Go

GoDoc

Installation

go get github.com/taylorskalyo/goreader/epub

Basic usage

import "github.com/taylorskalyo/goreader/epub"

rc, err := epub.OpenReader(os.Args[1])
if err != nil {
	panic(err)
}
defer rc.Close()

// The rootfile (content.opf) lists all of the contents of an epub file.
// There may be multiple rootfiles, although typically there is only one.
book := rc.Rootfiles[0]

// Print book title.
fmt.Println(book.Title)

// List the IDs of files in the book's spine.
for _, item := range book.Spine.Itemrefs {
	fmt.Println(item.ID)
}