Skip to content

Commit

Permalink
Mostly standardize on putting rule names and tags in code spans in do…
Browse files Browse the repository at this point in the history
…cumentation.
  • Loading branch information
DavidAnson committed Oct 30, 2022
1 parent 13b4340 commit 52044c8
Show file tree
Hide file tree
Showing 53 changed files with 326 additions and 325 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,33 @@ See [Rules.md](doc/Rules.md) for more details.
Tags group related rules and can be used to enable/disable multiple
rules at once.

* **accessibility** - MD045
* **atx** - MD018, MD019
* **atx_closed** - MD020, MD021
* **blank_lines** - MD012, MD022, MD031, MD032, MD047
* **blockquote** - MD027, MD028
* **bullet** - MD004, MD005, MD006, MD007, MD032
* **code** - MD014, MD031, MD038, MD040, MD046, MD048
* **emphasis** - MD036, MD037, MD049, MD050
* **hard_tab** - MD010
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
MD023, MD024, MD025, MD026, MD036, MD041, MD043
* **headings** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
MD023, MD024, MD025, MD026, MD036, MD041, MD043
* **hr** - MD035
* **html** - MD033
* **images** - MD045, MD052, MD053
* **indentation** - MD005, MD006, MD007, MD027
* **language** - MD040
* **line_length** - MD013
* **links** - MD011, MD034, MD039, MD042, MD051, MD052, MD053
* **ol** - MD029, MD030, MD032
* **spaces** - MD018, MD019, MD020, MD021, MD023
* **spelling** - MD044
* **ul** - MD004, MD005, MD006, MD007, MD030, MD032
* **url** - MD034
* **whitespace** - MD009, MD010, MD012, MD027, MD028, MD030, MD037,
MD038, MD039
* **`accessibility`** - `MD045`
* **`atx`** - `MD018`, `MD019`
* **`atx_closed`** - `MD020`, `MD021`
* **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
* **`blockquote`** - `MD027`, `MD028`
* **`bullet`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD032`
* **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
* **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
* **`hard_tab`** - `MD010`
* **`headers`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
* **`headings`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
* **`hr`** - `MD035`
* **`html`** - `MD033`
* **`images`** - `MD045`, `MD052`, `MD053`
* **`indentation`** - `MD005`, `MD006`, `MD007`, `MD027`
* **`language`** - `MD040`
* **`line_length`** - `MD013`
* **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`
* **`ol`** - `MD029`, `MD030`, `MD032`
* **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
* **`spelling`** - `MD044`
* **`ul`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD030`, `MD032`
* **`url`** - `MD034`
* **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`, `MD037`,
`MD038`, `MD039`

## Configuration

Expand Down
7 changes: 4 additions & 3 deletions doc-build/build-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { newLineRe } from "../helpers/helpers.js";
import { deprecatedRuleNames, fixableRuleNames } from "../lib/constants.js";

const pathFor = (relativePath) => new URL(relativePath, import.meta.url);
const inCode = (items) => items.map((item) => `\`${item}\``);
const sortedComma = (items) => items.sort().join(", ");
const linesFrom = (text) => text.split(newLineRe);

Expand All @@ -28,7 +29,7 @@ for (const rule of rules) {
);
const section = [];
section.push(
`## ${decorator}${name} - ${rule.description}${decorator}`,
`## ${decorator}\`${name}\` - ${rule.description}${decorator}`,
""
);
if (deprecated) {
Expand All @@ -38,9 +39,9 @@ for (const rule of rules) {
);
}
section.push(
`Tags: ${sortedComma(rule.tags)}`,
`Tags: ${sortedComma(inCode(rule.tags))}`,
"",
`Aliases: ${sortedComma(rule.names.slice(1))}`,
`Aliases: ${sortedComma(inCode(rule.names.slice(1)))}`,
""
);
const ruleData = schema.properties[name];
Expand Down
Loading

1 comment on commit 52044c8

@hossain666
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.