Skip to content

pressreader/r2-streamer-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Readium-2 Streamer in Go

This project is based on the Readium-2 Streamer architecture that basically takes an EPUB as an input and exposes in HTTP:

  • a Web Publication Manifest based on the OPF of the original EPUB
  • resources from the container (HTML, CSS, images etc.)

It is entirely written in Go using Negroni.

This project is broken down in multiple Go packages that can be used independently from the project:

  • models is an in-memory model of a publication and its components
  • parser is responsible for parsing an EPUB and converting that info to the in-memory model
  • fetcher is meant to access resources contained in an EPUB and pre-process them (decryption, deobfuscation, content injection)

Server Usage

The server binary can be called using a single argument: the location to an EPUB file.

The server will bind itself to an available port on localhost and return a URI pointing to the Web Publication Manifest.

CLI Usage

The cmd/webpub module can be ran with a single argument: the location to an EPUB file.

The output will be the Web Publication Manifest of the input EPUB file.

Building

go build ./cmd/webpub

Running

Output to stdout:

./webpub ./test/moby-dick.epub

Redirect the output to a file:

./webpub ./test/moby-dick.epub > manifest.json

About

A Go implementation of the Readium-2 streamer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%