/ebook-with-asciidoctor

Free and Open Source code to automate your ebook! Get your .pdf, .epub, and .mobi in seconds running a single command! Clone this project and start your eBook today!

Primary LanguageJavaScriptMIT LicenseMIT

Launch your best content today! Free and Open Source code to automate your ebook!

Travis (.com) GitHub release GitHub issues GitHub License

To create your own ebook is super simple: clone this project and start writing!

Note

And now you don’t need to worry about the release process because it’s fully automated! Follow all the instructions from automated-release project and config your onw project.

This configuration optional. You can stay releasing manually your ebook if you want.

Basically you only need to configure you GitHub Personal Access Token and enable Travis-CI. Ok! Now you are going to need Node.js installed to make sure you are respecting conventional-commits pattern. But again, the automated versioning is optional.

Take a look at all the automated releases generated by those Pull Requests and the good looking release page. You only need to write good commits to have all this. 😄

The latest release (or maybe the first one o/) of this project is already automated.

Getting Started in One Minute

  1. Clone the project

    git clone https://github.com/rcmoutinho/ebook-with-asciidoctor.git
  2. Generate the eBook

    docker-compose run --rm ebook

DONE!

Project Files
Figure 1. Check your eBook on the book-release folder.
Overview from this automated eBook
Figure 2. Overview from PDF format

Configure Your eBook

Although the project has lots of configuration, you just need to focus on the following topics:

  1. Fill the file automated-ebook.asc with the right information. Here you will need to change the book name, author, and maybe the number of levels on the table of contents (:toclevels:, the default is configured to 3).

  2. At the same file, adjust chapters file names. You can add, remove or rename. You are in charge here.

  3. Last but not least, create your chapters! The first chapter has lots of tips about how to deal with Asciidoctor syntax, but you can also check the documentation to get more details.

You can also change the file cover.png with your own book cover. The size of this image is 1050x1600. You can use canva.com to create your design. It’s FREE. But the default size there is 1410x2250, so you will need to resize and fit after downloading (not a problem).

Generate Your eBook

To simplify things, let’s use Docker to automate book generation. Make sure you have it installed.

Each file from the eBook (HTML, Epub, Mobi e PDF) will be generated by using the image oficial image of Asciidoctor. Super easy!

Execute one of the following commands, according to your OS, on the project’s root folder:

# linux / unix
docker run --rm -v $(pwd):/documents/ asciidoctor/docker-asciidoctor scripts/docker-startup.sh

# others (change <path> with the full path of the current directory)
docker run --rm -v <path>:/documents/ asciidoctor/docker-asciidoctor scripts/docker-startup.sh

Or use Docker Compose command to be able to type faster and avoid all parameters (already configured on docker-compose.yml):

docker-compose run --rm ebook

More about Asciidoctor

Projects Using This Format

Send a Pull Request with your project’s URL that uses this project 😄

References

The project progit2 was used as a reference to create this step-by-step process to automate this ebook. The reference’s ebook is available at git-scm.com/book.