Skip to content

Commit 9456e32

Browse files
committed
Publish separate Chinese and English recipes and fix CI checks
1 parent 40abd6a commit 9456e32

722 files changed

Lines changed: 29112 additions & 7941 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/docs.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ jobs:
6262
if [ "$EVENT_NAME" = "pull_request" ]; then
6363
files=$(git diff --name-only --diff-filter=AM "$BASE_SHA" "$HEAD_SHA" -- '*.md')
6464
elif [ "$EVENT_NAME" = "push" ] && [ -n "${BEFORE_SHA:-}" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
65-
files=$(git diff --name-only --diff-filter=AM "$BEFORE_SHA" "$AFTER_SHA" -- '*.md')
65+
if git cat-file -e "$BEFORE_SHA^{commit}" 2>/dev/null; then
66+
files=$(git diff --name-only --diff-filter=AM "$BEFORE_SHA" "$AFTER_SHA" -- '*.md')
67+
else
68+
# A history rewrite can leave the old push SHA unreachable.
69+
# Validate tracked Markdown rather than failing on a missing ref.
70+
files=$(git ls-files '*.md')
71+
fi
6672
else
6773
files=""
6874
fi

‎.github/workflows/plugin-scanner.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ jobs:
2222
plugin_dir: "."
2323
min_score: 80
2424
fail_on_severity: high
25+
format: json
26+
output: plugin-security-report.json
27+
28+
- name: Preserve security findings even when the scan fails
29+
if: always()
30+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
31+
with:
32+
name: plugin-security-report
33+
path: plugin-security-report.json
34+
if-no-files-found: warn

‎README.en.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ The reel uses actual library animations and demonstration data, with Chinese nar
3838

3939
The GIFs below play automatically. Click a GIF for the high-resolution preview, or open the recipe for implementation details and source locations.
4040

41+
Recipes have separate Chinese and English documents. The gallery displays the document in your selected language; [English recipes](cards/recipes/en/) are also available directly.
42+
4143
| Character host and data board | Presenter-to-chart handoff | Countdown ranking |
4244
|---|---|---|
4345
| [![Character perspective board](cards/gallery/media/readme/CharacterPerspectiveBoard.gif)](https://datamagic.chat/cards/#CharacterPerspectiveBoard) | [![Presenter data takeover](cards/gallery/media/readme/PresenterDataTakeover.gif)](https://datamagic.chat/cards/#PresenterDataTakeover) | [![Countdown ranking](cards/gallery/media/readme/RankedReveal.gif)](https://datamagic.chat/cards/#RankedReveal) |
44-
| Explain with a character, perspective board, and staged evidence. [Recipe](cards/recipes/CharacterPerspectiveBoard.md) | Shift attention between the presenter and the data. [Recipe](cards/recipes/PresenterDataTakeover.md) | Build suspense and comparison through sequential reveals. [Recipe](cards/recipes/RankedReveal.md) |
46+
| Explain with a character, perspective board, and staged evidence. [Recipe](cards/recipes/en/CharacterPerspectiveBoard.md) | Shift attention between the presenter and the data. [Recipe](cards/recipes/en/PresenterDataTakeover.md) | Build suspense and comparison through sequential reveals. [Recipe](cards/recipes/en/RankedReveal.md) |
4547

4648
| Footage to evidence | Travel through a trend | Maps and regional comparison |
4749
|---|---|---|
4850
| [![Footage to evidence](cards/gallery/media/readme/FootageEvidenceReveal.gif)](https://datamagic.chat/cards/#FootageEvidenceReveal) | [![Timeline camera](cards/gallery/media/readme/ChartTimelineTravel.gif)](https://datamagic.chat/cards/#ChartTimelineTravel) | [![Regional map and ranking](cards/gallery/media/readme/ChoroplethRankMap.gif)](https://datamagic.chat/cards/#ChoroplethRankMap) |
49-
| Establish the scene, then introduce its key metrics. [Recipe](cards/recipes/FootageEvidenceReveal.md) | Move along a timeline and pause at important changes. [Recipe](cards/recipes/ChartTimelineTravel.md) | Explain differences through geography and rankings. [Recipe](cards/recipes/ChoroplethRankMap.md) |
51+
| Establish the scene, then introduce its key metrics. [Recipe](cards/recipes/en/FootageEvidenceReveal.md) | Move along a timeline and pause at important changes. [Recipe](cards/recipes/en/ChartTimelineTravel.md) | Explain differences through geography and rankings. [Recipe](cards/recipes/en/ChoroplethRankMap.md) |
5052

51-
The library also covers bars, lines, shares, scatterplots, flows, openings, conclusions, and transitions, plus a [9:16 portrait ranking](cards/recipes/PortraitRankedReveal.md) for mobile content. Adapt the data, copy, colors, media, and timing, and keep the editable source.
53+
The library also covers bars, lines, shares, scatterplots, flows, openings, conclusions, and transitions, plus a [9:16 portrait ranking](cards/recipes/en/PortraitRankedReveal.md) for mobile content. Adapt the data, copy, colors, media, and timing, and keep the editable source.
5254

5355
**[Explore all recipes →](https://datamagic.chat/cards/)**
5456

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ https://github.com/user-attachments/assets/6e9b939a-60e8-4e03-ae8a-b60fb23cf9c7
3838

3939
下方 GIF 自动展示动画效果;点击动图观看高清预览,点击配方查看实现说明与源码位置。
4040

41+
完整配方默认中文,另提供独立英文版;网站切换语言后会显示对应文档。
42+
4143
| 角色主持与数据板 | 主持人让位,图表接管 | 倒序揭晓排行榜 |
4244
|---|---|---|
4345
| [![角色主持与透视数据板](cards/gallery/media/readme/CharacterPerspectiveBoard.gif)](https://datamagic.chat/cards/#CharacterPerspectiveBoard) | [![主持人与数据交接](cards/gallery/media/readme/PresenterDataTakeover.gif)](https://datamagic.chat/cards/#PresenterDataTakeover) | [![倒序揭晓排行榜](cards/gallery/media/readme/RankedReveal.gif)](https://datamagic.chat/cards/#RankedReveal) |

‎cards/examples/agent-workflow-demo/copied-implementation.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
请使用 datamagic Skill,按照“动态柱状图竞赛”(BarChartRace)配方制作视频。
2+
仓库:https://github.com/HKUSTDial/DataMagic 。尚未配置时,请先帮我下载仓库并配置其中的 datamagic Skill;已有则直接使用。
23
用途:面向多实体时序排名的连续竞赛图,支持数值插值、动态换位、进入退出和稳定实体配色。
34
先读取配方:cards/recipes/BarChartRace.md,再按其中的引用读取源码、数据格式和示例数据。路径相对于 DataMagic 仓库。
45
用我提供的数据和修改要求替换示例内容。没有数据时先确认,或明确约定使用标注清楚的演示数据。

‎cards/gallery/app.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {collectionDefinitions, categoryGroups} from './discovery.js';
22
import {createCardSearchIndex, matchesCardSearch} from './search.js?v=zh-search-20261002';
3-
import {briefPreview} from './brief-preview.js?v=brief-preview-20261002';
4-
import {implementationBrief} from './implementation-brief.js?v=datamagic-20261002';
3+
import {briefPreview} from './brief-preview.js?v=recipe-languages-20261002';
4+
import {implementationBrief} from './implementation-brief.js?v=recipe-languages-20261002';
55
import {cardStatus, sortRecentCards} from './card-history.js?v=datamagic-20261002';
66
import {LIST_VIDEO_LIMIT, videoSource, posterSource, videoBytes, formatBytes, defaultDataSaver, releaseVideo} from './media-policy.js?v=entity-icons-20261002';
77

‎cards/gallery/brief-preview.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const escapeHtml = value => String(value).replace(/[&<>"']/g, char => ({'&':'&am
22
export function briefPreview(prompt, lang = 'zh') {
33
const zh = lang !== 'en';
44
return `<div class="brief-help"><p>${zh
5-
? '适用于 Codex、Claude Code、Cursor 等代码智能体。先在智能体中打开 DataMagic 仓库,再粘贴这份指令,并附上你的 CSV / JSON 数据和修改要求。'
6-
: 'Use with Codex, Claude Code, Cursor, or another coding agent. Open the DataMagic repository in your agent, paste this brief, and attach your CSV / JSON data and requested changes.'}</p></div>
5+
? '适用于 Codex、Claude Code、Cursor 等代码智能体。直接粘贴这份指令,并附上你的 CSV / JSON 数据和修改要求;尚未配置时,指令会引导智能体先准备 DataMagic 仓库和 Skill。'
6+
: 'Use with Codex, Claude Code, Cursor, or another coding agent. Paste this brief with your CSV / JSON data and requested changes; it includes repository and Skill setup guidance for first use.'}</p></div>
77
<details class="brief-preview"><summary>${zh ? '查看将复制的完整实现指令' : 'Preview the complete implementation brief'}</summary>
88
<textarea readonly spellcheck="false" aria-label="${zh ? '完整实现指令' : 'Complete implementation brief'}">${escapeHtml(prompt)}</textarea></details>`;
99
}

‎cards/gallery/implementation-brief.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const localized = (value, lang) => typeof value === 'string' ? value : value?.[lang] || value?.zh || value?.en || '';
22
export function implementationBrief(item, lang = 'zh') {
33
const name = localized(item.name, lang), purpose = localized(item.description, lang);
4-
const recipe = `cards/recipes/${item.slug}.md`;
4+
const recipe = `cards/recipes/${lang === 'en' ? 'en/' : ''}${item.slug}.md`;
55
if (lang === 'en') return [
66
`Use the datamagic Skill to create a video with ${name} (${item.slug}).`,
7+
'Repository: https://github.com/HKUSTDial/DataMagic. If not configured, help me obtain the repository and configure its datamagic Skill first; otherwise reuse the existing checkout.',
78
`Purpose: ${purpose}`,
89
`Read the recipe first: ${recipe}. Follow its source, schema, and sample-data references in the DataMagic repository.`,
910
'Adapt my supplied data and requested changes. If data is missing, ask for it or agree on explicitly labeled demonstration data.',
@@ -13,6 +14,7 @@ export function implementationBrief(item, lang = 'zh') {
1314
].join('\n');
1415
return [
1516
`请使用 datamagic Skill,按照“${name}”(${item.slug})配方制作视频。`,
17+
'仓库:https://github.com/HKUSTDial/DataMagic 。尚未配置时,请先帮我下载仓库并配置其中的 datamagic Skill;已有则直接使用。',
1618
`用途:${purpose}`,
1719
`先读取配方:${recipe},再按其中的引用读取源码、数据格式和示例数据。路径相对于 DataMagic 仓库。`,
1820
'用我提供的数据和修改要求替换示例内容。没有数据时先确认,或明确约定使用标注清楚的演示数据。',

‎cards/gallery/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ <h1 id="title">让代码智能体生成更可靠的动态图表</h1>
112112
</div>
113113
</dialog>
114114
<div class="toast" id="toast" role="status" aria-live="polite"></div>
115-
<script type="module" src="app.js?v=datamagic-20261002"></script>
115+
<script type="module" src="app.js?v=recipe-languages-20261002"></script>
116116
</body>
117117
</html>

‎cards/gallery/recipe.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
</header>
2525
<main id="recipeRoot"><p class="recipe-error">正在加载配方……</p></main>
2626
<div class="toast" id="toast" role="status" aria-live="polite"></div>
27-
<script type="module" src="recipe.js?v=datamagic-20261002"></script>
27+
<script type="module" src="recipe.js?v=recipe-languages-20261002"></script>
2828
</body>
2929
</html>

0 commit comments

Comments
 (0)