npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

gitbook-setup

1.3.13 • Public • Published

README STILL IN WRITING PROCESS

Welcome to the gitbook-setup package

Coverage Status Build Status npm npm npm

If you've found this module to be useful and wish to support it, you may do so by visiting this pledgie campaign: Click here to lend your support to: Gitbook-Setup and make a donation at pledgie.com !

Motivation

Imagine to build...

Global installation

$ npm install -g gitbook-setup
$ gitbook-setup [help]

Local installation

$ npm install --save gitbook-setup

Usage

Doc creation

var gitbook_setup = require('gitbook-setup')
 
var info = {
  name: "title",
  deploys: "heroku"
}
 
gitbook_setup.create(info, (err, allInfo) => {
  if (err) console.log(err)
  else {
    console.log("Book summary: ")
    console.log(allInfo)
  }
})

Optionally info can have a path variable to create the document at that path:

var gitbook_setup = require('gitbook-setup')
 
var info = {
  name: "title",
  deploys: "heroku",
  path: "/home/rudy/Desktop/Docs/"
}
 
gitbook_setup.create(info, (err, allInfo) => {
  if (err) console.log(err)
  else {
    console.log("Book summary: ")
    console.log(allInfo)
  }
})

Doc installation

Dependencies

Name Version
Nodejs >= 8.x.x
NPM >= 3.x.x

Possible commands

  • Create
  • Install
  • Deploy

Book creation

You have now three options for creating a book:

  • Passing book configuration through arguments.
  • Giving a file with the whole configuration.
  • In interactive form. The program will ask you for all information.

The creation of a book by interactive form is the most user-friendly. The argument form of creation is useful when you want to create a lot of books for example and fast for students. The file method of creation could be useful when you want to send through the network the book information to create it in other place for example I could send a file configuration to China and there they can create the book.

To create a book you have to execute

> gitbook-setup create [interactive (default) | args | file -f <filename> ]

By Arguments

If you want to create a book by arguments you have these fields:

  • -n bookname (required)
  • -t book (default) | api | faq | own:moduleName
  • -d heroku | gh-pages | moduleName
  • -a author/s
  • -i description

Example 1 - Simplest book

> gitbook-setup create args -n Sample

Will output: Sample 1

Example 2 - Simplest book with my own template

> gitbook-setup create args -n Sample -t own:myTemplate

Will output: Sample 1

Example 3 - Book deployed to Heroku

> gitbook-setup create args -n Sample -d heroku

Will output: Sample 1

Example 4 - Book deployed to Heroku and gh-pages

> gitbook-setup create args -n Sample -d heroku,gh-pages

Will output: Sample 1

Example 5 - Book titled 'Our Piano History' with the template 'Classical Sheets', deployed to heroku, gh-pages and my server 'BestMusic', written by Frederic Chopin and Sergei Rachmaninoff and with some description about the book

> gitbook-setup create args -n 'Our Piano History' -t own:'Classical Sheets' -d heroku,gh-pages,BestMusic -a 'Frederic Chopin','Sergei Rachmaninoff' -i 'Amazing story about our piano lifes'

Will output: Sample 1

By file

If you saw the output of the previous examples you have to create a file with the identical content. For example you want a book title myBook that allows deployment to heroku you have to create a file like that:

File 1

This file will create the same book:

File 2

Because by defaut the type is book.

The field name is a requirement. All other fields are optional.

Interactive

The program will just ask you for all fields and you will fill them.

Keywords

install

npm i gitbook-setup

Downloadsweekly downloads

106

version

1.3.13

license

ISC

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability