gepub icon indicating copy to clipboard operation
gepub copied to clipboard

Smart autofix features

Open 127 opened this issue 11 years ago • 4 comments

What about some «clever features»:

  1. auto add xml declaration if does not exist <?xml version="1.0" encoding="utf-8"?>
  2. auto fix if <html> to valid <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="ru-RU" lang="en-EN">
  3. set valid xml notation via applying nokogiri preparsing to enpacked xhtml (will quickfix forgotten /> etc)

127 avatar Jul 02 '14 13:07 127

Thanks. These features look good for me.

But gepub still have some important but missing features (e.g. API to traverse EPUB) to be implemented, so I can not work on this feature request yet. Maybe after release of version 1.0.

Pull request for these features are welcome.

skoji avatar Jul 03 '14 03:07 skoji

Ok, I'll try to implement. How do you see it (as far as I don't want to intrude your architecture :-) )? As a parametric feature on setting up constructor or just a couple of methods respectively?

127 avatar Jul 03 '14 08:07 127

How about API like this?

book = GEPUB::Book.new {
  |book|
  # add resources
}

book.normalize_content_xhtml
book.generate_epub('path_to_epub.epub')

skoji avatar Jul 04 '14 04:07 skoji

Ok, will try )

127 avatar Jul 07 '14 13:07 127