Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .hyperlint/reviewer/custom-style-guide/code-formatting.adoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
= Redpanda Data Documentation Code Formatting Guidelines

=== Commands and code
== Commands and code

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”.

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".
+
*Correct:* Run the `rpk topic create` command to create a new topic.
+

*Incorrect:* `rpk topic create` creates a new topic.

Similarly, do not start a sentence with a filename.
+

*Correct:* The `redpanda.yaml` file contains configuration parameters.
+

*Incorrect:* `redpanda.yaml` contains configuration parameters.

This version is correct because the sentence starts with the definite article, providing a descriptive context before introducing the xref.

*Correct:*

[,asciidoc]
----
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.
----

*Incorrect:*

[,asciidoc]
----
xref:api:ROOT:admin-api.adoc#get-/v1/broker/pre_restart_probe[`pre_restart_probe`] is an endpoint.
----

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.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ tokens:
- "link:.*\\[read more\\]"
- "link:.*\\[see this blog post\\]"
- "link:.*\\[blog post\\]"
- "xref:.*\\[here\\]"
- "xref:.*\\[this page\\]"
- "xref:.*\\[read more\\]"
- "xref:.*\\[see this blog post\\]"
- "xref:.*\\[blog post\\]"
- "<<.*,here>>"
- "<<.*,this page>>"
- "<<.*,read more>>"
Expand Down