Skip to content

converts html books from sources such as Gutenberg into a JSON block format

Notifications You must be signed in to change notification settings

chadananda/book2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book2JSON

Converts books from various html formats such as Gutenberg into a JSON block format. Along the way it also cleans up text artifacts such as straight quotes. Outputs an array of block objects with clean HTML content and some block classes.

Install

npm install --save book2json

Usage

var book2json = require('book2json');

// load a file in Gutenberg html format
fs.readFile(bookPath, function(err, content) { 
  // translate into JSON
  book2json.importGutenbergHtml(content)
    .then(function(json){
      // do something with your JSON data    
    });
});

Tests

This module includes some Mocha/Chai tests which can be run with:

npm test

About

converts html books from sources such as Gutenberg into a JSON block format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published