Go to file
hypercross a02edabc41 fix: yarn spinner runner 2026-03-02 17:54:40 +08:00
.idea chore: todo clean up 2026-02-28 17:40:02 +08:00
content feat: yarn spinner parser 2026-03-02 16:18:10 +08:00
src fix: yarn spinner runner 2026-03-02 17:54:40 +08:00
.gitignore feat: ai's first take... 2026-02-26 00:17:23 +08:00
QWEN.md refactor: qwen 2026-03-01 11:38:19 +08:00
README.md refactor: readme 2026-02-26 16:38:40 +08:00
package-lock.json feat: gfm heading id 2026-03-02 13:43:10 +08:00
package.json feat: gfm heading id 2026-03-02 13:43:10 +08:00
rsbuild.config.ts fix: loading 2026-02-26 14:40:02 +08:00
todo.md feat: details 2026-03-01 09:49:01 +08:00
tsconfig.cli.json feat: ai's first take... 2026-02-26 00:17:23 +08:00
tsconfig.json feat: ai's first take... 2026-02-26 00:17:23 +08:00

README.md

TTRPG Tools

一个基于 solid.jsrsbuildttrpg 工具箱。

功能

  • CLI: 提供一个 cli 工具,用于将目录内的各种 ttrpg 文档编译为 html。
  • Markdown: 解析以各种格式编写的 ttrpg 内容,并支持扩展的语法。
  • TTRPG 组件: 用于 ttrpg 内容的各种 UI 组件,且可以在 markdown 中通过扩展语法插入。

CLI 命令

# 克隆仓库后npm link安装

# 在项目文件夹内运行
ttrpg serve [dir] -p 3000

组件语法

骰子组件

:dice[2d6+d8]
:dice[1d20+5]{key="attack"}

表格组件

:table[./sparks.csv]
:table[./sparks.csv]{roll=true}
:table[./sparks.csv]{roll=true remix=true}

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 预览
npm run preview

项目结构

ttrpg-tools/
├── src/
│   ├── cli/           # CLI 工具源码
│   ├── components/    # TTRPG 组件
│   ├── markdown/      # Markdown 解析器
│   ├── App.tsx        # 主应用组件
│   ├── main.tsx       # 入口文件
│   └── styles.css     # 样式文件
├── content/           # 示例内容
├── package.json
├── tsconfig.json
└── rsbuild.config.ts