Skip to content

Commit f7d82c4

Browse files
Merge pull request naokazuterada#134 from naokazuterada/markdownlint-tip
Added tip on using MarkdownTOC in conjunction with Markdownlint (Node)
2 parents 96f1f75 + 07f1c42 commit f7d82c4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,30 @@ And when **Jekyll** is done, your headings should render correctly.
777777

778778
Ref: [Github issue #81](https://github.com/naokazuterada/MarkdownTOC/issues/81)
779779

780+
### Using MarkdownTOC with Markdownlint
781+
782+
If you are using [Markdownlint](https://github.com/DavidAnson/markdownlint) (Node implementation), it will report several violations out of the box.
783+
784+
The basic configuration you can use to address these looks like the following:
785+
786+
```json
787+
{
788+
"html": false,
789+
"blanks-around-headings": false,
790+
"ul-indent": {
791+
"indent": 4
792+
}
793+
}
794+
```
795+
796+
- `html` set to `false`, to allow use of HTML since **MarkdownTOC** relies on HTML tags to assist the Markdown
797+
- `blanks-around-headings` should be set to `false`, since anchors are places closed to the headings that are listed in the TOC
798+
- `ul-indent` should have it's parameter `indent` set to `4` to adhere with the default of `4` used by **MarkdownTOC**, whereas **Markdownlint** defaults to `2`
799+
800+
If you have configured **MarkdownTOC** differently, you can adjust your **Markdownlint** configuration accordingly.
801+
802+
Do note that this tip is based on the **Node** implementation, [available on GitHub](https://github.com/DavidAnson/markdownlint), which uses a project specific `.markdownlint.json` based configuration.
803+
780804
## Limitations
781805

782806
**MarkdownTOC** does come with some limitations.

0 commit comments

Comments
 (0)