Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 22, 2021 06:38 am GMT

How to create an eBook from Markdown using Ibis?

Introduction

A few months ago I wrote two open-source eBooks:

GitHub logo bobbyiliev / introduction-to-bash-scripting

Free Introduction to Bash Scripting eBook

Introduction to Bash Scripting

This is an open-source introduction to Bash scripting guide/ebook that will help you learn the basics of Bash scripting and start writing awesome Bash scripts that will help you automate your daily SysOps, DevOps, and Dev tasks. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Bash scripts to combine different Linux commands and automate boring and repetitive daily tasks, so that you can focus on more productive and fun things.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Bash scripting.

Download

To download a copy of the ebook use one of the following links:

Chapters

The first 13 chapters would be purely focused on getting some solid Bash scripting foundations then the rest of the

GitHub logo bobbyiliev / introduction-to-git-and-github-ebook

Free Introduction to Git and GitHub eBook

Introduction to Git and GitHub

This is an open-source introduction to Git and GitHub guide that will help you learn the basics of version control and start using Git for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Git to track your code changes and collaborate with other members of your team or open source maintainers.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Git, GitHub and version control in general.

Download

To download a copy of the ebook use one of the following links:

Chapters

  • About the book
  • Introduction to Git
  • Version Control
  • Installing Git
  • Basic Shell Commands
  • Git Configuration
  • Introduction to GitHub
  • Initializing a Git project
  • Git Status
  • Git Add
  • Git

This is when I came across a tool called Ibis created by Mohamed Said who is a Developer at Laravel.

Ibis allows you to generate an awesome PDF for your eBook, and you can just use markdown!

In this tutorial, I will show you how to get started with Ibis and write that eBook that you have always been planning to write!

Prerequisites

You need to have Composer installed, if you don't have it yet, you can follow the steps here:

How to install Composer

Installation

In order to install Ibis, all that you need to do is run the following composer command:

composer global require themsaid/ibis

After the installation, you can test if the ibis command is available with the following:

ibis -V

Once you are sure that you have the Ibis command line tool installed, you can instantiate a new project with the following command:

ibis init

Note: Make sure to run the command in an empty directory where you would store your Markdown files later on

The init command will generate the following files:

/assets/assets/fonts/assets/cover.jpg/assets/theme-light.html/assets/theme-dark.html/content/ibis.php

You can modify the /assets/theme-light.html and the /assets/theme-dark.html to change any of the styles for the eBook. For example, I like to increase the size of the text and the line spacing a little bit.

Configuration

In order to configure ibis all that you need to do is change the values in the ibis.php file.

The main settings would be:

  • title: The title of your eBook
  • author: Your anme
  • sample: Page ranges to be used with the sample command
  • sample_notice: A notice printed at the final page of a generated sample

Creating a cover photo

There is an awesome tool that you could use for free to generate your cover photo:

If you ever need to create a graphic, poster, invitation, logo, presentation or anything that looks good give Canva a go!

To change the cover photo, just substitute the default /assets/cover.jpg with your image!

Markdown files

With the above, you can then start writing your eBook! The content would be stored in the content folder where you will have to add your Markdown files.

Ibis would read all of the .md files in the content folder and would use all h1 titles as the name of the chapters.

If you are not familiar with Markdown, make sure to check out this guide here.

Building the PDF

Once you have your content ready, in order to build the PDF of your eBook, just use the following commands

  • Light mode
ibis build
  • Dark mode
ibis build dark

If you want to generate a sample of your eBook use the following commands:

  • Light mode sample:
ibis sample
  • Dark mode sample:
ibis sample dark

Once you run the command, it will generate your PDF and store them in the export folder.

The output that you will see would look like this:

==> Preparing Export Directory ...==> Parsing Markdown ...==> Adding Book Cover ...==> Building PDF ...==> Writing PDF To Disk ... 34 PDF pages Book Built Successfully!

Conclusion

If you like the Ibis tool, make sure to star it on GitHub and contribute!

If you publish your own eBook make sure to let me know by tagging me on Twitter @bobbyiliev_!

Hope that this helps!


Original Link: https://dev.to/bobbyiliev/how-to-create-an-ebook-from-markdown-using-ibis-keg

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To