Skip to content

Commit 34d9808

Browse files
authored
Enhance documentation style guide with code block and console output guidelines (#16443)
1 parent a918964 commit 34d9808

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

STYLE-GUIDE.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ This is a useful suggestion.
105105

106106
## Lists
107107

108-
- Use ordered lists for steps.
109-
- All items should begin with `1.` (Markdown will auto-number).
108+
- Use ordered lists for steps.
109+
- All items should begin with `1.` (Markdown will auto-number).
110110

111111
Example:
112112

@@ -118,6 +118,57 @@ Example:
118118

119119
---
120120

121+
## Code Blocks and Console Output
122+
123+
### Code Fences
124+
125+
Use fenced code blocks (triple backticks) for all code and console output.
126+
127+
**Supported languages for syntax highlighting:**
128+
- Language-specific: `typescript`, `python`, `go`, `java`, `csharp`, `yaml`, etc.
129+
- Shell commands: `bash`, `sh`
130+
- Console output: `output`
131+
132+
### Console Output
133+
134+
**Do not use indentation** (4 spaces) to denote console output. While technically valid Markdown, indented blocks are difficult for both humans and AI assistants to parse and maintain.
135+
136+
**Wrong:**
137+
138+
```markdown
139+
output line 1
140+
output line 2
141+
```
142+
143+
**Correct:**
144+
145+
````markdown
146+
```output
147+
output line 1
148+
output line 2
149+
```
150+
````
151+
152+
### Shell Commands vs Output
153+
154+
- Use `bash` or `sh` for commands the user should type
155+
- Use `output` for the resulting console output
156+
157+
**Example:**
158+
159+
```bash
160+
pulumi up
161+
```
162+
163+
```output
164+
Updating (dev)
165+
...
166+
```
167+
168+
**Rationale:** Fenced code blocks are explicit, easy to identify, and support syntax highlighting. Indented blocks can be confused with nested lists or quotes, especially when editing.
169+
170+
---
171+
121172
## Blockquotes
122173

123174
- Use blockquotes only for direct quotations.

0 commit comments

Comments
 (0)