Skip to content

Enable .mobi (Kindle) format again #1655

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

Merged
merged 2 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.asc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ See link:TRANSLATING.md[the translating document] for more information.
== How To Generate the Book

You can generate the e-book files manually with Asciidoctor.
We used to be able to build .mobi files (Kindle), but cannot do so now, see #1496 for more information.
If you run the following you _may_ actually get HTML, Epub and PDF output files:
If you run the following you _may_ actually get HTML, Epub, Mobi and PDF output files:

----
$ bundle install
Expand All @@ -25,11 +24,13 @@ Converting to HTML...
-- HTML output at progit.html
Converting to EPub...
-- Epub output at progit.epub
Converting to Mobi (kf8)...
-- Mobi output at progit.mobi
Converting to PDF...
-- PDF output at progit.pdf
----

You can generate just one of the supported formats (HTML, EPUB, or PDF).
You can generate just one of the supported formats (HTML, EPUB, mobi, or PDF).
Use one of the following commands:

To generate the HTML book:
Expand All @@ -44,6 +45,12 @@ To generate the EPUB book:
$ bundle exec rake book:build_epub
----

To generate the mobi book:

----
$ bundle exec rake book:build_mobi
----

To generate the PDF book:

----
Expand Down
15 changes: 3 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,9 @@ namespace :book do

desc 'build Mobi format'
task :build_mobi => 'book/contributors.txt' do
# Commented out the .mobi file creation because the kindlegen dependency is not available.
# For more information on this see: #1496.
# This is a (hopefully) temporary fix until upstream asciidoctor-epub3 is fixed and we can offer .mobi files again.

# puts "Converting to Mobi (kf8)..."
# `bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc`
# puts " -- Mobi output at progit.mobi"

# FIXME: If asciidoctor-epub3 supports Mobi again, uncomment these lines below
puts "Converting to Mobi isn't supported yet."
puts "For more information see issue #1496 at https://github.com/progit/progit2/issues/1496."
exit(127)
puts "Converting to Mobi (kf8)..."
`bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc`
puts " -- Mobi output at progit.mobi"
end

desc 'build PDF format'
Expand Down