Skip to content

Commit 053ee9f

Browse files
authored
Merge pull request #19285 from dvdksn/markdownlint-add-more-rules
test: add more lint rules for markdown
2 parents 18f1e23 + dc379cf commit 053ee9f

File tree

21 files changed

+71
-55
lines changed

21 files changed

+71
-55
lines changed

.markdownlint.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
22
"default": false,
33
"hr-style": true,
4+
"heading-start-left": true,
5+
"single-h1": true,
6+
"no-trailing-punctuation": true,
47
"no-missing-space-atx": true,
58
"no-multiple-space-atx": true,
69
"no-missing-space-closed-atx": true,
710
"no-multiple-space-closed-atx": true,
811
"no-space-in-emphasis": true,
912
"no-space-in-code": true,
1013
"no-space-in-links": true,
14+
"no-empty-links": true,
1115
"ol-prefix": {"style": "ordered"},
1216
"no-reversed-links": true,
1317
"reference-links-images": {
1418
"shortcut_syntax": true
1519
},
16-
"fenced-code-language": true
20+
"fenced-code-language": true,
21+
"table-pipe-style": true,
22+
"table-column-count": true
1723
}

content/admin/company/users.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ You can manage users at the company-level in the Docker Admin Console.
1212

1313
## Manage members on a team
1414

15-
Use Docker Hub to add a member to a team or remove a member from a team. For more details, see [Manage members in Docker Hub](#).
15+
Use Docker Hub to add a member to a team or remove a member from a team. For more details, see [Manage members in Docker Hub](../organization/members.md#manage-members-on-a-team).

content/build/cache/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ stages in parallel. Only the instructions in the `site` stage will end up as
243243
layers in the final image. The entire `git` history doesn't get embedded into
244244
the final result, which helps keep the image small and secure.
245245

246-
#### Combine commands together wherever possible.
246+
#### Combine commands together wherever possible
247247

248248
Most Dockerfile commands, and `RUN` commands in particular, can often be joined
249249
together. For example, instead of using `RUN` like this:

content/compose/gpu-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This provides more granular control over a GPU reservation as custom values can
3131

3232
For more information on these properties, see the [Compose Deploy Specification](compose-file/deploy.md#devices).
3333

34-
### Example of a Compose file for running a service with access to 1 GPU device:
34+
### Example of a Compose file for running a service with access to 1 GPU device
3535

3636
```yaml
3737
services:

content/compose/release-notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,7 +2865,7 @@ naming scheme accordingly before upgrading.
28652865
## 1.6.0
28662866
(2016-01-15)
28672867

2868-
### Major Features:
2868+
### Major Features
28692869

28702870
- Compose 1.6 introduces a new format for `docker-compose.yml` which lets
28712871
you define networks and volumes in the Compose file as well as services. It
@@ -2913,7 +2913,7 @@ naming scheme accordingly before upgrading.
29132913
`docker-compose up SERVICE` on a service with dependencies, those are started
29142914
as well.
29152915

2916-
### New Features:
2916+
### New Features
29172917

29182918
- Added a new command `config` which validates and prints the Compose
29192919
configuration after interpolating variables, resolving relative paths, and

content/compose/use-secrets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ In the advanced example above:
8181
>
8282
> The `_FILE` environment variables demonstrated here are a convention used by some images, including Docker Official Images like [mysql](https://hub.docker.com/_/mysql) and [postgres](https://hub.docker.com/_/postgres).
8383

84-
## Resources:
84+
## Resources
8585

8686
- [Secrets top-level element](compose-file/09-secrets.md)
87-
- [Secrets attribute for services top-level element](compose-file/05-services.md#secrets)
87+
- [Secrets attribute for services top-level element](compose-file/05-services.md#secrets)

content/config/formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ $ docker inspect --format "{{upper .Name}}" container
9797
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}' container
9898
```
9999

100-
# Hint
100+
## Hint
101101

102102
To find out what data can be printed, show all content as json:
103103

content/contribute/style/formatting.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ toc_max: 2
99

1010
Readers pay fractionally more attention to headings, bulleted lists, and links, so it's important to ensure the first two to three words in those items "front load" information as much as possible.
1111

12-
### Best practice:
12+
### Best practice
1313

1414
- Headings and subheadings should let the reader know what they will find on the page.
1515
- They should describe succinctly and accurately what the content is about.
@@ -21,7 +21,7 @@ Readers pay fractionally more attention to headings, bulleted lists, and links,
2121

2222
Page titles should be action orientated. For example: - _Enable SCIM_ - _Install Docker Desktop_
2323

24-
### Best practice:
24+
### Best practice
2525

2626
- Make sure the title of your page and the table of contents (TOC) entry matches.
2727
- If you want to use a ‘:’ in a page title in the table of contents (\_toc.yaml), you must wrap the entire title in “” to avoid breaking the build.
@@ -31,7 +31,7 @@ Page titles should be action orientated. For example: - _Enable SCIM_ - _Install
3131

3232
Images, including screenshots, can help a reader better understand a concept. However, you should use them sparingly as they tend to go out-of-date.
3333

34-
### Best practice:
34+
### Best practice
3535

3636
- When you take screenshots:
3737
- Don’t use lorem ipsum text. Try to replicate how someone would use the feature in a real-world scenario, and use realistic text.
@@ -52,7 +52,7 @@ When people follow links, they can often lose their train of thought and fail to
5252

5353
The best links offer readers another way to scan information.
5454

55-
### Best practice:
55+
### Best practice
5656

5757
- Use plain language that doesn't mislead or promise too much.
5858
- Be short and descriptive (around five words is best).
@@ -72,7 +72,7 @@ To apply inline code style, wrap the text in a single backtick (`).
7272

7373
For information on how to add code blocks to your content, see [Useful component and formatting examples](../components/code-blocks.md).
7474

75-
### Best practice for commands:
75+
### Best practice for commands
7676

7777
- Command prompt and shell:
7878
- For a non-privileged shell, prefix commands in code blocks with the $ prompt symbol.
@@ -89,7 +89,7 @@ For information on how to add code blocks to your content, see [Useful component
8989
- Use pipes ( \| ) between mutually exclusive arguments.
9090
- Use three dots ( ... ) after repeated arguments.
9191

92-
### Best practice for code:
92+
### Best practice for code
9393

9494
- Indent code blocks by 3 spaces when you nest a code block under a list item.
9595
- Use three dots ( ... ) when you omit code.
@@ -98,7 +98,7 @@ For information on how to add code blocks to your content, see [Useful component
9898

9999
Use callouts to emphasize selected information on a page.
100100

101-
### Best practice:
101+
### Best practice
102102

103103
- Format the word Warning, Important, or Note in bold. Don't bold the content within the callout.
104104
- It's good practice to avoid placing a lot of text callouts on one page. They can create a cluttered appearance if used to excess, and you'll diminish their impact.
@@ -110,7 +110,7 @@ Use callouts to emphasize selected information on a page.
110110
| Important | Use an Important tag to signal to the reader where actions may cause issues of a lower magnitude. | Yellow |
111111
| | ✅ Example: Update to the Docker Desktop terms | |
112112
| Note | Use the Note tag for information that may not apply to all readers, or if the information is tangential to a topic. | Blue |
113-
| | ✅ Example: Deleting a repository deletes all the images it contains and its build settings. This action cannot be undone. |
113+
| | ✅ Example: Deleting a repository deletes all the images it contains and its build settings. This action cannot be undone. | |
114114

115115
For information on how to add callouts to your content, see [Useful component and formatting examples](../components/call-outs.md).
116116

@@ -149,7 +149,7 @@ Use tables to describe complex information in a straightforward manner.
149149

150150
Note that in many cases, an unordered list is enough to describe a list of items with a single, simple description per item. But, if you have data that’s best described by a matrix, tables are the best choice.
151151

152-
### Best practice:
152+
### Best practice
153153

154154
- Use sentence case for table headings.
155155
- To keep tables accessible and scannable, tables shouldn't have any empty cells. If there is no otherwise meaningful value for a cell, consider entering N/A for ‘not applicable’ or None.
@@ -173,4 +173,4 @@ When you're referring to units of measurement, use the abbreviated form in all c
173173
| --- | --- |
174174
| 10 GB | 10GB |
175175
| 10 GB | 10 gb |
176-
| 10 GB | 10 gigabytes |
176+
| 10 GB | 10 gigabytes |

content/contribute/style/grammar.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An acronym is an abbreviation you would speak as a word, for example, ROM (for r
1313

1414
An initialism is a type of acronym that comprises a group of initial letters used as an abbreviation for a name or expression. If you were using the acronym in a spoken conversation, you would enunciate each letter: H-T-M-L for Hypertext Markup Language.
1515

16-
### Best practice:
16+
### Best practice
1717

1818
- Spell out lesser-known acronyms or initialisms on first use, then follow with the acronym or initialism in parentheses. After this, throughout the rest of your page or document, use the acronym or initialism alone.
1919
> ‘You can use single sign-on (SSO) to sign in to Notion. You may need to ask your administrator to enable SSO.’
@@ -26,7 +26,7 @@ An initialism is a type of acronym that comprises a group of initial letters use
2626

2727
Unless you're referring to UI text or user-defined text, you shouldn't add emphasis to text. Clear, front-loaded wording makes the subject of a sentence clear.
2828

29-
### Best practice:
29+
### Best practice
3030

3131
- Don't use bold to refer to a feature name.
3232
- Use italics sparingly, as this type of formatting can be difficult to read in digital experiences.
@@ -63,7 +63,7 @@ A contraction results from letters being left out from the original word or phra
6363

6464
Following our conversational approach, it's acceptable to use contractions in almost all content types. Just don't get carried away. Too many contractions in a sentence can make it difficult to read.
6565

66-
### Best practice:
66+
### Best practice
6767

6868
- Stay consistent - don't switch between contractions and their spelled-out equivalents in body copy or UI text.
6969
- Avoid negative contractions (can't, don't, wouldn't, and shouldn't) whenever possible. Try to rewrite your sentence to align with our helpful approach that puts the focus on solutions, not problems.
@@ -79,7 +79,7 @@ When possible, use the month's full name (October 1, 2022). If there are space c
7979

8080
In all UI content and technical documentation, use decimals instead of fractions.
8181

82-
### Best practice:
82+
### Best practice
8383

8484
- Always carry decimals to at least the hundredth place (33.76).
8585
- In tables, align decimals on the decimal point.
@@ -89,7 +89,7 @@ In all UI content and technical documentation, use decimals instead of fractions
8989

9090
Lists are a great way to break down complex ideas and make them easier to read and scan.
9191

92-
### Best practice:
92+
### Best practice
9393

9494
- Bulleted lists should contain relatively few words or short phrases. For most content types, limit the number of items in a list to five.
9595
- Don’t add commas (,) or semicolons (;) to the ends of list items.
@@ -168,4 +168,4 @@ Don't use parentheses in technical documentation. They can reduce the readabilit
168168

169169
## Third party documentation
170170

171-
If you are documenting a task that requires the use of a third-party product, link out to the third-party's documentation. Don't copy the content because it might violate copyright. It can also result in an unnecessary maintenance burden of having to keep the docs up-to-date when the third-party changes or updates their product. It is best practice to link to the single source of truth.
171+
If you are documenting a task that requires the use of a third-party product, link out to the third-party's documentation. Don't copy the content because it might violate copyright. It can also result in an unnecessary maintenance burden of having to keep the docs up-to-date when the third-party changes or updates their product. It is best practice to link to the single source of truth.

content/contribute/style/recommended-words.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ _In Docker Desktop 4.1 and lower._
8686

8787
What might be easy for you might not be easy for others. Try eliminating this word from the sentence because usually the same meaning can be conveyed without it.
8888

89+
<!-- markdownlint-disable no-trailing-punctuation -->
90+
8991
#### e.g.
9092

93+
<!-- markdownlint-enable no-trailing-punctuation -->
94+
9195
Don't use. Instead, use phrases like `for example` or `such as`.
9296

9397
#### enable
@@ -160,9 +164,9 @@ _Turn on the dark mode toggle._
160164

161165
Use `upgrade` when describing a higher subscription tier
162166

163-
#### vs.
167+
#### vs
164168

165-
Don't use `vs.` as an abbreviation for versus; instead, use the unabbreviated `versus`.
169+
Don't use `vs` or `vs.` as an abbreviation for versus; instead, use the unabbreviated `versus`.
166170

167171
#### we
168172

@@ -178,4 +182,4 @@ _We created a feature for you to add widgets._
178182

179183
#### wish
180184

181-
Don't use. Use `want` instead.
185+
Don't use. Use `want` instead.

0 commit comments

Comments
 (0)