3

I'm looking for something that would let me create ebooks containing high-resolution pictures from the command-line.

The reason I'm looking for cli is so the process can be scripted.

EDIT: The goal is to create an epub and the source are text and images, think picture book, just with more text.

8
  • Do you mean .epub, or maybe .pdf. What is the source, only photos?
    – NVRM
    Commented Apr 2, 2021 at 15:17
  • Epub, source is text and photos. Think picture book.
    – Ocean
    Commented Apr 2, 2021 at 15:17
  • 1
    Did you ever take a look at Calibre? That's what I use for this purpose. But in order to get a properly formated EPUB out, you must have some structured input. Plain text will hardly do. HTML does fine (that's what I'm using to write my books, or to create eBooks from different sources – see my eBook server). While Calibre does have a GUI, I rarely ever use that – all my work is done from the command line.
    – Izzy
    Commented Apr 2, 2021 at 23:30
  • 1
    I know about GUI Calibre, but I can't find any resources on how it would work from the command line. Maybe you could write an answer showcasing how that would work?
    – Ocean
    Commented Apr 3, 2021 at 10:08
  • 1
    You have the possibility to create an ebook in makdown, using then the pandoc software. See here for example. But not sure this is the kind of thing you are looking for.
    – Damien
    Commented Apr 3, 2021 at 15:39

2 Answers 2

1

You have the possibility to create an ebook in makdown, using then the pandoc software.

You will get all information here: Creating an ebook with pandoc

pandoc is available for Windows, linux, macOS, Chrome OS.

Here is a few information extracted from this site.

A simple example:

% My Book
% Sam Smith

This is my book!

# Chapter One

Chapter one is over.

# Chapter Two

Chapter two has just begun.

And you can generate the .epub with the command

pandoc mybook.txt -o mybook.epub

You can simply insert images as usually in markdown:

![Imag](images/ex.jpg)

Things become more tricky if you want to personalise the format of the book. You will need for example to write a specific .css file.

However, if you want to build many books with basically the same format, a single .css file can be used for all.

1

I would suggest taking a look at the Sphinx-Doc project - it can take a set of ReStructuredText (similar to markdown) &/or Markdown pages including place holders for images in a number of formats and from the command line, or a continuous integration process, "make" documents in a number of formats.

  • Free, Gratis & Open Source (BSD License)
  • Output formats: HTML (including Windows HTML Help), LaTeX (for printable PDF versions), ePub, Texinfo, manual pages, plain text.
  • Hierarchical structure: easy definition of a document tree, with automatic links to siblings, parents and children

Installation:

  1. Install Python3 and pip if you don't already have them
  2. apt-get install python3-sphinx or equivalent on Linux or pip install -U sphinx on any platform
  3. I would also recommend pip install Pillow for the image editing facilities that it offers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.