Package: ebukafy
ebukafyTheebukafyutility will convert a plain text file into a nicely
formatted html file to be used as a chapter in an epub.UsageIt is recommended that you useebukafyin conjunction with Calibre. If
you do, read theUse with Calibresection first.Usage: ebukafy [-h] [-p paragraph-separator] [-s section-separator]  filename...Optionsparagraph-separator: sequence of characters that will
delimit paragraphs. Default value: "\t".section-seperator: the sequence of characters that will delimit
a section (the things I'm calling 'sections' are usually delimited by an
empty line in paper books. In other words, sections are the chunks
bigger than paragraphs and smaller than chapters). Default value:
"\n\n". If the text only has one section, just make this something
random that won't appear in the text.NOTE: If you want to change these two separators, make sure to use ANSI
C like strings. These are used like so:$'string'. For example: if you
want to useebukafywith\n\nas theparagraph-separatorand\n\n\nas thesection-separator, you would call it like so:ebukafy -p $'\n\n' -s $'\n\n\n' filename...-h: print out usage statementArgsAfter these options, include as many files as you want toebukafy.OutputThe output of this utility will be a folder calledebukafy_indexfilled with files namedindex_n.html, with n starting at 1 and
incrementing for eachfilenameyou include when callingebukafy.
These are the nicely formatted html files that you can use in your
epub. Additionally, the folder will include a copy ofstylesheet_additions.cssthat you can find in this repository.Use with CalibreThis utility is meant to be used in conjunction withCalibre.Create an empty txt file anywhere.In Calibre, in the upper left corner, click "Add books", which should
open a file selector.In the file selector, navigate to the empty txt file you created, and
open it.This should create a new empty book in Calibre. If you want to, you
can add the metadata for the book such as the title, author, cover, etc.In Calibre, convert the book you created to an EPUB.After converting, select the book in the library and click "Edit
book" in the top right corner.On the left side you'll see the files that were created. Remove the
one called index.html, if one exists. You probably want to keep the
title page (titlepage.xhtml) since most books need a cover.IMPORTANT: All EPUBs use a css file called stylesheet.css to give
greater control over the formatting of the book.ebukafyuses its own
stylesheet to format the html. To find it, look at thestylesheet_additions.cssfile in this repo (or in theebukafy_indexfolder created byebukafyafter you run it) and add its contents to
the stylesheet.css of the EPUB. In Calibre, you can find this stylesheet
in the "Edit book" editor.At this point, the boilerplate code is set up and you need to runebukafy. Look atUsagesection.Click the "Add file" button in the top left of the "Edit book"
editor. You should name itindex_n.htmlwhere n is a number that
increments with each file you add (first file isindex_1.html, second
file isindex_2.html, etc.). Into each file, you put the html created
byebukafy.Use without Calibreebukafygenerates nicely formatted html documents based on a provided
txt file. Though it is much easier to put these files into an actual
epub with Calibre, it is not necessary if you know what you're doing.
Just make sure to read theUsagesection.IMPORTANT: All EPUBs use a css file called stylesheet.css to give
greater control over the formatting of the book.ebukafyuses its own
stylesheet to format the html. To find it, look at thestylesheet_additions.cssfile in this repo (or in theebukafy_indexfolder created byebukafyafter you run it) and add its contents to
the stylesheet.css of the EPUB.