Skip to content

Commit

Permalink
Add list of external rules to readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 28, 2015
1 parent d78b63a commit 298b33a
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 108 deletions.
196 changes: 99 additions & 97 deletions doc/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This document describes all available rules, what they
check for, examples of what they warn for, and how to
fix their warnings.

See the readme for a [list of external rules](https://github.com/wooorm/remark-lint#list-of-external-rules).

## Table of Contents

* [Rules](#rules)
Expand Down Expand Up @@ -75,12 +77,12 @@ be null or undefined in order to be ignored.
### externals

````md
<!-- Load more rules -->
```json
{
"externals": ["foo", "bar", "baz"]
}
```
<!-- Load more rules -->
```json
{
"externals": ["foo", "bar", "baz"]
}
```
````

Externals contains a list of extra rules to load.
Expand All @@ -92,13 +94,13 @@ name or a file), but in the browser an object must be passed in.
### reset

````md
<!-- Explicitly activate rules: -->
```json
{
"reset": true,
"final-newline": true
}
```
<!-- Explicitly activate rules: -->
```json
{
"reset": true,
"final-newline": true
}
```
````

By default, all rules are turned on unless explicitly set to `false`.
Expand Down Expand Up @@ -197,28 +199,28 @@ Options: `boolean`, default: `false`.
### code-block-style

````md
<!-- Valid, when set to `indented` or `consistent`, invalid when set to `fenced` -->
Hello
<!-- Valid, when set to `indented` or `consistent`, invalid when set to `fenced` -->
Hello

...
...

World
World

<!-- Valid, when set to `fenced` or `consistent`, invalid when set to `indented` -->
```
<!-- Valid, when set to `fenced` or `consistent`, invalid when set to `indented` -->
```
Hello
```
...
```bar
World
```

<!-- Always invalid -->
Hello
```
...
```bar
World
```

<!-- Always invalid -->
Hello
...
```
World
```
...
```
World
```
````

Warn when code-blocks do not adhere to a given style.
Expand Down Expand Up @@ -278,28 +280,28 @@ Options: `boolean`, default: `false`.
### fenced-code-flag

````md
<!-- Valid: -->
```hello
world();
```

<!-- Valid: -->
Hello

<!-- Invalid: -->
```
world();
```

<!-- Valid when given `{allowEmpty: true}`: -->
```
world();
```

<!-- Invalid when given `["world"]`: -->
```hello
world();
```
<!-- Valid: -->
```hello
world();
```

<!-- Valid: -->
Hello

<!-- Invalid: -->
```
world();
```

<!-- Valid when given `{allowEmpty: true}`: -->
```
world();
```

<!-- Invalid when given `["world"]`: -->
```hello
world();
```
````

Warn when fenced code blocks occur without language flag.
Expand All @@ -317,32 +319,32 @@ Options: `boolean`, default: `false`.
### fenced-code-marker

````md
<!-- Valid by default and `` '`' ``: -->
```foo
bar();
```

```
baz();
```

<!-- Valid by default and `'~'`: -->
~~~foo
bar();
~~~

~~~
baz();
~~~

<!-- Always invalid: -->
~~~foo
bar();
~~~

```
baz();
```
<!-- Valid by default and `` '`' ``: -->
```foo
bar();
```

```
baz();
```

<!-- Valid by default and `'~'`: -->
~~~foo
bar();
~~~

~~~
baz();
~~~

<!-- Always invalid: -->
~~~foo
bar();
~~~

```
baz();
```
````

Warn for violating fenced code markers.
Expand Down Expand Up @@ -962,24 +964,24 @@ Options: `boolean`, default: `false`.
### no-shell-dollars

````md
<!-- Invalid: -->
```bash
$ echo a
$ echo a > file
```

<!-- Valid: -->
```sh
echo a
echo a > file
```

<!-- Also valid: -->
```zsh
$ echo a
a
$ echo a > file
```
<!-- Invalid: -->
```bash
$ echo a
$ echo a > file
```

<!-- Valid: -->
```sh
echo a
echo a > file
```

<!-- Also valid: -->
```zsh
$ echo a
a
$ echo a > file
```
````

Warn when shell code is prefixed by dollar-characters.
Expand Down
25 changes: 23 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ a powerful markdown processor powered by [plugins](https://github.com/wooorm/rem
* [Configuring remark-lint](#configuring-remark-lint)
* [Using remark to fix your markdown](#using-remark-to-fix-your-markdown)
* [Editor Integrations](#editor-integrations)
* [List of External Rules](#list-of-external-rules)
* [Related](#related)
* [License](#license)

Expand Down Expand Up @@ -157,13 +158,33 @@ and I strongly suggest checking out how it can make your life easier :+1:

## Editor Integrations

Currently, **remark-lint** is integrated with Atom through [**leipert/linter-markdown**](https://atom.io/packages/linter-markdown).
Currently, **remark-lint** is integrated with Atom through [**linter-markdown**](https://atom.io/packages/linter-markdown).

I’m very interested in more integrations. Let me know if I can help.

## List of External Rules

* [`chcokr/mdast-lint-sentence-newline`](https://github.com/chcokr/mdast-lint-sentence-newline)
— Ensure sentences are followed by a newline;

* [`vhf/remark-lint-alphabetize-lists`](https://github.com/vhf/remark-lint-alphabetize-lists)
— Ensure list items are in alphabetical order;

* [`vhf/remark-lint-blank-lines-1-0-2`](https://github.com/vhf/remark-lint-blank-lines-1-0-2)
— Ensure a specific number of lines between blocks;

* [`vhf/remark-lint-books-links`](https://github.com/vhf/remark-lint-books-links)
— Ensure links in lists of books follow a standard format;

* [`vhf/remark-lint-no-empty-sections`](https://github.com/vhf/remark-lint-no-empty-sections)
— Ensure every heading is followed by content (forming a section);

* [`vhf/remark-lint-no-url-trailing-slash`](https://github.com/vhf/remark-lint-no-url-trailing-slash)
— Ensure that the `href` of links has no trailing slash.

## Related

* [`remark-validate-links`](https://github.com/wooorm/remark-validate-links)
* [`wooorm/remark-validate-links`](https://github.com/wooorm/remark-validate-links)
— Validate if links point to existing headings and files in markdown.

## License
Expand Down
41 changes: 32 additions & 9 deletions script/build-rule-documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,38 @@ children.push({
* Add main description.
*/

children.push({
'type': 'paragraph',
'children': [{
'type': 'text',
'value': 'This document describes all available rules, what they\n' +
'check for, examples of what they warn for, and how to\n' +
'fix their warnings.'
}]
});
children.push(
{
'type': 'paragraph',
'children': [{
'type': 'text',
'value': 'This document describes all available rules, what they\n' +
'check for, examples of what they warn for, and how to\n' +
'fix their warnings.'
}]
},
{
'type': 'paragraph',
'children': [
{
'type': 'text',
'value': 'See the readme for a '
},
{
'type': 'link',
'href': 'https://github.com/wooorm/remark-lint#list-of-external-rules',
'children': [{
'type': 'text',
'value': 'list of external rules'
}]
},
{
'type': 'text',
'value': '.'
}
]
}
);

/*
* Add the table-of-contents heading.
Expand Down

0 comments on commit 298b33a

Please sign in to comment.