Skip to content

n3integration/epub

 
 

Repository files navigation

epub

A pure go implementation of epub file format.

Codeship Status for n3integration/epub codecov Go Report Card Documentation

Usage

import (
  "bytes"
  "fmt"
  "io"

  "github.com/n3integration/epub"
)

func main() {
+ // 1. Open the epub by passing its file path
  f := "some.epub"
  book, err := epub.Open(f)
  defer book.Close()

+ // 2. Iterate over book sections
  book.Each(func(title string, xhtml io.ReadCloser) {
+   // 3. Read and process section contents
    buf := new(bytes.Buffer)
    buf.ReadFrom(xhtml)

    fmt.Println("==========================================================")
    fmt.Println(title)
    fmt.Println("==========================================================")
    fmt.Println(buf.String())
  })
}

Reference

About

Epub parser library for golang

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%