Skip to content

Commit a395d09

Browse files
authored
Fix custom rule to allow for sentences to start with a link to a command or file when preceded by an article (#1027)
1 parent 0ff5ec9 commit a395d09

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
= Redpanda Data Documentation Code Formatting Guidelines
22

3-
=== Commands and code
3+
== Commands and code
4+
5+
Don't start a sentence not inside a code block with a command or code. Instead, try to move the code into the middle of the sentence. For example, you can introduce the command with a more descriptive word like “Run”.
46

5-
Don’t start a sentence with a command or code. Instead, try to move the code into the middle of the sentence. Introduce the command with the more descriptive word “run” instead of “use the X command".
6-
+
77
*Correct:* Run the `rpk topic create` command to create a new topic.
8-
+
8+
99
*Incorrect:* `rpk topic create` creates a new topic.
1010

1111
Similarly, do not start a sentence with a filename.
12-
+
12+
1313
*Correct:* The `redpanda.yaml` file contains configuration parameters.
14-
+
14+
1515
*Incorrect:* `redpanda.yaml` contains configuration parameters.
16+
17+
This version is correct because the sentence starts with the definite article, providing a descriptive context before introducing the xref.
18+
19+
*Correct:*
20+
21+
[,asciidoc]
22+
----
23+
The xref:api:ROOT:admin-api.adoc#get-/v1/broker/pre_restart_probe[`pre_restart_probe`] endpoint identifies potential risks if a broker is restarted.
24+
----
25+
26+
*Incorrect:*
27+
28+
[,asciidoc]
29+
----
30+
xref:api:ROOT:admin-api.adoc#get-/v1/broker/pre_restart_probe[`pre_restart_probe`] is an endpoint.
31+
----
32+
33+
This version is incorrect because it starts directly with the xref. According to our style guidelines, sentences should not begin with a command, code snippet, or filename. Instead, the xref should be integrated into a descriptive sentence.

.hyperlint/reviewer/vale-style-guide/styles/CustomStyle/MeaningfulLinkText.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ tokens:
1010
- "link:.*\\[read more\\]"
1111
- "link:.*\\[see this blog post\\]"
1212
- "link:.*\\[blog post\\]"
13+
- "xref:.*\\[here\\]"
14+
- "xref:.*\\[this page\\]"
15+
- "xref:.*\\[read more\\]"
16+
- "xref:.*\\[see this blog post\\]"
17+
- "xref:.*\\[blog post\\]"
1318
- "<<.*,here>>"
1419
- "<<.*,this page>>"
1520
- "<<.*,read more>>"

0 commit comments

Comments
 (0)