malta-epub

1.0.10 • Public • Published

npm version npm downloads npm downloads

This plugin can be used on: .json

This plugin expects the template to contain a json like the following:

{
    "title": "Alice's Adventures in Wonderland",
    "author": "Lewis Carroll",
    "publisher": "Macmillan & Co.",
    "cover": "https://vignette.wikia.nocookie.net/villains/images/d/d3/How-to-draw-a-rhino-step-11_1_000000050163_5.jpg/revision/latest/scale-to-width-down/640?cb=20140901173830",
    "content": [
        {
            "title": "About the author",
            "author": "John Doe",
            "data": "epubcontent/chapter1.md"
        },
        {
            "title": "Down the Rabbit Hole",
            "data": "epubcontent/chapter2.md"
        },
        {
            "title": "The world outside the cradle what",
            "data": "epubcontent/chapter3.md"
        }
    ]
}

and this is exaclty as specified in the npm epub-gen package but for the data fileds which do not contain html but the path of md files relative to the template folder.

Sample usage:

malta app/source/myebook.json public/docs -plugins=malta-epub

or in the .json file :

"app/source/myebook.json" : "public/docs -plugins=malta-epub"

or in a script :

var Malta = require('malta');
Malta.get().check([
    'app/source/myebook.json',
    'public/docs',
    '-plugins=malta-epub',
    '-options=showPath:false,watchInterval:500,verbose:0'
     ]).start(function (o) {
        var s = this;
        console.log('name : ' + o.name)
        console.log("content : \n" + o.content);
        'plugin' in o && console.log("plugin : " + o.plugin);
        console.log('=========');
    });

Package Sidebar

Install

npm i malta-epub

Weekly Downloads

1

Version

1.0.10

License

MIT

Unpacked Size

4.05 kB

Total Files

4

Last publish

Collaborators

  • fedeghe