Building an eBook Editor and Generator

In this chapter, we are going to build an Electron application that allows users to author markdown documents and generate electronic books as a result. You are going to learn how to use the Monaco Editor by Microsoft in your Electron applications and how to process text with Pandoc (https://pandoc.org/) by utilizing Docker containers.

Why do we need Pandoc as a Docker container rather than as a standalone installation? The typical installation of Pandoc utils is pretty huge, and the setup instructions depend on the type of platform you are using. Moreover, you may need to install various supplementary tools, as well as keep them up to date.

With Docker, you get an image of Pandoc that is universal across all platforms. Besides, the containers are isolated from your operating system. When you don't need Pandoc on your machine, you can delete its containers and images so that you have no unused files in your filesystem.

If you need a new version of the tools, you can fetch a new image from the Docker registry and get some new tools up and running. There's no need for any additional installation steps. The project build time is about two hours.

In this chapter, we will cover the following topics:

  • Creating the project structure
  • Updating the code to use React Hooks
  • Controlling keyboard shortcuts
  • Integrating with the application menu
  • Setting up the book generator
  • Invoking Docker commands from Electron
  • Generating PDF books
  • Generating ePub books

Let's start our journey by creating the project structure, which is based on the React web application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.154.151