imfly / gitbook-summary Goto Github PK
View Code? Open in Web Editor NEWA command line tool to generate a summary.md for Gitbook
A command line tool to generate a summary.md for Gitbook
如
1-name
10-name10
2-name2
Sample:
Actual: [Inbound Marketing](Basics/Inbound Marketing/README.md)
Expected: Inbound Marketing
Whitespaces in directory names should be replaced with %20
to get a working link
1.目前的SUMMARY目录是根据文件夹及文件名生成的,有时一个MD文档写得比较长,于是分了很多段落,能否在目录中显示MD文档的大纲级别。
就是:如果有2个文件,那么目前生成的目录就是2个文件名形成的目录。
能否改进,通过加参数控制(控制是否显示段落标题),把文件里面的段落标题,也显示在SUMMARY目录中。
2.目前根目录的README.md没有添加进目录,gitbook启动后会自带一个叫introduction的标题对应README.md文件。能否加配置可以自定义这个introduction名字,让这个readme.md在左边显示为自定义的标题。
The 'book sm' generates summary with invalid slashes (\) in links, on GitHub it must be forward slashes (/).
The #10 doesn't fix the problem
比如这样的文件名this-is-filename
,第一个短杠前的词 this 会被忽略掉
有时候是按照一个md进行书写的/tl
然后希望也可以生成md里面的标题层级
当前解析的标题名字,都是文件名吧,可不可以解析一下文件,取第一行,作为标题呢 ?
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-
等前缀设定排序方法。
举个例子:
01-abc.md
03-directory
02-edf.md
排出来的目录是:
03-directory
01-abc.md
02-edf.md
例如文件名
C-Link 生成后变成了 C Link
H1C 生成后变成 H 1 C
跟想要的结果有出入
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...
Hi,
Can you please help me with building a gulp task for the automization of the summary file?
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)
相关的配置信息:
例如:$ book sm g -n "Your Book Name"
,没生成SUMMARY.md
也没有任何提示。
01是文件,02是目录,book sm -s '_'
02_test1
README.md
01_test2.md
生成的summary:
- [test1](02_test1/README.md)
* [test2](01_test2.md)
排序没有起作用
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
完全没有必要,因为对一个目录来说,这里没有其他操作要做了,计划将其删除掉。
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?
Can you update bugfix package version and publish to npm registry?
空格被转换导致读取不到对应路径的文件,md转为html失败,例如【test/aa bb.md】被转为【test/aa%20bb.md】
If I intstall with npm repository, summary didn't use file property in front-matter,
please update!!
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.
如题,其他情况工作都良好,在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
---
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.