- markdown-toc
- environmental dependence
- quick start
- maven introduced
- md file
- [quick start](#quick start-1)
- attribute configuration
- test cases
- other
_ __ ___ __ _ _ __| | ____| | _____ ___ __ | |_ ___ ___
| '_ ` _ \ / _` | '__| |/ / _` |/ _ \ \ /\ / / '_ \ _____| __/ _ \ / __|
| | | | | | (_| | | | < (_| | (_) \ V V /| | | |_____| || (_) | (__
|_| |_| |_|\__,_|_| |_|\_\__,_|\___/ \_/\_/ |_| |_| \__\___/ \___|
Markdown-to-toc can be used to generate a directory of the Markdown page for github page rendering.
- 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.
-
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
JDK8+, make sure the JDK is set up correctly.
Note: If you are use jdk7,download this code and compile by yourself.
Jars are managed uniformly using Maven.
Change log
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>markdown-toc</artifactId>
<version>${maven-version}</version>
</dependency>
The project for the support of md file name suffix .md
or .markdown
- 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
- code examples
AtxMarkdownToc.newInstance()
.charset("UTF-8")
.write(true)
.subTree(true);
序号 | 属性 | 默认值 | 说明 |
---|---|---|---|
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) |
genTocFile()
returns TocGen, genTocDir()
returns List
- TocGen attribute description
序号 | 属性 | 类型 | 说明 |
---|---|---|---|
1 | filePath | String | current md filePath |
2 | tocLines | List | current md file toc content |
a single file - directory to generate test cases
folder - directory to generate test cases
[Issues & Bugs] (https://github.com/houbb/markdown-toc/issues)