Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add table of content in vertx core #29

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

downgoon
Copy link

@downgoon downgoon commented Jun 5, 2017

添加目录

添加了一个目录,以方便读者阅读。

image

维护目录

后续编辑的人员如何维护目录呢?
使用 atom 编辑器(github开源),安装 markdown-toc 插件,文档保存时,它会自动更新目录。

@guoyu511
Copy link
Collaborator

guoyu511 commented Jun 5, 2017

加目录挺好的,core 这个文档确实太长了。
不过建议用 gitbook toc 的插件来实现,这样可以省去对 atom 编辑器和相关插件的依赖。毕竟不是每个人都用 atom。而且 atom 那种基于 electron 的编辑器改 core 这么大的文档也挺心累的。。。用 gitbook toc 的话,目录的内容也不需要提交在 md 原文件里了。配置一下插件,Core.md 里加一句注释就行了

Copy link
Collaborator

@guoyu511 guoyu511 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议改成用 gitbook toc 插件来实现。
https://www.npmjs.com/package/gitbook-plugin-atoc

core/Core.md Outdated
- [启动器子类](#启动器子类)
- [启动器和退出代码](#启动器和退出代码)
- [配置 Vert.x 缓存](#配置-vertx-缓存)
- [或者](#或者)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

跟前面一样类似的问题

core/Core.md Outdated
- [执行打包成 fat-jar 的Vert.x 应用](#执行打包成-fat-jar-的vertx-应用)
- [显示Vert.x的版本](#显示vertx的版本)
- [其他命令](#其他命令)
- [or](#or)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个目录应该是不存在的吧?or不表示任何东西

@boliza
Copy link
Collaborator

boliza commented Jun 5, 2017

采用 TOC 指令吧。另外是不是把所有的翻译的文档 都需要均添加这个指令

Copy link
Collaborator

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同意,建议直接用 GitBook 的 toc 插件。

@downgoon
Copy link
Author

downgoon commented Jun 6, 2017

@guoyu511 好主意。目前只改了 Core.md 里面的,尚未全部改,正则替换有些 在代码里面。

Find: ^#([^#].*)$
Replace: # $1\r\n <!-- toc -->

上述替换假设前提:每个.md文件只有一个 # 标记,实际并非如此。

image

gitbook-atoc 效果图

image

…kdown-toc due to the previous one's auto-gen feature
@downgoon
Copy link
Author

downgoon commented Jun 9, 2017

自动 toc

@guoyu511 gitbook-plugin-etoc 不用加 <!-- toc -->,便能自动在头部增加目录,配置如下:

    "plugins": ["etoc"],
    "pluginsConfig": {
      "etoc": {
        "mindepth": 2,
        "maxdepth": 4,
        "notoc": false
	}
}	

展示效果不及 gitbook-plugin-atoc

没有浮层效果

image

@guoyu511
Copy link
Collaborator

@downgoon 就用 gitbook-plugin-atoc 那个吧,目录可以浮在侧面操作容易一些。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants