mirror of
https://github.com/larksuite/cli.git
synced 2026-08-03 08:32:46 +08:00
Compare commits
9 Commits
codex/cli-
...
feat/slide
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a5594616d | ||
|
|
4a60bab08e | ||
|
|
8229065f29 | ||
|
|
44a47dccd4 | ||
|
|
2487e7a9a3 | ||
|
|
0a9dd12908 | ||
|
|
a7c4fd310c | ||
|
|
c89c8f9c37 | ||
|
|
cc8d309601 |
@@ -81,6 +81,7 @@ lark-cli auth login --domain slides
|
||||
|
||||
按需再读:
|
||||
|
||||
- 配色:[`style-presets.md`](references/style-presets.md)(用户没给具体颜色时,读它按文档类型选一套)
|
||||
- 创建:[`lark-slides-create.md`](references/lark-slides-create.md)
|
||||
- 编辑:[`lark-slides-edit-workflows.md`](references/lark-slides-edit-workflows.md)、[`lark-slides-replace-slide.md`](references/lark-slides-replace-slide.md)、[`lark-slides-replace-pages.md`](references/lark-slides-replace-pages.md)
|
||||
- 截图:[`lark-slides-screenshot.md`](references/lark-slides-screenshot.md)
|
||||
@@ -97,7 +98,7 @@ lark-cli auth login --domain slides
|
||||
|
||||
不要生成无设计感的幻灯片。纯白背景 + 标题 + bullets 只能作为极简临时稿,不能作为正式交付。
|
||||
|
||||
开始写 XML 前,先在 `slide_plan.json` 里确定 deck 级视觉策略:
|
||||
开始写 XML 前,先在 `slide_plan.json` 里确定 deck 级视觉策略。用户没在 prompt 里给具体颜色/色板(hex、品牌色、或明确"用 XX 色")时,优先读 [style-presets.md](references/style-presets.md) 按文档类型挑一套成品配色;尽量不要仅凭主题或行业的固有印象去套色(这类直觉常常不可靠),也不要凭空造色:
|
||||
|
||||
- **主题化配色**:配色必须服务本次主题、行业和受众,不要默认蓝色商务风。如果把同一套颜色换到另一个完全不同主题仍然成立,说明配色不够具体。
|
||||
- **主次比例**:选择 1 个主色承担约 60-70% 视觉权重,1-2 个辅助色承担结构和分区,1 个强调色只用于关键数字、结论或行动点。不要让所有颜色权重相同。
|
||||
|
||||
@@ -58,23 +58,29 @@ Exception:
|
||||
"visual_system": {
|
||||
"background_strategy": "Content pages use one light base; cover and closing may use a related dark treatment with the same accent system.",
|
||||
"motif": "A reusable left accent bar and consistent card/header treatments.",
|
||||
"layout_system": "Deck-wide layout character (density + grid / columns / whitespace / rhythm); copy the matched preset's layout line here. How it drives page geometry: visual-planning.md → Style System.",
|
||||
"color_roles": {
|
||||
"primary": "Used for the dominant structural motif and about 60-70% of visual weight.",
|
||||
"secondary": "Used for grouped regions, comparison panels, or supporting categories.",
|
||||
"accent": "Used only for key numbers, conclusions, or focus markers."
|
||||
"accent": "Used only for key numbers, conclusions, or focus markers.",
|
||||
"background": "Shared base fill for ordinary content pages.",
|
||||
"text_main": "Body and title text color.",
|
||||
"text_sub": "Caption, footer, and note text color."
|
||||
}
|
||||
},
|
||||
"typography_constraints": {
|
||||
"title_max_lines": 2,
|
||||
"body_max_lines_per_box": 2,
|
||||
"footer_max_lines": 1,
|
||||
"long_text_handling": "Shorten, split into multiple boxes, or move detail to speaker notes instead of shrinking into a tight box."
|
||||
"long_text_handling": "Shorten, split into multiple boxes, or move detail to speaker notes instead of shrinking into a tight box.",
|
||||
"font_family": "Fonts by role — CJK / Latin / number-emphasis. When a style preset is used, copy its font line here. See visual-planning.md → Style System for how each role is applied to `fontFamily`."
|
||||
},
|
||||
"verification_plan": {
|
||||
"check_background_consistency": true,
|
||||
"check_text_fit": true,
|
||||
"check_visual_focus": true,
|
||||
"check_asset_rendering": true
|
||||
"check_asset_rendering": true,
|
||||
"check_color_role_discipline": true
|
||||
},
|
||||
"slides": [
|
||||
{
|
||||
@@ -103,9 +109,9 @@ Top-level fields:
|
||||
- `presentation_goal`: what the whole deck is trying to achieve.
|
||||
- `audience`: target readers or listeners and their assumed background.
|
||||
- `theme_style`: visual tone, palette direction, and professional style.
|
||||
- `visual_system`: deck-level visual rules that must stay stable across pages, including background strategy, recurring motif, and color roles.
|
||||
- `visual_system`: deck-level visual rules that must stay stable across pages, including background strategy, recurring motif, color roles, and `layout_system` (deck density + layout character).
|
||||
- `typography_constraints`: deck-level limits for line count, text box density, and how to handle long text before XML generation.
|
||||
- `verification_plan`: explicit checks to perform after creation or major edits; include background consistency, text fit, visual focus, and asset rendering when relevant.
|
||||
- `verification_plan`: explicit checks to perform after creation or major edits; include background consistency, text fit, visual focus, and asset rendering when relevant. When a fixed palette is used, also set `check_color_role_discipline` (only the 6 role colors are used; `accent` is not overused as large fills).
|
||||
- `slides`: ordered page plans.
|
||||
|
||||
Each slide must include:
|
||||
@@ -147,6 +153,8 @@ When `chart_contract.required == true`, XML generation must produce a `<chart>`
|
||||
|
||||
`data_series_required` means the generated XML must include `<chartData>`. It does not require user-provided real-world values. When real values are unavailable but chart expression is part of the user's intent, write mock or placeholder values into native `<chart>` and label them clearly instead of switching to manual drawing primitives or metric blocks.
|
||||
|
||||
A deck's palette and fonts may come from the user, your own design, or an external style library. Whatever the source, resolve it into the six `visual_system.color_roles`; the mapping and the accent-gap rule (derive an emphasis color when none is saturated enough) live in `visual-planning.md` → Style System.
|
||||
|
||||
## Layout Vocabulary
|
||||
|
||||
Use one of these `layout_type` values unless the user explicitly needs a custom structure:
|
||||
@@ -182,7 +190,7 @@ Before generating XML, define a visual system that can survive the whole deck:
|
||||
|
||||
- `background_strategy`: specify the default background for normal content pages, and which page roles may intentionally differ. Do not let pages drift through near-identical but inconsistent background colors.
|
||||
- `motif`: choose one or two reusable structural devices, such as a side bar, header rail, numbered node, card treatment, diagram lane, or section band. The motif should appear consistently enough that pages feel related.
|
||||
- `color_roles`: assign primary, secondary, and accent roles. The same color must not mean unrelated things across pages.
|
||||
- `color_roles`: assign the six roles — `primary`, `secondary`, `accent`, `background`, `text_main`, `text_sub`. Pages must use only these; the same color must not mean unrelated things across pages. If no sufficiently saturated emphasis color exists, derive one for `accent` (see `visual-planning.md` → Style System).
|
||||
- `cover_content_relationship`: if the cover uses a different dark or image-led treatment, state how it connects to content pages through shared colors, motifs, or geometry.
|
||||
- `closing_relationship`: if the closing page mirrors the cover, state that explicitly so it looks intentional rather than like a new theme.
|
||||
|
||||
|
||||
89
skills/lark-slides/references/style-presets.md
Normal file
89
skills/lark-slides/references/style-presets.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Style Presets
|
||||
|
||||
Ready-made color + layout + font palettes. When the user does not supply a brand palette, and the deck **genuinely belongs to** one of the preset document types below, pick that preset — match the deck against each preset's **Use-for** line — then copy its values into `slide_plan.json`'s `visual_system.color_roles`, `visual_system.layout_system`, and `typography_constraints.font_family`, and let `visual-planning.md` → Style System govern how colors, layout, and fonts are applied. Do not invent colors when a preset genuinely fits.
|
||||
|
||||
Match on what the deck **is** (a data-analysis report, a pitch deck, a lesson…), not on the industry it is about. A finance / bank / government topic does not imply navy or red — resolve it to the document type first (e.g. a bank performance review is a *data-analysis report* → preset 4).
|
||||
|
||||
Match literally; do not stretch a preset by loose analogy. A preset's **Use-for** line names a specific document; "it also presents something" or "it also lays out a plan" does not make a deck a fundraising pitch or a business report. **When no preset's Use-for line clearly covers the deck (many personal, lifestyle, or creative decks won't), do not force the nearest one — self-configure a coherent, topic-appropriate palette using the same `color_roles` + `layout_system` + `font_family` framework** (six roles, a density + layout-system line, and CJK / Latin / number fonts).
|
||||
|
||||
Each preset fills all six color roles. Where the source palette had no saturated emphasis color, the `accent` was derived per the accent-gap rule and is marked `(derived)`; every preset is ready to use as-is.
|
||||
|
||||
## Presets
|
||||
|
||||
Each preset is self-contained: scenario heading, tone + density, the six color roles, a layout system, and fonts. Pick one, copy its values into the plan (shape shown in *How to apply*).
|
||||
|
||||
### 1. Investment / industry research report
|
||||
*Use for: industry research reports, market / sector studies, investment & due-diligence reports*
|
||||
*Tone: minimal, professional, data-driven, authoritative-restrained, Density: medium–high*
|
||||
- **colors** — primary `#415A77` steel blue, secondary `#0D1B2A` deep navy, accent `#2E6FB0` (derived) bright steel blue, background `#F3F4F6` cool white, text_main `#0D1B2A`, text_sub `#6B7788` blue-gray
|
||||
- **layout** (`layout_system`) — high density · consulting-report layout system: 12-column grid, thin dividers, data tables and chart pages; fixed header / page-number / section-number / annotation zones; rational, clear, review-ready rhythm
|
||||
- **fonts** (`font_family`) — CJK 思源黑体, 思源宋体; Latin Inter, IBM Plex Sans; number Roboto Mono
|
||||
|
||||
### 2. Government / party work summary
|
||||
*Use for: party-building summaries, policy interpretation, corporate-policy rollouts, government reporting*
|
||||
*Tone: clean, dignified, credible, warm, low-saturation civic, Density: medium*
|
||||
- **colors** — primary `#C0453D` brick red, secondary `#D4B15C` gold, accent `#D4B15C` gold, background `#F7F3EE` warm ivory, text_main `#333333` charcoal, text_sub `#7A756F` warm gray
|
||||
- **layout** (`layout_system`) — medium density · modern civic-brochure layout system: cover uses a large color block + strong title, content pages use left/right zoning, regular grids, and clear whitespace; emphasize information hierarchy and a dignified, humane tone; avoid the traditional red-and-gold pile-up
|
||||
- **fonts** (`font_family`) — CJK 思源黑体, 寒蝉德黑体; Latin Inter, Libre Franklin; number Rajdhani
|
||||
|
||||
### 3. Pitch deck / business plan
|
||||
*Use for: fundraising pitches, business plans, project roadshows*
|
||||
*Tone: minimal, premium, international, strategic, composed, Density: low–medium*
|
||||
- **colors** — primary `#415A77` steel blue, secondary `#0D1B2A` deep navy, accent `#2E6FB0` (derived) bright steel blue, background `#F5F6F8` cool white, text_main `#0D1B2A`, text_sub `#5F6F82` blue-gray
|
||||
- **layout** (`layout_system`) — low–medium density · premium business-brochure layout system: large titles, generous whitespace, color-block zoning, and small layout swatches throughout; section pages feel more brand-led, content pages keep a restrained business-narrative rhythm
|
||||
- **fonts** (`font_family`) — CJK 思源宋体, 思源黑体; Latin Playfair Display, Inter; number Oswald
|
||||
|
||||
### 4. Market / data analysis
|
||||
*Use for: data-analysis reports, market / competitor analysis, operations / performance / KPI analysis*
|
||||
*Tone: clean, data-driven, analytical, credible, Density: medium–high*
|
||||
- **colors** — primary `#3D6B63` gray-green, secondary `#0F1720` dark blue-black, accent `#1F9E7A` (derived) bright green, background `#F7F7F5` warm white, text_main `#0F1720`, text_sub `#6B7280` neutral gray
|
||||
- **layout** (`layout_system`) — medium–high density · data-analysis layout system: topic narrative on the left, charts / key points / components / swatch modules on the right; an "insight → data → conclusion" rhythm; clearly zoned but not crowded
|
||||
- **fonts** (`font_family`) — CJK 寒蝉德黑体, 思源黑体; Latin Inter, IBM Plex Sans; number Roboto Mono
|
||||
|
||||
### 5. Equity research
|
||||
*Use for: single-stock / equity investment analysis, sell-side research, valuation reports*
|
||||
*Tone: high-end research, calm, data-oriented, elite, Density: high*
|
||||
- **colors** — primary `#348271` peacock green, secondary `#0D1B2A` deep navy, accent `#2FA98D` (derived) bright teal-green, background `#F6F8FA` cool white, text_main `#0D1B2A`, text_sub `#6B7A8A` blue-gray
|
||||
- **layout** (`layout_system`) — high density · equity-research brochure layout system: large titles balanced with data charts, ample whitespace and refined columns; a core rhythm around metrics / trends / valuation / judgment; a professional review feel
|
||||
- **fonts** (`font_family`) — CJK 思源宋体, 思源黑体; Latin Playfair Display, Inter; number Roboto Mono
|
||||
|
||||
### 6. Course design / lesson plan
|
||||
*Use for: course design, course reports, lesson plans*
|
||||
*Tone: clear, focused, learner-centered, structured, modern-teaching, Density: medium*
|
||||
- **colors** — primary `#3B82F6` soft blue, secondary `#10B981` soft green, accent `#10B981` soft green, background `#FAFAFA` cool white, text_main `#1E293B`, text_sub `#64748B` slate gray
|
||||
- **layout** (`layout_system`) — medium density · instructional-design-handbook layout system: large titles, clear zoning, regular grids, componentized explanations; organized around "objective → structure → activity → feedback"; emphasize actionability and low cognitive load
|
||||
- **fonts** (`font_family`) — CJK 思源黑体, 霞鹜 975 圆体; Latin Inter, Nunito Sans; number Roboto Mono
|
||||
|
||||
### 7. Teaching slides
|
||||
*Use for: teaching slides, grade-level courseware*
|
||||
*Tone: fresh, friendly, academic-approachable, youthful, global, Density: low–medium*
|
||||
- **colors** — primary `#8FE3F9` sky blue, secondary `#CDEFD9` mint green, accent `#FFE7A3` cream yellow, background `#FAF7F2` warm white, text_main `#2F2F2F` charcoal, text_sub `#6B7280` warm gray
|
||||
- **layout** (`layout_system`) — low–medium density · modular-classroom-courseware layout system: large titles, light-color knowledge cards, rounded containers, and clear numbering throughout; section / course-overview / content / comparison / flow / summary pages form a complete teaching rhythm; ample whitespace, emphasizing readability, approachability, and a classroom-guidance feel
|
||||
- **fonts** (`font_family`) — CJK 思源黑体, 寒蝉全圆体; Latin Poppins, Quicksand; number Nunito Sans
|
||||
|
||||
## How to apply
|
||||
|
||||
Copy the matched row into the plan. Example using preset 1:
|
||||
|
||||
```json
|
||||
{
|
||||
"theme_style": "minimal, professional, data-driven, authoritative-restrained",
|
||||
"visual_system": {
|
||||
"color_roles": {
|
||||
"primary": "#415A77", "secondary": "#0D1B2A", "accent": "#2E6FB0",
|
||||
"background": "#F3F4F6", "text_main": "#0D1B2A", "text_sub": "#6B7788"
|
||||
},
|
||||
"background_strategy": "content pages on #F3F4F6; cover/divider on #0D1B2A dark block reusing the steel-blue motif",
|
||||
"motif": "low-saturation blocks + section tags + thin dividers + page-number system",
|
||||
"layout_system": "high density · consulting-report layout system: 12-column grid, thin dividers, data tables and chart pages; fixed header / page-number / section-number / annotation zones; rational, clear, review-ready rhythm"
|
||||
},
|
||||
"typography_constraints": {
|
||||
"font_family": "CJK 思源黑体, 思源宋体; Latin Inter, IBM Plex Sans; number Roboto Mono"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Presets are starting points, not mandates. If the user gives brand colors, use those and skip the preset.
|
||||
- Accents marked `(derived)` were synthesized per the accent-gap rule; if the user later supplies a real emphasis color, replace it.
|
||||
@@ -4,6 +4,16 @@
|
||||
|
||||
默认画布按 `960 x 540` 规划。模板 XML 可以覆盖具体坐标,但不能覆盖这些原则:页面要有主视觉区域、文本要受密度约束、不同 `layout_type` 必须产生明显不同的坐标结构。
|
||||
|
||||
## Style System
|
||||
|
||||
- Style comes from `slide_plan.json`'s `visual_system` + `typography_constraints`. When the user hasn't specified concrete colors (hex, a brand palette, or "use color X"), pick a matching preset from [`style-presets.md`](style-presets.md) when the deck genuinely fits one of its document types; if none fits, self-configure a coherent palette rather than forcing the nearest preset (and don't fall back to a topic's or industry's stereotypical color, which is an unreliable basis). Resolve any palette into the six color roles and use only those on the page.
|
||||
- color_roles: `primary` (dominant, ~60-70% weight — motif / header / title line), `secondary` (grouping, chart base), `accent` (key numbers / conclusions only, never confusable with `secondary`; if the palette has no saturated emphasis color, derive one from `primary`), `background` (content-page base), `text_main` (body & titles), `text_sub` (captions / footer / notes).
|
||||
- `visual_system.layout_system` sets the deck's layout character: its density (低/中/高) informs the default `text_density`, and its layout-system phrase (e.g. 咨询报告式 12 栏网格 / 数据分析型左叙事右图表 / 亲和型大字号宽留白) guides the page structure, grid, column split, and whitespace. Content pages should generally follow it in their geometry rather than defaulting to a plain title+bullets layout; covers, dividers, and closings may deviate when the page role calls for it.
|
||||
- `typography_constraints.font_family` lists fonts by role — a CJK set, a Latin set, and a number-emphasis face (each set is primary + fallback). `fontFamily` holds exactly one font (it is not a comma list). Assign the font by what the text is, and set it on the text you generate rather than relying on the default face — this holds on create, `+replace-slide`, and `+replace-pages` alike:
|
||||
- CJK-dominant text (titles, body, captions) → set the shape's `fontFamily` to the CJK face.
|
||||
- number-forward elements (big numbers, KPI / metric values, key data callouts) → set that shape's `fontFamily` to the number-emphasis face.
|
||||
- a focal number or Latin term inside a CJK sentence → wrap just that run in `<span fontFamily="…">` with the number/Latin face; leave incidental digits in the CJK face.
|
||||
|
||||
## Core Rules
|
||||
|
||||
- `layout_type` must change geometry: element positions, region sizes, alignment, and visual rhythm must differ across page types.
|
||||
@@ -134,6 +144,7 @@ Geometry:
|
||||
- Set `autoFit="normal-auto-fit"` on the metric's `<content>` so an oversized number shrinks to fit its box instead of overflowing.
|
||||
- Pair the number with one explanation and optional 2-3 small supporting labels.
|
||||
- Do not bury the number in a bullet list or small card.
|
||||
- Color: the large number uses `accent` (highest contrast on the page, never `secondary`); explanatory text uses `text_sub`. If accent is missing, use a darker variant of `primary`.
|
||||
|
||||
Text:
|
||||
- `low` or `medium`. If detail is needed, add small annotations around the metric.
|
||||
@@ -244,6 +255,9 @@ Before creating XML for each page, answer these checks:
|
||||
6. Does the background follow the planned deck strategy, and are any deviations intentional?
|
||||
7. Are all text boxes large enough for their intended font size and line count?
|
||||
8. If the page uses a screenshot or paper figure, is it large enough to read and accompanied by concise interpretation?
|
||||
9. Does the page use only the six `visual_system.color_roles`, with no ad-hoc colors?
|
||||
10. Is `accent` used only for key numbers / conclusions, never as a large fill?
|
||||
11. Is the motif consistent deck-wide?
|
||||
|
||||
After fetching the created presentation, verify:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user