Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takaishi/mdtoc
Generate and insert markdown's table of contents
https://github.com/takaishi/mdtoc
go markdown
Last synced: 7 days ago
JSON representation
Generate and insert markdown's table of contents
- Host: GitHub
- URL: https://github.com/takaishi/mdtoc
- Owner: takaishi
- Created: 2019-01-24T05:38:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T09:43:40.000Z (almost 6 years ago)
- Last Synced: 2025-01-08T16:21:39.556Z (19 days ago)
- Topics: go, markdown
- Language: Go
- Size: 21.5 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mdtoc
[![Build Status](https://travis-ci.org/takaishi/mdtoc.svg?branch=master)](https://travis-ci.org/takaishi/mdtoc)
Generatr and insert table of content with markdown.
## Usage
```
$ mdtoc --help
NAME:
mdtoc - A new cli applicationUSAGE:
mdtoc [global options] command [command options] [arguments...]VERSION:
0.0.1COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--file value, -f value Specify to generate TOC.
--in-file, -i Insert TOC to md file specified --file option.
--level value, -l value (default: 2)
--help, -h show help
--version, -v print the version
```## Install
```
$ brew install takaishi/fomulas/mdtoc
```## Example
```md
$ cat example.md
# This is example## foo
aaa
## bar
bbb
```Output markdown with TOC to stcout:
```
$ mdtoc -f ./example.md
# This is example* [foo](#foo)
* [bar](#bar)## foo
aaa
## bar
bbb
```Overwrite file with TOC :
```
$ mdtoc -f ./example.md -i
$
$ cat example.md
# This is example* [foo](#foo)
* [bar](#bar)## foo
aaa
## bar
bbb
```## Copyright
* Copyright(c) 2019- r_takaishi