Files
wpep/tools/gp/README.md
T
2026-04-18 23:20:31 +08:00

49 lines
1020 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GP 工农解放社刊物生成器
## 简介
工农解放社文章生成器用于根据MARKDOWN文件和TOML配置文件,自动化生成报纸,促进工农解放社从手工化到工业化的转变
## 技术栈
| 技术栈 | 作用 |
| --- | --- |
| deno | 提供运行时 |
| playwright无头浏览器| HTML转PDF |
| markdown-it | Markdown转化为HTML |
## Flake 使用(推荐)
本项目提供了 `flake.nix`,可在 NixOS 和非 NixOS(只要安装了 Nix 且启用 flakes)上获得一致的开发环境。
### 1. 进入开发环境
```bash
nix develop
```
进入后会自动设置:
- `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1`
- `CHROMIUM_PATH`(若能自动探测到 chromium/chrome)
### 2. 运行
```bash
deno run -A main.ts
deno test -A
```
### 3. 若 CHROMIUM_PATH 未自动设置
手动设置后再运行:
```bash
export CHROMIUM_PATH="$(command -v chromium)"
```
macOS 可使用:
```bash
export CHROMIUM_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
```