{"id":16469680,"url":"https://github.com/imfly/gitbook-summary","last_synced_at":"2025-04-06T01:08:10.978Z","repository":{"id":1877071,"uuid":"45095037","full_name":"imfly/gitbook-summary","owner":"imfly","description":"A command line tool to generate a summary.md for Gitbook","archived":false,"fork":false,"pushed_at":"2023-01-11T05:17:24.000Z","size":9059,"stargazers_count":176,"open_issues_count":20,"forks_count":41,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T12:33:50.738Z","etag":null,"topics":["bitcoin","gitbook","gitbook-plugin","summary"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imfly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-28T07:07:19.000Z","updated_at":"2024-11-20T22:44:22.000Z","dependencies_parsed_at":"2023-01-13T11:27:56.870Z","dependency_job_id":null,"html_url":"https://github.com/imfly/gitbook-summary","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfly%2Fgitbook-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfly%2Fgitbook-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfly%2Fgitbook-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfly%2Fgitbook-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imfly","download_url":"https://codeload.github.com/imfly/gitbook-summary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246767929,"owners_count":20830577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","gitbook","gitbook-plugin","summary"],"created_at":"2024-10-11T12:08:31.774Z","updated_at":"2025-04-06T01:08:10.938Z","avatar_url":"https://github.com/imfly.png","language":"JavaScript","readme":"# Gitbook Summary\n\n[![npm version](https://badge.fury.io/js/gitbook-summary.svg)](https://badge.fury.io/js/gitbook-summary)\n[![Build Status](https://travis-ci.org/imfly/gitbook-summary.png?branch=master)](https://travis-ci.org/imfly/gitbook-summary)\n[![Dependencies Status](https://david-dm.org/imfly/gitbook-summary.png)](https://david-dm.org/imfly/gitbook-summary)\n[![Coverage Status](https://coveralls.io/repos/imfly/gitbook-summary/badge.png)](https://coveralls.io/r/imfly/gitbook-summary)\n\n\nA command line tool to generate a `SUMMARY.MD` from a folder。[Demo](http://imfly.github.io/how-to-create-self-publishing-platform) [中文文档](http://imfly.github.io/how-to-create-self-publishing-platform/3-%E5%A6%82%E4%BD%95%E6%89%93%E9%80%A0%E8%87%AA%E5%B7%B1%E7%9A%84%E5%B9%B3%E5%8F%B0%EF%BC%9F/2-Summary%E7%9A%84%E4%BD%BF%E7%94%A8.html)\n\n## EBooks\n\n* 《Nodejs区块链开发2》： https://github.com/imfly/blockchain-on-nodejs\n* 《Nodejs区块链开发》： https://github.com/imfly/bitcoin-on-nodejs\n* 《用Gitbook和Github轻松搭建自出版平台》： https://github.com/imfly/how-to-create-self-publishing-platform\n* 《sails.js 官方文档 多语言电子书》：https://github.com/imfly/sailsjs-docs-gitbook\n\nMore Gitbooks : https://www.gitbook.com/@imfly\n\n## Features\n\n- Generate `SUMMARY.md` by using a CLI with some options\n- Setting with `book.json`\n- Link `README.md` to the parent directory\n- Only get '.md' files\n- Order by alphabet or numbers\n- ...\n\n## CoC (Convention over Configuration)\n\nSource directory:\n\n```\nsources\n├── 1-FirstChapter   // The first chapter，format: {orderNumber or alphabet}-{chapterName}.md\n├────── 1-FirstDocument.md\n├────── 5-SecondDocument.md  // concentrating solely on the order, not the numbers.\n├── 3-SecondChapter                     // Focus only on the order, not the numbers.\n├────── 1-FirstDocumentOfSecondChapter.md\n├────── 2-SecondDocumentOfSecondChapter.md  \n├── 7-ThirdChapter\n├── FourthChapter  // May have no order\n├── README.md // In addition to readme.md, not to put other markdown documents\n└── book.json     // Set up the book\n```\n\n## Install\n\n```\nnpm install -g gitbook-summary\n```\n\n## Using\n\n1\u003e Generate a `SUMMARY.md` Simply\n\n```\n$ cd /path/to/your/book/\n$ book sm\n```\n\nor, For example:\n\n```\n$ book sm -r ../sailsjs-docs-gitbook/en -i 0home -u 'myApp' -c 'concepts, reference, userguides' -n \"Sails.js 官方文档(中英合辑）\"\n```\n\nTo see the command line options:\n\n```\n$ book sm --help\n\n  Usage: summary|sm [options]\n\n  Generate a `SUMMARY.md` from a folder\n\n  Options:\n\n    -h, --help                    output usage information\n    -r, --root [string]           root folder, default is `.`\n    -t, --title [string]          book title, default is `Your Book Title`.\n    -c, --catalog [list]          catalog folders included book files, default is `all`.\n    -i, --ignores [list]          ignore folders that be excluded, default is `[]`.\n    -u, --unchanged [list]        unchanged catalog like `request.js`, default is `[]`.\n    -o, --outputfile [string]     output file, defaut is `./SUMMARY.md`\n    -s, --sortedBy [string]       sorted by sortedBy, for example: `num-`, defaut is sorted by characters\n    -d, --disableTitleFormatting  don't convert filename/folder name to start case (for example: `JavaScript` to `Java Script`), default is `false`\n\n```\n\n**Notes**： \n* The article title is taken from `title` property in the articles front-matter. If this property is not available, the articles filename will be used as title for the summary. \n* The option `-s` or `--sortedBy` can not be given `-` as argument, because commander.js will parse it an option. But you can set it in `book.json` as follows.  \n* set up the sortedBy and if there are any summaries missing the order, look at the example below and follow,  \nfor example, you have summaries like this `01-elementry-school, 02-middle-school, 03-university, ...`  \nyou realized high school was missing, then You can make correct order in the following way  \neg. `01-elementry-school, 02-middle-school, 02a-high-school, 03-university, ...`  \nnot `01-elementry-school, 02-middle-school, 03-high-school, 04-university, ...`\n\n2\u003e Create a `book.json` in the book`s root folder\n\nfor example:\n\n```\n// test/books/config-json/book.json\n{\n    \"title\": \"json-config-name\",\n    \"outputfile\": \"test.md\",\n    \"catalog\": \"all\",  // or [chapter1，chapter2, ...]\n    \"ignores\": [],  //Default: '.*', '_book'...\n    \"unchanged\": [], // for example: ['myApp'] -\u003e `myApp` not `My App`\n    \"sortedBy\": \"-\",\n    \"disableTitleFormatting\": true // default: false\n}\n```\n\nthen, you can do:\n\n```\n$ book sm\n```\n\nYou will get a `test.md` file:\n\n![test.md.jpg](doc/img/test.md.jpg)\n\n3\u003e Get a markdown artical from a html file or a remote url\n\n```\n$ book md -l \"http://book.btcnodejs.com/index.html\" -s \"div.className\"\n```\n\nYou will get the 'index.html' and 'index.md'.\n\n4\u003e Get convert between zh and zh-tw, zh-hk, or zh-sg\n\n```\n$ book cv -f ./test/language/test.md -l zh-tw -t \"./test/language/test2.md\"\n```\n\n## Development\n\n```\nnpm install\nnpm link\n```\n\n## Test\n\n```\nnpm test\n```\n\n## Todo\n\n- Convert articals between Simplified and Traditional Chinese.\n- Generate eBooks(html, pdf, etc) by extending `gitbook`;\n\n## Contribute\n\nWe love pull requests! You can `fork it` and commit a `pr`\n\n## License\n\nThe MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimfly%2Fgitbook-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimfly%2Fgitbook-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimfly%2Fgitbook-summary/lists"}