Giter Club home page Giter Club logo

gitbook-theme-appendto's Introduction

GitBook Sample Plugin

This is a sample plugin for GitBook.

Install it using: $ npm install gitbook-plugin

How GitBook plugin works?

A plugin for GitBook is a node package that can be published on NPM.

package.json

name

The package name should begin with gitbook-plugin-. And if your plugin is a theme, it should begin with gitbook-theme-.

Examples: gitbook-plugin-mixpanel, gitbook-plugin-googleanalytics, gitbook-theme-dark

engine

The package.json should contain a engine field using the standard norm.

"engines": {
    "gitbook": "*"
}

For example if you want your plugin to supports only GitBook version supperior to 0.3.1:

"engines": {
    "gitbook": ">=0.3.1"
}

entry point

The plugin entry point should return an object with some metadata.

"book"

Type: Object Default value: {}

"book.assets"

Type: String Default value: null

Path to the assets folder to copy

"book.js"

Type: Array Default value: []

List of javascript file to add to the html pages (relative to the assets folder).

"book.css"

Type: Array Default value: []

List of css file to add to the html pages (relative to the assets folder).

"book.html"

Type: Object Default value: {}

Map of position -> code, html snippets to add to each page. The code could be a function.

"book.templates"

Type: Object Default value: {}

Templates to override default templates, only use this option if you want to change entirely how the book is rendered.

This object is a map: "name" -> "file", with names:

  • "site": page for a file from the site format
  • "page": page for the page format

"hooks"

Type: Object Default value: {}

Map of "name" -> Function that needs to be called during build process. With names:

  • "init": just after initialization, before generation
  • "finish": after generation and everything is finished

Each hook can return a promise.

gitbook-theme-appendto's People

Contributors

aarono avatar bebraw avatar rlmv avatar ryexley avatar samypesse avatar timelyportfolio avatar ty- avatar viggyprabhu avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.