GithubHelp home page GithubHelp logo

isabella232 / gitbook-summary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intesso/gitbook-summary

0.0 0.0 0.0 8.73 MB

A command line tool to Generate summary for Gitbook

JavaScript 99.60% HTML 0.40%

gitbook-summary's Introduction

Gitbook Summary

npm version Build Status Dependencies Status Coverage Status

A command line tool to generate a SUMMARY.MD from a folder。Demo 中文文档

Features

  • Generate SUMMARY.md by using a CLI with some options
  • Setting with book.json
  • Link README.md to the parent directory
  • Only get '.md' files
  • Order by alphabet or numbers
  • ...

CoC (Convention over Configuration)

Source directory:

sources
├── 1-FirstChapter   // The first chapter,format: {orderNumber or alphabet}-{chapterName}.md
├────── 1-FirstDocument.md
├────── 5-SecondDocument.md  // concentrating solely on the order, not the numbers.
├── 3-SecondChapter                     // Focus only on the order, not the numbers.
├────── 1-FirstDocumentOfSecondChapter.md
├────── 2-SecondDocumentOfSecondChapter.md  
├── 7-ThirdChapter
├── FourthChapter  // May have no order
├── README.md // In addition to readme.md, not to put other markdown documents
└── book.json     // Set up the book

Install

npm install -g gitbook-summary

Using

1> Generate a SUMMARY.md Simply

$ cd /path/to/your/book/
$ book sm

or, For example:

$ book sm -r ../sailsjs-docs-gitbook/en -i 0home -u 'myApp' -c 'concepts, reference, userguides' -n "Sails.js 官方文档(中英合辑)"

2> Create a book.json in the book`s root folder

for example:

// test/books/config-json/book.json
{
    "bookname": "json-config-name",
    "outputfile": "test.md",
    "catalog": "all",  // or [chapter1,chapter2, ...]
    "ignores": [],  
    "unchanged": [] // for example: ['myApp'] -> `myApp` not `My App`
}

then, you can do:

$ book sm

You will get a test.md file:

test.md.jpg

3> Get a markdown artical from a html file or a remote url

$ book md -l "http://book.btcnodejs.com/index.html" -s "div.className"

You will get the 'index.html' and 'index.md'.

4> Get convert between zh and zh-tw, zh-hk, or zh-sg

$ book cv -f ./test/language/test.md -l zh-tw -t "./test/language/test2.md"

eBooks

More Gitbooks : https://www.gitbook.com/@imfly

Development

npm install
npm link

Test

npm test

Todo

  • Convert articals between Simplified and Traditional Chinese.
  • Generate eBooks(html, pdf, etc) by extending gitbook;

Contribute

We love pull requests! You can fork it and commit a pr

License

The MIT License

gitbook-summary's People

Contributors

imfly avatar andineck 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.