You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: writing-guides/formatting-guide.md
+130-8Lines changed: 130 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,24 +121,143 @@ Do not use backticks for product names, UI labels, or general English words.
121
121
122
122
## Images
123
123
124
-
### Preferred Format (Frame Component)
124
+
For editorial guidance on whether to include an image at all, see the [Style Guide](./style-guide.md#images). The rules below cover mechanics only.
125
+
126
+
### Syntax
127
+
128
+
Use a `<Frame>` component wrapping a markdown image. This gives responsive sizing, consistent visual styling, and proper caption support. Do not use raw `<img>` tags.
- Use a `<Frame>` component wrapping `![]()` markdown syntax by default.
133
-
- Always include a descriptive `alt` attribute in **title case**.
134
-
- Only add a `caption` when the image's meaning is not clear from context—captions are visible to all readers, while alt text only displays if the image fails to load. Use **title case** for captions.
136
+
### Alt Text
137
+
138
+
Every image must have descriptive alt text. Alt text is read by screen readers and shown when an image fails to load.
139
+
140
+
- Use **Title Case**, matching the convention for headings and UI element references.
141
+
- Describe what the image communicates in context, not its visual appearance. "LLM Node Configuration Panel" is better than "Screenshot of a form with dropdowns."
142
+
- Keep alt text under 125 characters. Screen readers truncate beyond that length.
143
+
- Use `alt=""` (empty) for purely decorative images that carry no information. This is rare in documentation.
144
+
145
+
### Captions
146
+
147
+
Captions are visible to every reader; alt text is a fallback for screen readers and broken-image cases. They differ in visibility, but they describe the same image, so they should say the same thing.
148
+
149
+
- Required when two or more images are presented together for comparison. Each image in the set needs a caption identifying what it shows, so readers can tell the images apart without inferring from context.
150
+
- Optional elsewhere.
151
+
- Use **Title Case** for captions.
152
+
-**When a Frame has a caption, the alt text must match the caption exactly.** If you cannot think of a reason the two should differ, they should be identical.
<Framecaption="Correct: Highlight Used for Emphasis">
156
+

157
+
</Frame>
158
+
159
+
<Framecaption="Incorrect: Bounding Box Used for Emphasis">
160
+

139
161
</Frame>
140
162
```
141
163
164
+
### Storage
165
+
166
+
All new images go in `/images/`, organized by **content domain**, not by where the image is referenced from. A content domain is a stable topical area that outlives nav reshuffles and physical folder refactors.
167
+
168
+
### Tier 1: top-level dropdown
169
+
170
+
Matches the four top-level dropdowns in `docs.json`, plus `shared/` for cross-section assets:
171
+
172
+
-`images/use-dify/`
173
+
-`images/develop-plugin/`
174
+
-`images/self-host/`
175
+
-`images/api-reference/`
176
+
-`images/shared/`
177
+
178
+
### Tier 2: content domain
179
+
180
+
A **closed list** of topical subfolders within each tier-1 section. Contributors choose from this list. Adding a new tier-2 folder requires a writing team discussion; do not create ad-hoc folders.
-`publish/` — publishing apps, WebApp chrome, API access, conversation features
190
+
-`tutorial/` — step-by-step guides, multi-lesson series
191
+
-`workspace/` — team settings, credentials, model providers, billing
192
+
193
+
**`images/develop-plugin/`**
194
+
195
+
-`get-started/`
196
+
-`dev-guide/` — plugin development walkthroughs
197
+
-`specs/` — schemas, manifests, specifications
198
+
-`publish/` — marketplace listing and release
199
+
200
+
**`images/self-host/`** and **`images/api-reference/`**
201
+
202
+
Flat within the tier-1 folder for now. Tier-2 will be added when content volume justifies it.
203
+
204
+
### Tier 3: per-tutorial subfolders and rare promotions
205
+
206
+
Tier-3 subfolders apply in two cases.
207
+
208
+
**Tutorials always get their own tier-3 subfolder, regardless of image count.** Each tutorial is a self-contained unit, and its images do not mix with images from other tutorials. For multi-lesson series like Workflow 101, each lesson is its own tier-3 subfolder.
209
+
210
+
-`images/use-dify/tutorial/simple-chatbot/` — single-page tutorial, one folder
211
+
-`images/use-dify/tutorial/workflow-101-lesson-01/` — multi-lesson series, one folder per lesson
212
+
213
+
**Other tier-2 folders may earn a tier-3 promotion** when they accumulate roughly 30 or more images AND the excess is a self-contained sub-area. For smaller sub-areas, use a filename prefix instead of a new folder. For example, `workflow/trigger-schedule-config.png` rather than `workflow/trigger/schedule-config.png` when there are only a handful of trigger images.
214
+
215
+
Promotions to tier-3 require updating every reference to every image in the affected sub-area, across `en/`, `zh/`, and `ja/`. Use the migration tooling at `tools/image-migration/` if it exists, or script the rename pass to keep references in sync.
216
+
217
+
### When a folder path provides context, do not repeat it in filenames
218
+
219
+
When an image lives inside a descriptive subfolder, the filename should not duplicate the folder's context. Inside `images/use-dify/tutorial/workflow-101-lesson-02/`, the file is `start-node.png`, not `workflow-101-lesson-02-start-node.png`. The folder path already says what lesson and series the image belongs to.
220
+
221
+
This applies most strongly to tier-3 tutorial folders where the folder name encodes the tutorial identity. In tier-2 folders where the subfolder is a broad domain like `workflow/`, filenames may still need a domain-specific prefix for grep-friendliness.
222
+
223
+
### Legacy CDN images
224
+
225
+
Do not commit new images from external CDNs to the repo. Existing CDN-hosted images (`assets-docs.dify.ai`) remain as legacy; all new images are local.
226
+
227
+
### Naming
228
+
229
+
Format: `[descriptive-name].[extension]`, optionally with a module prefix and a two-digit sequence suffix.
230
+
231
+
-**kebab-case, lowercase, ASCII only.** No underscores, spaces, Chinese characters, parentheses, or special characters (`@`, `&`, and so on).
232
+
-**Lowercase file extensions.**`.png`, not `.PNG`. `.jpg`, not `.JPG`.
233
+
-**No retina suffixes in filenames.** Strip `@2x`, `@3x`, and similar designators. They describe display metadata, not content. The file may still be a 2x asset; the filename does not need to advertise it.
234
+
-**Descriptive and specific.**`workflow-llm-node-parameters.png` beats `workflow-01.png` or `screenshot.png`.
235
+
-**Base-form verbs.**`configure-load-balance`, not `configuring-load-balance`. Matches the heading convention.
236
+
-**Module prefix is optional** when the subfolder already provides scope. Use a prefix when the filename alone would be ambiguous out of context, or when you want grep-friendly grouping within a subfolder.
237
+
-**Numeric suffix only for genuine sequences.** Use `01`, `02`, `03` (zero-padded to two digits) only when multiple images share the same module and description and need ordering. Zero-padding ensures natural sort order. Do not use numeric suffixes as a shortcut for lazy naming.
Copy file name to clipboardExpand all lines: writing-guides/style-guide.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,26 @@ Prefer prose over bullet points when explaining concepts or processes. Use bulle
26
26
27
27
Use tabs (not numbered lists) when presenting parallel options users choose between. Numbered lists imply sequence; tabs signal alternatives.
28
28
29
+
## Images
30
+
31
+
An image should clarify something text cannot, not decorate the page. Documentation readers are trying to accomplish a task, and every visual element competes with the text for their attention. Images that repeat what the prose already says dilute the content rather than reinforce it.
32
+
33
+
Before adding an image, ask three questions in order:
34
+
35
+
1. Can the reader understand this section without it?
36
+
2. If not, can rewording or restructuring the prose solve the problem?
37
+
3. Is the image the only way to convey this information?
38
+
39
+
Only add the image when the answer to the first two is no and the answer to the third is yes. Screenshots of obvious UI, decorative banners, and illustrations that restate the heading all belong in the cut column.
40
+
41
+
When an image is warranted:
42
+
43
+
- Prefer highlight marks (fills, color overlays) over bounding boxes to draw attention. Boxes pile up and age poorly; highlights integrate with the screenshot.
44
+
- Use right angles, not rounded corners, so screenshots match the actual product UI.
45
+
- Crop tightly to the relevant area. A full-window screenshot where only a panel matters is visual noise.
46
+
47
+
For the mechanics of image syntax, alt text, captions, and storage, see the [Formatting Guide](./formatting-guide.md#images).
48
+
29
49
## Callout Usage
30
50
31
51
-**Info**: General informational content—helpful context, version-specific or deployment-specific details
0 commit comments