Ibis Book Maker

Published on by

Ibis Book Maker image

Ibis is a new app from Mohamed Said that helps you publish eBooks from markdown files and includes features for generating both light and dark ebooks, as well as the ability to choose your own fonts and more.

Ibis generates ebooks from your markdown files with:

  1. A cover photo.
  2. Clickable auto-generated table of contents.
  3. Code syntax highlighting.
  4. Available in 2 themes. Light and dark.

Here is what both modes look like using the samples from Mohamed’s new ebook Laravel Queues in Action:

Let’s take a look a look at how to create your own ebook with Ibis.

Ibis Installation

To get started publishing your first book with ibis first run the installation:

composer global require themsaid/ibis

Next, create a directory where you are going to house your ebook:

ibis init

After running the init command you’ll now have the following directory structure:

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

Creating your first ebook

Now that you have the basic setup ready the first step is to edit the ibis.php file which is an array of settings.

<?php
 
return [
/**
* The book title.
*/
'title' => 'My First Ebook',
 
 
/**
* The author name.
*/
'author' => 'Eric L. Barnes',
 
/**
* The list of fonts to be used in the different themes.
*/
'fonts' => [
// 'calibri' => 'Calibri-Regular.ttf',
// 'times' => 'times-regular.ttf',
],
 
/**
* Page ranges to be used with the sample command.
*/
'sample' => [
[1, 3],
],
 
/**
* A notice printed at the final page of a generated sample.
*/
'sample_notice' => 'This is a sample from "My First Ebook" by Eric L. Barnes. <br>
For more information, <a href="https://laravel-news.com/">Click here</a>.',
];

Note: The fonts are commented out. If you wish to use your own fonts add the .ttf files to an assets/fonts directory and point to the filenames in the config.

Creating your content

The next step is to create your content in markdown. You can either create one huge markdown file or break it up however you wish into chapters or sections. The main thing to notice is when you build your ebook it will scan the content directory in alphabetical order, so you should following a naming pattern that puts things in the proper order for your book. For example, in my demo book I named the files:

./1-introduction.md
./chapter1.md
./chapter2.md

Once you have all the files in place it’s time to add your ebook cover image. This image should be around 2481 × 3508 pixels and placed in the ./assets directory and named cover.jpg

After you’ve done that you can now build the first version of your book by running:

ibis build

By default, this will create a light version but you can also create a dark version with:

ibis build dark

The pdf for these will be generated complete with a cover image, a table of contents, and placed in your ./export/ folder.

Generating A Sample Ebook

Now that you have the basics of generating your ebook for publication you might want to sell it, but also give away certain parts as a free sample. If that is the case, Ibis has you covered with the ability to generate samples. Open up your ./ibis.php file again and scroll down and edit the sample and sample_notice sections:

'sample' => [
[1, 3],
],
 
/**
* A notice printed at the final page of a generated sample.
*/
'sample_notice' => 'This is a sample from "My First Ebook" by Eric L. Barnes. <br>
For more information, <a href="https://laravel-news.com/">Click here</a>.',

From here you can define the sample pages you want to export and a notice to appear at the end of the book. This will allow you to export certain chapters or sections with a link to buy the full version or some other notice. To generate this all you need to do is run:

ibis sample

It’ll process it and put this sample PDF in the same export folder.

Wrap Up

Hopefully, this gives you a quick overview of Ibis and how it all works for building ebooks. I had the pleasure of using it to build an ebook titled “Your First Laravel App” and I’m giving this away free when you join our weekly Laravel newsletter. You should also check out Mohamed’s Learn Laravel Queues and give Ibis a try when you want to publish your next ebook. It’s a simple yet powerful app.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate

Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Asymmetric Property Visibility in PHP 8.4 image

Asymmetric Property Visibility in PHP 8.4

Read article
Access Laravel Pulse Data as a JSON API image

Access Laravel Pulse Data as a JSON API

Read article
Laravel Forge adds Statamic Integration image

Laravel Forge adds Statamic Integration

Read article
Transform Data into Type-safe DTOs with this PHP Package image

Transform Data into Type-safe DTOs with this PHP Package

Read article
PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell image

PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell

Read article
Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3 image

Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3

Read article