Giter VIP home page Giter VIP logo

Comments (4)

jaytaph avatar jaytaph commented on July 1, 2024

That is actually a very cool idea. I will check it out, and see if we can automatically generate EPUB and PDFs.

from restcookbook.

jaytaph avatar jaytaph commented on July 1, 2024

I've checked the extension and it seems to generate an EPUB. However, it seems that the epub is invalid. I figured that the content.opf file that is added to the epub is actually empty.

It's probably me doing something not right, but I'll check https://github.com/lmullen/jekyll-ebook, to see if that will work.

from restcookbook.

jaytaph avatar jaytaph commented on July 1, 2024

jekyll-ebook doesn't seem to be really working. However, I got the jekyll-epub working with some modifcations to the epub.rb in the library:

157c157,159

< File.open( File.join( self.dest, tmpl ), "w+" ).puts template_content

  f = File.open( File.join( self.dest, tmpl ), "w+" );
  f.puts template_content
  f.close()

Since the generated files weren't closed, they weren't flushed to disk yet, resulting in empty files on disk. These empty files were zipped later on, and it's not until later that the system flushed the data to disk. In result the files looks correctly on disk, but were empty in the epub-zip file. This is fixed by actually closing the files, which results in a flush so they are properly zipped. I don't know if this is an jekyll-epub issue, but if so, it's a simple patch I guess.

from restcookbook.

jaytaph avatar jaytaph commented on July 1, 2024

So, in order to get this working:

  • gem install jekyll-epub
  • patch the epub.rb file
  • run jekyll-epub so both the site and epub gets generated
  • add a link to the site with the epub?

Initial work can be found at https://github.com/jaytaph/restcookbook/tree/wip/epub

from restcookbook.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.