@liustack/pagepress 0.1.0 → 0.3.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 +18 -0
- package/README.zh-CN.md +16 -0
- package/dist/main.js +0 -0
- package/package.json +23 -14
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
|
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
|
package/dist/main.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liustack/pagepress",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI tool to convert web pages and Markdown to PDF and images",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"pagepress": "./dist/main.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite build --watch",
|
|
11
|
+
"build": "vite build",
|
|
12
|
+
"typecheck": "tsc --noEmit",
|
|
13
|
+
"prepublishOnly": "pnpm build"
|
|
14
|
+
},
|
|
9
15
|
"files": [
|
|
10
16
|
"dist",
|
|
11
17
|
"src/pdf/templates"
|
|
12
18
|
],
|
|
13
19
|
"keywords": [
|
|
14
20
|
"pdf",
|
|
21
|
+
"png",
|
|
15
22
|
"screenshot",
|
|
23
|
+
"og-image",
|
|
24
|
+
"social-card",
|
|
25
|
+
"banner",
|
|
26
|
+
"poster",
|
|
27
|
+
"infographic",
|
|
28
|
+
"markdown-to-pdf",
|
|
16
29
|
"html-to-pdf",
|
|
17
30
|
"html-to-image",
|
|
18
|
-
"
|
|
31
|
+
"web-to-png",
|
|
32
|
+
"pdf-report",
|
|
19
33
|
"cli",
|
|
20
34
|
"playwright",
|
|
21
35
|
"mermaid"
|
|
@@ -40,20 +54,15 @@
|
|
|
40
54
|
"commander": "^13.1.0",
|
|
41
55
|
"gray-matter": "^4.0.3",
|
|
42
56
|
"highlight.js": "^11.11.1",
|
|
43
|
-
"marked": "^15.0.
|
|
57
|
+
"marked": "^15.0.12",
|
|
44
58
|
"marked-highlight": "^2.2.3",
|
|
45
59
|
"mermaid": "^11.12.2",
|
|
46
|
-
"playwright": "^1.
|
|
60
|
+
"playwright": "^1.58.1"
|
|
47
61
|
},
|
|
48
62
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^22.
|
|
50
|
-
"typescript": "^5.
|
|
51
|
-
"vite": "^6.1
|
|
52
|
-
"vite-plugin-node": "^5.0.
|
|
53
|
-
},
|
|
54
|
-
"scripts": {
|
|
55
|
-
"dev": "vite build --watch",
|
|
56
|
-
"build": "vite build",
|
|
57
|
-
"typecheck": "tsc --noEmit"
|
|
63
|
+
"@types/node": "^22.19.7",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"vite": "^6.4.1",
|
|
66
|
+
"vite-plugin-node": "^5.0.1"
|
|
58
67
|
}
|
|
59
|
-
}
|
|
68
|
+
}
|