package main
import (
"fmt"
)
func dump_archive(archive_name string) error {
// Read the archive
archive, err := ReadArchive(archive_name)
if err != nil {
return err
}
// Get a sorted table of contents
toc := ReadTableOfContents(archive["toc.ncx"])
// Print files according to the table of contents
for _, file_name := range toc {
fmt.Println(ReadHtml(archive[file_name]))
}
return nil
}
func main() {
// process arguments
if err := dump_archive("test_docs/the_future_is_female.epub"); err != nil {
fmt.Printf("fatal error: %s\n", err)
}
}