Generate two fixed poster variants from minimal JSON with Python: `daily` for "摸鱼日报" and `baidu_hot` for "百度热点/百度热搜", with SVG output and optional PNG/JPG/JPEG/WEBP export. Use when Codex needs to map user wording to the correct poster type, render either variant, infer image export requirements from Chinese prompts, or update the corresponding JSON examples and commands.
daily = 摸鱼日报baidu_hot = 百度热点 / 百度热搜dailybaidu_hot{
"poster_type": "daily",
"personal_info": {
"name": "智普虾🦐",
"bio_lines": [
"OpenClaw 驱动的 AI 助手,搭载GLM5 模型,机智温暖有点俏皮"
]
}
}
python scripts/render_poster.py --spec <spec.json> --output out/posterposter_type 只支持 daily 和 baidu_hotposter_type: "daily" 表示“摸鱼日报”版式poster_type: "baidu_hot" 表示“百度热点 / 百度热搜”版式personal_info.name 和最多 2 行 bio_lines当用户提到“生成图片”“导出 PNG”“发 JPG”“给我 WEBP”这类需求时,不要只停留在 SVG,要在 JSON 里补 output。
output.formats: ["png"]output.formats: ["svg", "png"]output.formats: ["jpg"],并补 qualityoutput.formats: ["webp"],并补 qualitypng / jpg / jpeg / webp 默认推荐 scale: 2jpg / jpeg / webp 默认推荐 quality: 92jpg / jpeg 这类不透明格式时,默认补 background: "#ffffff",除非用户明确要求别的底色output.formats,不要依赖 --output out/poster.png 这种后缀推断推荐模板:
{
"output": {
"formats": ["png"],
"scale": 2
}
}
常用输出示例:
{
"output": {
"formats": ["svg", "png"],
"scale": 2
}
}
{
"output": {
"formats": ["jpg"],
"scale": 2,
"quality": 92,
"background": "#ffffff"
}
}
# 摸鱼日报(daily)
python scripts/render_poster.py --type daily --spec references/daily-poster-spec.json --output out/daily_poster
# 百度热点 / 百度热搜(baidu_hot)
python scripts/render_poster.py --type baidu_hot --spec references/baidu-hot-spec.json --output out/baidu_hot_poster
daily 最小输入(摸鱼日报):
{
"poster_type": "daily",
"personal_info": {
"name": "智普虾🦐",
"bio_lines": [
"OpenClaw 驱动的 AI 助手,搭载 GLM5 模型,机智温暖有点俏皮"
]
}
}
baidu_hot 最小输入(百度热点 / 百度热搜):
{
"poster_type": "baidu_hot",
"personal_info": {
"name": "智普虾🦐",
"bio_lines": [
"OpenClaw 驱动的 AI 助手,搭载 GLM5 模型,机智温暖有点俏皮"
]
}
}
bio_lines / text_lines 最多保留前 2 行非空内容baidu_hot 的 title、subtitle、api_url、limit 全部内置,不接受外部 JSON 覆盖baidu_hot 顶部日期区同一行显示公历、星期、农历output.formats 转换为 PNG/JPG/JPEG/WEBPpng 理解最稳妥--output out/poster,程序会生成同名不同后缀文件scripts/render_poster.py: 统一入口scripts/render_daily_poster.py: 摸鱼日报渲染器scripts/render_baidu_hot.py: 百度热搜渲染器scripts/poster_runtime.py: 统一运行时和 stdout JSONreferences/daily-poster-spec.json: 摸鱼日报示例references/baidu-hot-spec.json: 百度热搜示例