apub - Overview
apub is a python package with command line interface to turn markdown files into ebooks.
Created to make publishing stories a lot easier for myself.
- Free software: MIT
- Official page: https://anited.de/apub
- Documentation: https://apub.readthedocs.org.
Write your book entirely in markdown.
Use whatever text editor you like, as long as it produces utf8 plain text files.
(If you don't have a favourite text editor yet, go take a look at Graeme Gott's excellent FocusWriter. You will not regret it.)
Describe your project and desired output in a simple python file.
A simple project might look like this:
from apub.book import Book, Chapter from apub.output import HtmlOutput, EbookConvertOutput from apub.substitution import SimpleSubstitution book = Book( title='Example', authors='Max Mustermann', language='en') book.chapters.extend( [Chapter(source='first_chapter.md'), Chapter(source='second_chapter.md')]) substitution = SimpleSubstitution( old='Cows', new='Substitutions') html_output = HtmlOutput( path='example.html', css_path='style.css') html_output.make(book, [substitution]) ebook_output = EbookConvertOutput( path='example.epub', css_path='style.css') ebook_output.make(book, [substitution])
Given the above is saved in a file
my_project.pyand the markdown files are present, the output
my_book.htmlcan be created by executing
on the command line.
Unix/Linux users might have to call python3 instead, depending on their distribution.
A more in depth guide to apub including additional features like multiple outputs, default outputs, text substitutions and more can be found at at https://apub.readthedocs.org .
If complete and working examples are more to your liking you can find such an example project in the examples directory of the repository.
The following output types are available:
HTML, as in 'good old hyper text markup language'
epub, mobi, azw3 or, to be exact, any format calibre/ebook-convert supports
(requires an additional installation of Kavid Goyal's Calibre)
The following output types are planned for an upcoming version:
- HTML in JSON for use with https://github.com/vomaufgang/areader
For the time being apub is only available via this git repository. You can use pip to install it into your local or virtual Python environment:
pip install https://github.com/vomaufgang/apub/archive/master.zip