Skip to content

Commit 3916c24

Browse files
committed
docs: add image rules to style and formatting guides
1 parent b94ec21 commit 3916c24

2 files changed

Lines changed: 150 additions & 8 deletions

File tree

writing-guides/formatting-guide.md

Lines changed: 130 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,143 @@ Do not use backticks for product names, UI labels, or general English words.
121121

122122
## Images
123123

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

126130
```mdx
127131
<Frame>
128-
![LLM Node Overview](https://assets-docs.dify.ai/.../image.png)
132+
![LLM Node Overview](/images/use-dify/workflow/llm-node-overview.png)
129133
</Frame>
130134
```
131135

132-
- 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.
135153

136154
```mdx
137-
<Frame caption="LLM Node Configuration Interface">
138-
![LLM Node Configuration Interface](https://assets-docs.dify.ai/.../image.png)
155+
<Frame caption="Correct: Highlight Used for Emphasis">
156+
![Correct: Highlight Used for Emphasis](/images/shared/emphasis-highlight.png)
157+
</Frame>
158+
159+
<Frame caption="Incorrect: Bounding Box Used for Emphasis">
160+
![Incorrect: Bounding Box Used for Emphasis](/images/shared/emphasis-box.png)
139161
</Frame>
140162
```
141163

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.
181+
182+
**`images/use-dify/`**
183+
184+
- `get-started/` — introductions, concepts, onboarding visuals
185+
- `workflow/` — workflow and chatflow authoring, nodes (including agent nodes), debug
186+
- `basic-app/` — agent apps, chatbot apps, completion apps, and other non-workflow app types
187+
- `knowledge/` — knowledge bases, documents, retrieval, indexing
188+
- `monitor/` — monitoring dashboards, logs, analytics
189+
- `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.
238+
239+
Examples:
240+
241+
-`images/use-dify/workflow/llm-node-overview.png`
242+
-`images/use-dify/workflow/llm-configure-parameters-01.png`
243+
-`images/use-dify/tutorial/workflow-101-lesson-02/start-node.png`
244+
-`images/develop-plugin/publish/marketplace-submit-form.png`
245+
-`images/use-dify/workflow/llm_node_overview.png` (underscores)
246+
-`images/use-dify/workflow/CleanShot2025-07-07at07.28.04@2x.png` (default tool name, retina suffix, special characters)
247+
-`images/use-dify/workflow/llm-node-overview.PNG` (uppercase extension)
248+
-`images/use-dify/workflow/screenshot-01.png` (not descriptive)
249+
250+
Rename default tool outputs (`CleanShot*`, `Screenshot*`, `IMG_*`) before committing.
251+
252+
### File Format and Size
253+
254+
- **PNG** for UI screenshots.
255+
- **SVG** for icons, logos, and diagrams.
256+
- **MP4 or WebP** for motion. Avoid GIF for static images; use GIF only when you need autoplay in contexts that do not support video.
257+
- Avoid JPEG for documentation screenshots. JPEG compression artifacts degrade UI detail.
258+
- Capture screenshots at **2x resolution** (Retina) so they render sharply on high-DPI displays.
259+
- Compress before committing (TinyPNG, squoosh, or equivalent). Target under 500 KB per image where feasible.
260+
142261
---
143262

144263
## Mintlify Components
@@ -285,6 +404,9 @@ Before submitting, verify:
285404
- [ ] Lists use dashes (`-`), not asterisks (`*`)
286405
- [ ] Code blocks have language tags
287406
- [ ] Internal links use absolute paths (`/en/...`)
288-
- [ ] Images have `alt` attributes
407+
- [ ] Images use `<Frame>` wrapping markdown `![]()`; alt text is in title case and under 125 characters
408+
- [ ] Image files are stored under the correct `images/<section>/` subfolder
409+
- [ ] Image filenames use kebab-case, are descriptive, and contain no default tool names
410+
- [ ] Comparison images (two or more shown together) each have a caption
289411
- [ ] No double blank lines
290412
- [ ] Em dashes and en dashes have no surrounding spaces

writing-guides/style-guide.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ Prefer prose over bullet points when explaining concepts or processes. Use bulle
2626

2727
Use tabs (not numbered lists) when presenting parallel options users choose between. Numbered lists imply sequence; tabs signal alternatives.
2828

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+
2949
## Callout Usage
3050

3151
- **Info**: General informational content—helpful context, version-specific or deployment-specific details

0 commit comments

Comments
 (0)