Convert a delimited or un-delimited collection of text files into an EPUB file. Compatible with Unix Systems.
- To install the included binary, see BUILD instructions and skip to step 4.
- Run
cmake .
to generate make files. - Run
make
to compiletxt-to-epub2
. - Run
make install
to install the program OR move the compiled program into a binary path (SEE STEP 4). - To move the file into a binary path, execute
mkdir -p ~/.local/bin
andexport PATH="$PATH:~/.local/bin"
. Thenmv txt-to-epub2 ~/.local/bin
. - To make the path change persistent, add the updated PATH environment variable to the .bashrc:
echo "export PATH=\"\$PATH:~/.local/bin\"" >> ~/.bashrc
- libzip
- glib
- uuid
Usage: txt-to-epub2 [OPTION...] [INPUT FILE...]
txt-to-epub - Transform .txt document(s) to an epub document.
-d, --delim=delimiter Delimiter of the input file. Splits input files
into subsequent sections. By default, the entire
input file is consumed as a section. Note, the
delimiter should be the only line contents.
-k, --keep Keep the construction directory.
-o, --output=FILE Output to FILE. Defaults to ./<Document
Title>.epub
-t, --title=TITLE Title of the document. Defaults to "EPUB Title"
-v, --verbose Include verbose output..
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
$ cat test.txt
Title 1
Hello, world!
<------>
Title 2
Goodbye, world!
$ text-to-epub2 -d "<------>" -t "Test EPub" test.txt
Title: Test EPub
Delimiter: <------>
$ ls
1.txt
2.txt
$ text-to-epub2 -t "Test EPub" 1.txt 2.txt
Title: Test EPub
Delimiter: No Delimiter
$ ls
1.txt
2.txt
$ cat 1.txt
Title 1
Hello, world!
<------>
Title 2
Goodbye, world!
$ cat 2.txt
Title 3
I forgot, my keys. Goodbye again.
$ text-to-epub2 -d "<------>" 1.txt 2.txt
Title: EPub Title
Delimiter: <------>
$ cat 1.txt
Title 1
Hello, world!
<------>
Title 2
Goodbye, world!
$ cat 2.txt
Title 3
I forgot, my keys. Goodbye again.
$ cat 1.txt <(echo "<------>") 2.txt | txt-to-epub2 -d "<------>" -t "Title"
Title: Title
Delimiter: <------>
- Parse files.
- Support Delimiters
- Create construction directories.
- Support multiple input files.
- Generate Table of Contents.
- Generate metadata.
- Inmplement compression/file creation to output file.
- More useful output: Chapter titles and/or chapter count.