Skip to content

Latest commit

 

History

History
158 lines (101 loc) · 4.39 KB

README-ENGLISH.md

File metadata and controls

158 lines (101 loc) · 4.39 KB

Table of Contents

markdown-toc

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

Maven Central Build Status Coverage Status

Markdown-to-toc can be used to generate a directory of the Markdown page for github page rendering.

  • README

中文说明 | English Readme

note

For the title, there are two kinds of md grammar [setext] (http://docutils.sourceforge.net/mirror/setext.html) And [atx] (http://www.aaronsw.com/2002/atx/) mode.

atx form is only supported temporarily.

The Features

  • Github Markdown file one click to generate the directory

  • fluent and elegant writing is supported

  • support multiple generation

  • support the generation of duplicate titles

  • supports filtering of special characters

  • supports specifying different file codes

  • supports batch processing of files in folders (you can specify whether subfolder files are included)

  • supports writing to files, returns contents of the directory, and allows users to process by themselves

  • support multi-threads for directory files.

  • support i18n

  • support gen toc number

environmental dependence

the JDK

JDK8+, make sure the JDK is set up correctly.

Note: If you are use jdk7,download this code and compile by yourself.

Maven

Jars are managed uniformly using Maven.

Change log

change log

quick start

maven introduced

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

md file

The project for the support of md file name suffix .md or .markdown

quick start

  • single file
AtxMarkdownToc.newInstance().genTocFile(path);

Where path is the path of md file

  • specified folder
AtxMarkdownToc.newInstance().genTocFile(path);

Where path is the parent class folder of the md file

attribute configuration

  • code examples
AtxMarkdownToc.newInstance()
                .charset("UTF-8")
                .write(true)
                .subTree(true);

attribute description

序号 属性 默认值 说明
1 charset UTF-8 file charset
2 write true will toc written to the file (default write)
3 subTree true does it include subfolders(default includes)
3 order false does it gen toc order num(default false, since 1.0.5)

return value description

genTocFile() returns TocGen, genTocDir() returns List

  • TocGen attribute description
序号 属性 类型 说明
1 filePath String current md filePath
2 tocLines List current md file toc content

test cases

a single file - directory to generate test cases

folder - directory to generate test cases

other

[Issues & Bugs] (https://github.com/houbb/markdown-toc/issues)