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

Feature/updates guide generation - EPUB #45539

Merged

Conversation

geongeorge
Copy link
Contributor

@geongeorge geongeorge commented Jul 7, 2022

Summary

Update the existing Kindle version of the guide from .mobi to .epub because Amazon is discontinuing support for the .mobi format.

See issue: #45499

  • No specific gem is used to generate the EPUB file outside rubyzip. Since we already had some meta files which we used for the kindlegen tool, The files were only edited to be compatible with the EPUB 2.0.1 specifications

Tested the EPUB on Calibre, Apple books, Kindle Paperwhite (7th Gen), Kindle (10th Gen), ReadEra on android

Additional benefits

  • Removed the copy code button which is currently being shown on the mobi format book
  • Removed unwanted files and size is reduced significantly
    • The current .mobi version: 6.4MB
    • The new .epub version: 2MB
  • Kindlegen is no longer available and is proprietary to Amazon, The EPUB format will ensure the guides are accessible on a wide range of devices and will be compatible for much longer.

Other Information

  • Attaching the epub version to test

ruby_on_rails_guides_fbbdd2b.epub.zip

@rails-bot rails-bot bot added the docs label Jul 7, 2022
Copy link
Member

@eileencodes eileencodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

I know the code for generation was taken from the previous kindle code, but I think there's some room to clean it up as part of this PR so I've left a few comments around style etc.

After making these changes the PR will need to be squashed into 1 commit with a descriptive commit message about what is changing and why. We'll need a changelog entry too noting that mobi is no longer generated and instead we just generate an epub for kindle.

guides/Rakefile Show resolved Hide resolved
guides/rails_guides/epub.rb Outdated Show resolved Hide resolved
guides/rails_guides/epub.rb Outdated Show resolved Hide resolved
guides/rails_guides/epub.rb Outdated Show resolved Hide resolved
guides/rails_guides/epub.rb Outdated Show resolved Hide resolved
guides/rails_guides/epub_packer.rb Outdated Show resolved Hide resolved
guides/rails_guides/epub_packer.rb Outdated Show resolved Hide resolved
guides/rails_guides/markdown/epub_renderer.rb Outdated Show resolved Hide resolved
guides/rails_guides/markdown.rb Outdated Show resolved Hide resolved
@geongeorge
Copy link
Contributor Author

Thank you, @eileencodes, for reviewing this.
I'll make these changes and update this PR

@geongeorge
Copy link
Contributor Author

@eileencodes I have completed doing everything you mentioned.

guides/Rakefile Outdated Show resolved Hide resolved
Removes kindlerb logic

Adds template for epub generator

Renames the kindle dir to /epub

Adds epub module to generator and replaces kindle

Fixes mimetype

Creates basic epub book

Deletes old kindle module

Adds zip package

Updates rubyzip gem name

Removes now unused gepub gem

Adds the required container file for epubs

Fixes media type

Adds new epub generation logic

Removes all buttons from output html

Refactors and generates valid epub files

Removes frontmatter logic used for kindlegen

Filters out epub files in zip

Updates link to kindle doc on sidebar

Fixes rubocop issues

Adds deprecation warning for the old kindle task

Refactors and cleans up epub module

Cleans up epub code

Cleans up private internal method code style

Removes unnecessary imagemagick check
@geongeorge geongeorge force-pushed the feature/updates-guide-generation-epub branch from c21716c to 56e96d9 Compare August 4, 2022 18:48
@eileencodes eileencodes merged commit 914ac17 into rails:main Aug 4, 2022
@eileencodes
Copy link
Member

Thanks @geongeorge for taking on this task and congrats on your first PR to Rails 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants