Turns markdown documents into full fledged ebooks.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
apub
examples
resources
tests
.coveragerc
.editorconfig
.gitattributes
.gitignore
.pylintrc
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
LICENSE
MANIFEST.in
Makefile
README.rst
make.bat
requirements.txt
setup.cfg
setup.py
tox.ini

README.rst

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.

Build status

  • develop: DEVELOP DEVCOVERAGE
  • master: MASTER MASTERCOVERAGE

Features

  • 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.py and the markdown files are present, the output my_book.html can be created by executing

    python my_project.py

    on the command line.

    Note

    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:

Installation

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