Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate a multi-section ebook? #5

Open
felixding opened this issue Oct 4, 2014 · 2 comments
Open

How to generate a multi-section ebook? #5

felixding opened this issue Oct 4, 2014 · 2 comments

Comments

@felixding
Copy link

First of all thank you for the great work!

I'm trying to generate a ebook looking like this:

dsc_0309

But now I can only get this (only 1 section):

screen shot 2014-10-04 at 10 43 44 am

Here is the code:

book = Kindler::Book.new title: title
book.mobi_type = :magzine
Article.all.each do |article|
  opts = {
      title: article.title,
      author: article.body[:author],
      content: article.body[:content],
      section: article.section
  }
  book.add_article(opts)
end

book.generate
@29decibel
Copy link
Owner

Hi @felixding I am not paying attention to this project for a while, could you tell me if the article has different section?

@TheNotary
Copy link

Hi @29decibel,
I think what he was getting at was the fact that there was only one section named "readability", when there should probably have been more sections. I'm having trouble making multi-section, magzine style mobi files too actually. Here's an example gist:

https://gist.github.com/TheNotary/514f1fb39637a520113b

That should make a TOC with sections labeled news and stories, but instead the output is the article names. I haven't dug into the code too deep yet, but I think the template may need to be modified to support TOCs with sections for many different articles to be dropped into.

Would you have time for a PR in the near future? Btw, thanks for putting this gem together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants