@liustack/pagepress 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A web content rendering toolkit (CLI) designed for **AI Agents**, converting HTML, Markdown, and URLs into high-quality **PDF** or **PNG** images.
4
4
 
5
+ 中文说明请见:[README.zh-CN.md](README.zh-CN.md)
6
+
5
7
  ## ✨ Features
6
8
 
7
9
  - **Unified CLI**: One tool (`pagepress`) for both PDF and image generation
@@ -10,6 +12,7 @@ A web content rendering toolkit (CLI) designed for **AI Agents**, converting HTM
10
12
  - **Rich templates**:
11
13
  - **PDF**: Apple style, GitHub style, magazine layout (Magazine)
12
14
  - **Image**: OG cards, infographics, posters, banners
15
+ - **Brand-aware visuals**: OG / poster / banner outputs are generated based on workspace visual & brand assets (commonly in `assets/`, `public/`, `src/assets/`)
13
16
  - **Consistency guarantees**: Deterministic rendering, font waiting, network idle detection, syntax highlighting
14
17
 
15
18
  ## 📦 Installation
@@ -54,6 +57,21 @@ pagepress pdf -i https://example.com -o webpage.pdf
54
57
 
55
58
  Render HTML/URLs into PNG images, suitable for social share cards, posters, and long screenshots.
56
59
 
60
+ For OG cards, posters, and banners, the visuals should be generated based on workspace brand assets (logo, colors, fonts, imagery), commonly located in `assets/`, `public/`, or `src/assets/`.
61
+
62
+ **Recommended brand assets layout**:
63
+
64
+ ```text
65
+ assets/
66
+ brand/
67
+ logo.svg
68
+ palette.json
69
+ fonts/
70
+ YourBrand-Regular.woff2
71
+ imagery/
72
+ hero.jpg
73
+ ```
74
+
57
75
  ```bash
58
76
  # Generate an OG card (1200x630)
59
77
  pagepress shot -i card.html -o og.png --preset og
@@ -71,6 +89,18 @@ pagepress shot -i https://example.com -o screenshot.png
71
89
  - `poster` (1200x1500) - Poster
72
90
  - `banner` (1600x900) - Banner
73
91
 
92
+ ## 🖼️ Examples
93
+
94
+ ### Image Presets
95
+
96
+ | OG Card (1200×630) | Infographic (1080×1350) |
97
+ |:---:|:---:|
98
+ | ![OG Card](examples/shot-og.png) | ![Infographic](examples/shot-infographic.png) |
99
+
100
+ | Poster (1200×1500) | Banner (1600×900) |
101
+ |:---:|:---:|
102
+ | ![Poster](examples/shot-poster.png) | ![Banner](examples/shot-banner.png) |
103
+
74
104
  ## 🤖 AI Agent Integration
75
105
 
76
106
  This project includes a detailed [SKILL.md](skills/pagepress/SKILL.md) to help AI Agents (such as Claude, ChatGPT) understand how to use this tool.
package/README.zh-CN.md CHANGED
@@ -10,6 +10,7 @@
10
10
  - **丰富模板**:
11
11
  - **PDF**: Apple 风格、GitHub 风格、杂志排版 (Magazine)
12
12
  - **Image**: OG 卡片、信息图、海报、横幅
13
+ - **品牌一致性**:OG/海报/横幅会基于工作区的视觉与品牌资源生成(常见于 `assets/`、`public/`、`src/assets/`)
13
14
  - **一致性保障**:确定性渲染、字体等待、网络空闲检测、代码高亮
14
15
 
15
16
  ## 📦 安装
@@ -54,6 +55,21 @@ pagepress pdf -i https://example.com -o webpage.pdf
54
55
 
55
56
  将 HTML/URL 渲染为 PNG 图像,适合社交分享卡片、海报、长图截屏。
56
57
 
58
+ 对于 OG 卡片、海报、横幅,视觉应基于工作区的品牌资源(logo、颜色、字体、素材)生成,常见目录包括 `assets/`、`public/`、`src/assets/`。
59
+
60
+ **品牌资源目录建议**:
61
+
62
+ ```text
63
+ assets/
64
+ brand/
65
+ logo.svg
66
+ palette.json
67
+ fonts/
68
+ YourBrand-Regular.woff2
69
+ imagery/
70
+ hero.jpg
71
+ ```
72
+
57
73
  ```bash
58
74
  # 生成 OG 卡片(1200×630)
59
75
  pagepress shot -i card.html -o og.png --preset og
@@ -71,6 +87,18 @@ pagepress shot -i https://example.com -o screenshot.png
71
87
  - `poster` (1200×1500) - 海报
72
88
  - `banner` (1600×900) - 横幅
73
89
 
90
+ ## 🖼️ 示例
91
+
92
+ ### 图像预设
93
+
94
+ | OG 卡片 (1200×630) | 信息图 (1080×1350) |
95
+ |:---:|:---:|
96
+ | ![OG 卡片](examples/shot-og.png) | ![信息图](examples/shot-infographic.png) |
97
+
98
+ | 海报 (1200×1500) | 横幅 (1600×900) |
99
+ |:---:|:---:|
100
+ | ![海报](examples/shot-poster.png) | ![横幅](examples/shot-banner.png) |
101
+
74
102
  ## 🤖 AI Agent 集成
75
103
 
76
104
  本项目包含详细的 [SKILL.md](skills/pagepress/SKILL.md),旨在帮助 AI Agent(如 Claude, ChatGPT)理解如何使用此工具。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liustack/pagepress",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "CLI tool to convert web pages and Markdown to PDF and images",
5
5
  "type": "module",
6
6
  "bin": {
@@ -48,16 +48,16 @@
48
48
  "commander": "^13.1.0",
49
49
  "gray-matter": "^4.0.3",
50
50
  "highlight.js": "^11.11.1",
51
- "marked": "^15.0.6",
51
+ "marked": "^15.0.12",
52
52
  "marked-highlight": "^2.2.3",
53
53
  "mermaid": "^11.12.2",
54
- "playwright": "^1.50.1"
54
+ "playwright": "^1.58.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@types/node": "^22.13.1",
58
- "typescript": "^5.7.3",
59
- "vite": "^6.1.0",
60
- "vite-plugin-node": "^5.0.0"
57
+ "@types/node": "^22.19.7",
58
+ "typescript": "^5.9.3",
59
+ "vite": "^6.4.1",
60
+ "vite-plugin-node": "^5.0.1"
61
61
  },
62
62
  "scripts": {
63
63
  "dev": "vite build --watch",