Sick Gaming
Fedora - How to generate an EPUB file on Fedora - Printable Version

+- Sick Gaming (https://www.sickgaming.net)
+-- Forum: Computers (https://www.sickgaming.net/forum-86.html)
+--- Forum: Linux, FreeBSD, and Unix types (https://www.sickgaming.net/forum-88.html)
+--- Thread: Fedora - How to generate an EPUB file on Fedora (/thread-95513.html)



Fedora - How to generate an EPUB file on Fedora - xSicKxBot - 06-06-2020

How to generate an EPUB file on Fedora

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora.jpg" width="1024" height="640" title="" alt="" /></div><div><p>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.</p>
<p>This article shows two different methods to create an <a href="https://en.wikipedia.org/wiki/EPUB">EPUB</a>. The epub format is one of the most popular formats and is supported by many open-source applications.</p>
<p>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.</p>
<p> <span id="more-31075"></span> </p>
<h2>Method 1: ghostwriter and pandoc</h2>
<p>This first method creates a quick ebook file. It uses a Markdown editor named <a href="https://github.com/wereturtle/ghostwriter">ghostwriter</a> and a command-line document conversion tool named <a href="https://pandoc.org/">pandoc</a>.</p>
<p>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: <em>sudo dnf install pandoc ghostwriter</em>.</p>
<p>For those who are not aware of what <a href="https://fedoramagazine.org/applications-for-writing-markdown/">Markdown</a> 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.</p>
<div class="wp-block-image">
<figure class="aligncenter size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora.jpg" alt="" class="wp-image-31118" /><figcaption>ghostwriter</figcaption></figure>
</div>
<p>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.</p>
<p>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: <em># My Man Jeeves</em>. However, pandoc will not recognize that as the title and put a big UNTITLED at the top of your ebook. Instead put a <em>%</em> in front of your title. For example, <em>% My Man Jeeves</em>. Sections or chapters should be formatted as Heading 2, i.e.<em> ## Leave It to Jeeves</em>. If you have subsections, use Heading 3 (<em>###</em>). </p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-1.jpg" alt="" class="wp-image-31120" /></figure>
<p>Once your document is complete, click <em>File</em> -&gt; <em>Export</em> (or press <em>Ctrl</em> + <em>E</em>). 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 <em>Export</em>. Your EPUB file is now created.</p>
<div class="wp-block-image">
<figure class="aligncenter size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-2.jpg" alt="" class="wp-image-31119" /><figcaption>ghostwriter export dialog box</figcaption></figure>
</div>
<p>Note: If you get an error saying that there was an issue with pandoc, turn off <em>Smart Typography</em> and try again.</p>
<h2>Method 2: calibre</h2>
<p>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.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-3.jpg" alt="" class="wp-image-31115" /></figure>
<p>First, install an application named <a href="https://calibre-ebook.com/">calibre</a>. 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 <em>sudo dnf install calibre</em>.</p>
<p>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.</p>
<p>Next, export your document as an HTML file.</p>
<p>Now add the file to calibre. Open calibre and click “<em>Add books</em>“. It will take calibre a couple of seconds to add the file.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-4.jpg" alt="" class="wp-image-31113" /></figure>
<p>Once the file is imported, edit the file’s metadata by clicking on the “<em>Edit metadata</em>” 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.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-5.jpg" alt="" class="wp-image-31112" /></figure>
<p>Next, click the “<em>Convert books</em>” button. In the new dialog box, select the “<em>Look &amp; Feel</em>” section and the “<em>Layout</em>” tab. Check the “<em>Remove spacing between paragraphs</em>” option. This will tighten up the contents as indent each paragraph.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-6.jpg" alt="" class="wp-image-31117" /></figure>
<p>Now, set up the table of contents. Select the “<em>Table of Contents</em>” 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 <em>h1</em> for Level 1 TOC and so on.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-7.jpg" alt="" class="wp-image-31111" /></figure>
<p>Next, tell calibre to include the table of contents. Select the “<em>EPUB output</em>” section and check the “<em>Insert Inline Table of Contents</em>“. To create the epub file, click “<em>OK</em>“.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/06/how-to-generate-an-epub-file-on-fedora-8.jpg" alt="" class="wp-image-31114" /></figure>
<p>Now you have a professional-looking ebook file.</p>
</div>


https://www.sickgaming.net/blog/2020/06/04/how-to-generate-an-epub-file-on-fedora/