Convert EPUBS to Tbooks

A Tbook consists of a zipped or unzipped folder that holds sequential MD or TXT text files. The folder represents a book and each file represents a section in the book. The file names control the section order. The folder may also contain an optional metadata file.

About This Tool

This tool converts Epubs to Tbooks. It:

Makes one ZIP file per run

Names the ZIP file 'QTY Converted EPUBs'.
Populates each ZIP with the processed EPUB files.

Makes one folder per EPUB

Uses the EPUB's name or metadata to name the folder.
Populates the folder with the converted EPUB file content.

Makes one JSON metadata file per EPUB

- Preserves various metadata found in the EPUB.
- Optionally processes metadata values to ASCII.

Makes one MD plain text file per EPUB section

Skips empty sections.
Names the file after the first heading it contains.
Prefixes file names with a number to preserve sort order.
Converts text to Markdown format plain text.
Runs minor cleanup: e.g.
- Swaps consecutive blank lines for a single blank line.
- Removes invisible characters except for 'space'.
(Optionally) Converts to ASCII:
- Converts non-ASCII characters to the most similar: é > e.
- Removes remaining non-ASCII characters.
- Reduces characters used to: A-Z, a-z, 0-9, and symbols.

Notes

Once loaded, this tool runs entirely in a browser.
The tool accepts unencrypted EPUB files.
Currently, the tool only processes EPUB text content.

Guide

(1) Choose settings below.
(2) Drag and drop one or more EPUB files to convert.
(-) The tool will auto-save a ZIP file.
(3) Unzip it to view the converted files.

Tool
(NOTE: The tool remains untested for large batch runs)

V1: 2024-11-11 (YMD)
V : 2024-11-19
By and Copyright (c) 2024 Greg Abbott
All rights reserved.


The MIT License

Copyright (c) 2024, Greg Abbott

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

NO WARRANTY
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


The EPUB to TBOOK converter currently uses

fflate (v0.8.2): To Unzip
MIT License Permission Copyright (c) 2023 Arjun Barrett

Turndown (v7.2.0): To convert HTML to Markdown
MIT License Permission Copyright (c) 2017 Dom Christie