Skip to content

Instantly share code, notes, and snippets.

@roachhd
Last active August 29, 2015 14:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roachhd/7fb0f4e2996f79398fa9 to your computer and use it in GitHub Desktop.
Save roachhd/7fb0f4e2996f79398fa9 to your computer and use it in GitHub Desktop.
Quick Ref: GitBookIO ... awesome books via git and GitHub ๐Ÿ‘ All the reference you'll ever need (not really, but to get you started) Nice boilerplate config & json too๐Ÿ˜Š
#this sets up the plugin for the auto generated cover
{
"plugins": ["autocover"],
"pluginsConfig": {
"autocover": {
#Configuration for autocover - see cover-plugin-config.md
"title": "My Book",
"author": "Author",
"font": {
"size": null,
"family": "Impact",
"color": '#FFF'
},
"size": {
"w": 1800,
"h": 2360
},
"background": {
"color": '#09F'
}
}
}
}
}

Cover Generation for GitBook

Generate a cover for the book.

Installation

$ npm install gitbook-plugin-autocover

This module use node-canvas. You need to install some modules on your system before being able to use it: Wiki of node-canvas.

How to use it:

In your book.json:

{
    "plugins": ["autocover"],
    "pluginsConfig": {
        "autocover": {
            // Configuration for autocover (see below)
        }
    }
}

Configuration

Here is default configuration of autocover, you can change it in your book.json:

{
    "title": "My Book",
    "author": "Author",
    "font": {
        "size": null,
        "family": "Impact",
        "color": '#FFF'
    },
    "size": {
        "w": 1800,
        "h": 2360
    },
    "background": {
        "color": '#09F'
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment