Git Product home page Git Product logo

gitbook-summary's Issues

有2个优化建议,看能否实现,谢谢。

1.目前的SUMMARY目录是根据文件夹及文件名生成的,有时一个MD文档写得比较长,于是分了很多段落,能否在目录中显示MD文档的大纲级别。
就是:如果有2个文件,那么目前生成的目录就是2个文件名形成的目录。
能否改进,通过加参数控制(控制是否显示段落标题),把文件里面的段落标题,也显示在SUMMARY目录中。

2.目前根目录的README.md没有添加进目录,gitbook启动后会自带一个叫introduction的标题对应README.md文件。能否加配置可以自定义这个introduction名字,让这个readme.md在左边显示为自定义的标题。

标题

当前解析的标题名字,都是文件名吧,可不可以解析一下文件,取第一行,作为标题呢 ?

Ignores should support wildcards or regular expressions

The documentation suggests, that you can use wildcards in the "ignores" configuration. As a matter of fact, the values in this array are compared on a 1:1 basis. No regex included.

Feature request: Ignores configuration should support wildcards or regular expressions.

优化排序方法

默认是按照字符进行排序的,如果给了参数sortedBy,那么用户可以选择使用NUM-aZ-等前缀设定排序方法。

have you any plan support for non-ascii title

I live in non-ascii lang country
so my post title in front-matter is non-ascii
but book sm isn't support non-ascii title...
result is

[](programming/functional-paradigm-example.md)

it has no title...

Gulp Task

Hi,
Can you please help me with building a gulp task for the automization of the summary file?

在book.jason中排除无关文件,运行book sm 提示失败

Hi:

感谢你的共享的插件。我在部署的过程中,因为默认book sm会把node module 和_book的都收录到目录里面,想要把这两个目录排除,因此我在book.json中增加了如下代码:

{
    "bookname": "json-config-name",
    "outputfile": "test.md",
    "catalog": "all",  // 如 [chapter1,chapter2, ...]
    "ignores": [_drafts,_books],
    "unchanged": [] // 如: ['myApp'] -> `myApp` not `My App`
}

但是再次运行book sm的时候,提示以下错误:

module.js:593
    throw err;
    ^

SyntaxError: /Users/aban/Documents/半撇私塾课程/BPteach-EDU-Chanllenger/book.json: Unexpected token / in JSON at position 173
    at JSON.parse (<anonymous>)
    at Object.Module._extensions..json (module.js:590:27)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at BookConfig (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/bookJson.js:10:18)
    at init (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/summary/index.js:29:22)
    at Array.init (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/summary/index.js:51:13)

相关的配置信息:

  • Mac
  • Node版本:7.1.0
  • npm版本:3.10.9
  • Gitbook CLI 版本: 2.3.2

sortedBy 不能正常工作

01是文件,02是目录,book sm -s '_'

02_test1
   README.md
01_test2.md

生成的summary:

- [test1](02_test1/README.md)
* [test2](01_test2.md)

排序没有起作用

SUMMARY.md does not skip hidden files

I have a template file .runbook-template.md which is being shown in the summary.md after being built. However, in the index.js file for summary, I see:

// Ignore hidden files, for example `.git`
if (/^[\.]|'_book'|'node_modules'/.test(key)) {
    ignores.push(key);
}

I have also tried to use the ignores in book.json as well,

"ignores": ["runbook-template"],

Any ideas on how to have these files hidden?

简化命令

现在来看,book sm g 感觉太累赘了,g完全没有必要,因为对一个目录来说,这里没有其他操作要做了,计划将其删除掉。

Feature request --「 ignore title 」

Feature request --「 ignore title 」

Cool tool ! "gitbook-summary" helps me a lot. Thanks !

book.json file is useful, help me shorten my command line.

Recently, I want to remove the 'title' from my blog's navigation (note.tianyongwei.com).
but likely gitbook-summary can't do it.

I try modify the source code ,and found this:

var root,
      title, // todo: don`t use `name`?
      outputFile,
      catalog,
      ignores,
      unchanged,
...

is the feature (dont use name`) a todo feature?

意外生成多余的Pages目录

如图,这个Pages不知是从哪来的,我本地还有你的程序里都没这个,很奇怪
刚开始没装Gitbook时是没有这个问题的

这个是book.json

please update npm module

If I intstall with npm repository, summary didn't use file property in front-matter,
please update!!

book sm orders differently if .git folder is not present

I have book.json with "sortedBy": "_", and several folders setup like:

2_Top
└── README.md
3_Mid
└── README.md
4_Mid2
└── README.md
5_Mid3
└── README.md
9_Last
├── 2_Top
│   └── README.md
├── 3_Mid
│   └── README.md
├── 9_Last
│   └── 3_Mid
│       └── README.md
└── README.md

My production deployment downloaded github's master.zip download link (e.g. like this link, but for my private repo), which doesn't have the .git folder in it, and ran book sm before starting gitbook serve. I noticed the ordering was not being obeyed the same as when the .git folder is present...any ideas why?

Here is an example SUMMARY.md output based off the above directory structure. The problem only presents itself when nesting data in the last sorted directory...

SUMMARY.md before git init of a repo:

- [Top](2_Top/README.md)
- [Mid 2](4_Mid2/README.md)
- [Mid 3](5_Mid3/README.md)
- [Last](9_Last/README.md)
  - [Top](9_Last/2_Top/README.md)
  - [Mid](9_Last/3_Mid/README.md)
  - Last
    - [Mid](9_Last/9_Last/3_Mid/README.md)
- [Mid](3_Mid/README.md)

after git init and add/commiting all the files...book sm results in:

- [Top](2_Top/README.md)
- [Mid](3_Mid/README.md)
- [Mid 2](4_Mid2/README.md)
- [Mid 3](5_Mid3/README.md)
- [Last](9_Last/README.md)
  - [Top](9_Last/2_Top/README.md)
  - [Mid](9_Last/3_Mid/README.md)
  - Last
    - [Mid](9_Last/9_Last/3_Mid/README.md)

I've worked around the issue by swithcing to a git clone --depth 1 so I have .git data...but I thought it was an odd bug worth reporting still.

front-matters在README.md中不起作用

如题,其他情况工作都良好,在README中使用front-matters时不起作用。但是,当front-matters中title的值为README时,front-matters就会起作用,生成出来的SUMMARY中会将章节名设置为README.

---
title: README
author: xxx
date: 2020-11-15 06:01:25
last_author: xxx
last_edit_time: 2020-11-21 14:07:08
---

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.