All Projects → houbb → Markdown Toc

houbb / Markdown Toc

Licence: apache-2.0
🎄Generate toc for github markdown file.(为 markdown 文件生成 toc 目录)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Markdown Toc

Markdown Toc
Generate a markdown TOC (table of contents) for a README or any markdown files, using remarkable. Used by assemble, verb, and lots of other projects on GitHub. API and CLI.
Stars: ✭ 1,185 (+722.92%)
Mutual labels:  toc, markdown, md
Github Markdown Toc.go
Easy TOC creation for GitHub README.md (in go)
Stars: ✭ 387 (+168.75%)
Mutual labels:  toc, markdown
Md To Pdf
Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
Stars: ✭ 374 (+159.72%)
Mutual labels:  markdown, md
Mditor
📝 [ M ] arkdown + E [ ditor ] = Mditor
Stars: ✭ 523 (+263.19%)
Mutual labels:  markdown, md
Github Markdown Toc
Easy TOC creation for GitHub README.md
Stars: ✭ 2,734 (+1798.61%)
Mutual labels:  toc, markdown
Markserv
🏁 serve markdown as html (GitHub style), index directories, live-reload as you edit
Stars: ✭ 304 (+111.11%)
Mutual labels:  markdown, md
Vim Markdown Toc
A vim 7.4+ plugin to generate table of contents for Markdown files.
Stars: ✭ 427 (+196.53%)
Mutual labels:  toc, markdown
Markdown Pdf
📄 Markdown to PDF converter
Stars: ✭ 2,365 (+1542.36%)
Mutual labels:  markdown, md
Ngx Markdown
Angular markdown component/directive/pipe/service to parse static, dynamic or remote content to HTML with syntax highlight
Stars: ✭ 687 (+377.08%)
Mutual labels:  markdown, md
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+643.75%)
Mutual labels:  markdown, md
Docsify Tabs
A docsify.js plugin for rendering tabbed content from markdown
Stars: ✭ 65 (-54.86%)
Mutual labels:  markdown, md
Remark Toc
plugin to generate a Table of Contents (TOC)
Stars: ✭ 165 (+14.58%)
Mutual labels:  toc, markdown
Lute
🎼 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript。A structured Markdown engine that supports Go and JavaScript.
Stars: ✭ 222 (+54.17%)
Mutual labels:  markdown, md
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+2315.28%)
Mutual labels:  toc, markdown
Vditor
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
Stars: ✭ 3,773 (+2520.14%)
Mutual labels:  markdown, md
Assemble
Community
Stars: ✭ 3,995 (+2674.31%)
Mutual labels:  markdown, md
Pervane
Plain text file based note taking and knowledge base building tool, markdown editor, simple browser IDE.
Stars: ✭ 159 (+10.42%)
Mutual labels:  markdown, md
Remarkable
Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.
Stars: ✭ 5,252 (+3547.22%)
Mutual labels:  markdown, md
Oblog
An Auto Rendering 🔽 Blogging System Based on MarkDown & Vue.js | 自动渲染装载 MarkDown 内容的博客系统
Stars: ✭ 133 (-7.64%)
Mutual labels:  markdown, md
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+8053.47%)
Mutual labels:  toc, markdown

Table of Contents

markdown-toc

  _ __ ___   __ _ _ __| | ____| | _____      ___ __       | |_ ___   ___ 
 | '_ ` _ \ / _` | '__| |/ / _` |/ _ \ \ /\ / / '_ \ _____| __/ _ \ / __|
 | | | | | | (_| | |  |   < (_| | (_) \ V  V /| | | |_____| || (_) | (__ 
 |_| |_| |_|\__,_|_|  |_|\_\__,_|\___/ \_/\_/ |_| |_|      \__\___/ \___|
 

Maven Central Build Status Coverage Status

Markdown-toc 可以用来生成 markdown 页面的目录,便于 github 页面展现。

  • 文档

中文说明 | English Readme

备注

对于标题,md 有两种语法 setextatx 模式。

暂时只支持 atx 形式。

变更日志

变更日志

Features

  • Github Markdown 文件一键生成目录

  • 支持 fluent 优雅的写法

  • 支持多次生成

  • 支持重复标题的生成

  • 支持特殊字符的过滤

  • 支持指定不同的文件编码

  • 支持文件夹的文件批量处理(可指定是否包含子文件夹文件)

  • 支持是否写入文件,可返回目录的内容,便于用户自行处理

  • 支持多线程写文件

  • 支持 i18n

  • 支持目录编号生成(1.0.5)

v1.0.8 更新日志

  1. 优化 github 对应的链接地址,修复中文符号 BUG

环境依赖

JDK

1.0.5 及其以前为 jdk8 编译, 请确保 JDK 设置正确。

1.0.6 版本使用 jdk7 编译上传。

后续 1.XX 版本都将支持 jdk7,更便于使用。

Maven

Jar 使用 Maven 进行统一管理。

快速入门

maven 引入

<dependency>
    <groupId>com.github.houbb</groupId>
    <artifactId>markdown-toc</artifactId>
    <version>${maven-version}</version>
</dependency>

md 文件

本项目支持的 md 文件后缀名称为 .md 或者 .markdown

快速开始

  • 单个文件
AtxMarkdownToc.newInstance().genTocFile(path);

其中 path 为 md 文件的路径

  • 指定文件夹
AtxMarkdownToc.newInstance().genTocFile(path);

其中 path 为 md 文件的父类文件夹

属性配置

  • 代码示例
AtxMarkdownToc.newInstance()
                .charset("UTF-8")
                .write(true)
                .subTree(true);

属性说明

序号 属性 默认值 说明
1 charset UTF-8 文件编码
2 write true 是否将 toc 写入文件(默认写入)
3 subTree true 是否包含子文件夹的文件(默认包含)
4 order false 是否生成目录编号(默认不生成,1.0.5以后)

返回值说明

genTocFile() 返回 TocGen,genTocDir() 返回 List

  • TocGen 属性说明
序号 属性 类型 说明
1 filePath String 当前 md 的文件路径
2 tocLines List 当前 md 文件对应的目录内容

测试案例

单个文件-目录生成测试案例

文件夹-目录生成测试案例

其他

Issues & Bugs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].