Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taiki45/md-numbered-headers
Insert numbered-headers to a markdown file.
https://github.com/taiki45/md-numbered-headers
markdown
Last synced: 13 days ago
JSON representation
Insert numbered-headers to a markdown file.
- Host: GitHub
- URL: https://github.com/taiki45/md-numbered-headers
- Owner: taiki45
- Created: 2021-02-09T11:12:21.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-07T06:00:42.000Z (about 3 years ago)
- Last Synced: 2024-10-03T09:22:23.311Z (about 2 months ago)
- Topics: markdown
- Language: Rust
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
md-numbered-headers
===================Insert numbered-headers to a markdown file.
Convert from:
```markdown
# Title
## Section one
Text here.### Sub section one
Text.## Section two
Another text.
```To:
```markdown
# Title
## 1. Section one
Text here.### 1.1 Sub section one
Text.## 2. Section two
Another text.
```See more option with `--help`.
## Usage
Single file:```
$ cat my-file.md | md-numbered-headers | tee my-file.md > /dev/null
```In the git repogitory:
```
$ for f in `git ls-files |grep .md`; do echo $f; cat $f | md-numbered-headers | tee $f > /dev/null; done
```### Cleanup only mode
```
$ cat my-file.md | md-numbered-headers -c | tee my-file.md > /dev/null
```### The `reset_with_higher_depth` option
If true and the `start_depth` is default value `2`, it resets the header number counting with depth 1 header (`#`).Given:
```markdown
# Title
## Topic a
## Topic b
# Another title
## Topic c
```Result:
```markdown
# Title
## 1. Topic a
## 2. Topic b
# Another title
## 1. Topic c
```