Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - How to generate an EPUB file on Fedora

#1
How to generate an EPUB file on Fedora

It is becoming more popular to read content on smartphones. Every phone comes with its own ebook reader. Believe or not, it is very easy to create your own ebook files on Fedora.

This article shows two different methods to create an EPUB. The epub format is one of the most popular formats and is supported by many open-source applications.

Most people will ask “Why bother creating an EPUB file when PDFs are so easy to create?” The answer is: “Have you ever tried reading a sheet of paper when you can only see a small section at a time?” In order to read a PDF you have to keep zooming and moving around the document or scale it down to a small size to fit the screen. An EPUB file, on the other hand, is designed to fit many different screen types.

Method 1: ghostwriter and pandoc


This first method creates a quick ebook file. It uses a Markdown editor named ghostwriter and a command-line document conversion tool named pandoc.

You can either search for them and install them from the Software Center or you can install them from the terminal. If you are going to use the terminal to install them, run this command: sudo dnf install pandoc ghostwriter.

For those who are not aware of what Markdown is, here is a quick explanation. It is a simple markup language created a little over 15 years ago. It uses simple syntax to format plain text. Markdown files can then be converted to a whole slew of other document formats.

ghostwriter

Now for the tools. ghostwriter is a cross-platform Markdown editor that is easy to use and does not get in the way. pandoc is a very handy document converting tool that can handle hundreds of different formats.

To create your ebook, open ghostwriter, and start writing your document. If you have used Markdown before, you may be used to making the title of your document Heading 1 by putting a pound sign in front of it. Like this: # My Man Jeeves. However, pandoc will not recognize that as the title and put a big UNTITLED at the top of your ebook. Instead put a % in front of your title. For example, % My Man Jeeves. Sections or chapters should be formatted as Heading 2, i.e. ## Leave It to Jeeves. If you have subsections, use Heading 3 (###).


Once your document is complete, click File -> Export (or press Ctrl + E). In the dialog box, select between several options for the Markdown converter. If this is the first time you have used ghostwriter, the Sundown converter will be picked by default. From the dialog box, select pandoc. Next click Export. Your EPUB file is now created.

ghostwriter export dialog box

Note: If you get an error saying that there was an issue with pandoc, turn off Smart Typography and try again.

Method 2: calibre


If you want a more polished ebook, this is the method that you are looking for. It takes a few more steps, but it’s worth it.


First, install an application named calibre. calibre is not just an ebook reader, it is an ebook management system. You can either install it from the Software Center or from the terminal via sudo dnf install calibre.

In this method, you can either write your document in LibreOffice, ghostwriter, or another editor of your choice. Make sure that the title of the book is formatted as Heading 1, chapters as Heading 2, and sub-sections as Heading 3.

Next, export your document as an HTML file.

Now add the file to calibre. Open calibre and click “Add books“. It will take calibre a couple of seconds to add the file.


Once the file is imported, edit the file’s metadata by clicking on the “Edit metadata” button. Here you can fill out the title of the book and the author’s name. You can also upload a cover image (if you have one) or calibre will generate one for you.


Next, click the “Convert books” button. In the new dialog box, select the “Look & Feel” section and the “Layout” tab. Check the “Remove spacing between paragraphs” option. This will tighten up the contents as indent each paragraph.


Now, set up the table of contents. Select the “Table of Contents” section. There are three options to focus on: Level 1 TOC, Level 2 TOC, and Level 3 TOC. For each, click the wand at the end. In this new dialog box, select the HTML tag that applies to the table of contents entry. For example, select h1 for Level 1 TOC and so on.


Next, tell calibre to include the table of contents. Select the “EPUB output” section and check the “Insert Inline Table of Contents“. To create the epub file, click “OK“.


Now you have a professional-looking ebook file.



https://www.sickgaming.net/blog/2020/06/...on-fedora/
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Contribute to Fedora 39 Upgrade, Virtualization, and Cloud Test Day xSicKxBot 0 3,784 09-30-2023, 03:56 AM
Last Post: xSicKxBot
  Fedora - Share your game achievements with Gamerzilla xSicKxBot 0 2,121 09-27-2023, 09:59 AM
Last Post: xSicKxBot
  Fedora - Using Cockpit to graphically manage systems, without installing Cockpit on xSicKxBot 0 1,987 09-26-2023, 06:41 AM
Last Post: xSicKxBot
  Fedora - Announcing Fedora Linux 39 Beta xSicKxBot 0 2,011 09-20-2023, 09:48 AM
Last Post: xSicKxBot
  Fedora - Contribute at Passkey Auth, Fedora CoreOS and IoT Test Week xSicKxBot 0 2,031 09-19-2023, 12:23 PM
Last Post: xSicKxBot
  Fedora - Quick Fedora shirt update and sale of last stock with the old logo xSicKxBot 0 2,051 09-16-2023, 12:28 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Linux Test Week for Kernel 6.5 and Toolbx Test Day xSicKxBot 0 2,234 09-11-2023, 02:47 PM
Last Post: xSicKxBot
  Fedora - Fedora Linux Flatpak cool apps to try for September xSicKxBot 0 1,976 09-10-2023, 04:59 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Test Week for the Anaconda WebUI Installer for Fedora Wor xSicKxBot 0 1,997 09-09-2023, 11:54 PM
Last Post: xSicKxBot
  Fedora - Docs workshop: Virtually writing together xSicKxBot 0 2,005 09-09-2023, 05:08 AM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:

Forum software by © MyBB Theme © iAndrew 2016