Skip to content

MrMarCode/markdownlint-rule-list-indentation

This branch is 16 commits behind silvermine/markdownlint-rule-indent-alignment:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

04b7477 · Jul 17, 2023

History

12 Commits
Mar 21, 2023
Jul 10, 2023
Jul 10, 2023
Mar 21, 2023
Mar 21, 2023
Mar 21, 2023
Mar 21, 2023
Mar 21, 2023
Jul 17, 2023
Mar 21, 2023
Jun 27, 2023
Mar 21, 2023
Jun 27, 2023
Jun 27, 2023

Repository files navigation

markdownlint-rule-indent-alignment

NPM Version License Conventional Commits

What?

This is a custom markdownlint rule to lint the alignment of list items and blocks (e.g. code blocks). For example:

Invalid ⛔ Valid ✅
Lorem ipsum dolor sit amet
consectetur adipiscing elit.
Lorem ipsum dolor sit amet
consectetur adipiscing elit.
* Lorem ipsum
* Dolor sit amet
* Lorem ipsum
* Dolor sit amet
1. Lorem ipsum
* Dolor sit amet
1. Lorem ipsum
* Dolor sit amet
* Lorem ipsum dolor sit amet
consectetur adipiscing elit
* Lorem ipsum dolor sit amet
consectetur adipiscing elit
1. Lorem ipsum dolor sit amet
consectetur adipiscing elit
1. Lorem ipsum dolor sit amet
consectetur adipiscing elit
* Lorem:

```text
hello world
```
* Lorem:

```text
hello world
```
> Lorem ipsum dolor sit amet
> consectetur adipiscing elit
> Lorem ipsum dolor sit amet
> consectetur adipiscing elit

Usage

To use this custom markdownlint rule two things needed:

  1. Update your markdownlint config to include "indent-alignment": true

  2. Add this rule to the list of custom markdownlint rules. If using markdownlint-cli, this would look something like:

    markdownlint -r './node_modules/@silvermine/markdownlint-rule-indent-alignment/src/indent-alignment.js' -c .markdownlint.json README.md

Rule configuration

This rule has the following config options:

  • ul_indent: Desired indention of ul lists (number, default undefined)
    • By default, child ul items will be aligned with the content. When ul_indent is set, the rule will replicate the behavior of the ul-indent (MD007) rule.
    • Examples:
      • ul_indent: undefined

        * top-level item
          * sub-item
        
      • ul_indent: 3

        * top-level item
           * sub-item
        

License

This software is released under the MIT license. See the license file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%