Converts a book to a tree of content, and vice versa
npm install treeify-book
Book Tree Maker
-----
This is designed to take a basic e-book and split it into: header, table of contents, any chapters, and any appendix
Much of the code was designed with the idea it could be expanded upon. This is an MVP and there are several further use cases to take into consideration, such as:
* Add more configuration settings
* More flexible parsing (ie: allows files with variation in delimeters; it's very strict assumptions right now)
* Nesting chapters in volumes or books (The example Monte Cristo has volumes, which are currently ignored)
* Individual chapter analysis, such as characters who appear, over used words, word count, etc.
* Etc.
Some code may seem over generalized or avoiding simplification for given use cases because of this. Most have been commented.
var treeifyBook = require('treeify-book');
// Splits book content into seperate files
// returns a promise
treeifyBook.extractBook({
bookName: './example/MonteCristo.txt',
saveToPath: './example/MonteCristo/'
});
// Repackages book content into one file
// returns a promise
treeifyBook.packageBook({
bookPath: './example/MonteCristo/',
saveToFile: './example/MonteCristo_RECREATED.txt'
});
``