feat: layer docs

This commit is contained in:
hypercross 2026-03-18 13:48:19 +08:00
parent 301f499494
commit 1d2b4b3e1e
3 changed files with 58 additions and 4 deletions

View File

@ -144,12 +144,12 @@ async function mcpServeAction(host: string, options: MCPOptions) {
description: 'Deck 配置',
properties: {
size: { type: 'string', description: '卡牌尺寸,格式 "宽 x 高"' },
grid: { type: 'string', description: '网格布局,格式 "列 x 行"' },
grid: { type: 'string', description: '网格布局,格式 "列 x 行"表示卡牌排版区域分成多少行多少列用于显示字段。默认使用5x8。' },
bleed: { type: 'number', description: '出血边距mm' },
padding: { type: 'number', description: '内边距mm' },
shape: { type: 'string', enum: ['rectangle', 'circle', 'hex', 'diamond'] },
layers: { type: 'string', description: '正面图层配置' },
back_layers: { type: 'string', description: '背面图层配置' },
layers: { type: 'string', description: '字段的显示图层配置。如`title:1,1-5,1f8n body:1,3-5,8f3n`表示将title字段的内容显示在第1列1行到第5列1行的区域8mm字体上侧朝向北body覆盖1列3行到5列行3mm字体上侧朝向北。通常希望重要的辨识字段放在左侧如`rank:1,1-1,1f6 suit:1,2-1,2f6`。' },
back_layers: { type: 'string', description: '背面显示图层配置,与正面类似' },
},
},
},
@ -183,7 +183,7 @@ async function mcpServeAction(host: string, options: MCPOptions) {
description: '卡牌数据(单张或数组)',
items: {
type: 'object',
additionalProperties: { type: 'string' },
additionalProperties: { type: 'string', description: "字段内容可以使用markdown语法。使用:[attack]来表示名为attack的图标。使用{{prop}}来引用另一个字段或者frontmatter里的内容。" },
},
},
label: {

View File

@ -29,6 +29,32 @@ export interface DeckFrontmatter {
[key: string]: unknown;
}
/**
*
*
* x,y,w,h
* 5x8 1,1,5,8
*
* 使 f:8 8mm
*
* 使 u:n/w/s/e 西
*/
export interface CardFieldStyle {
/**
* [x, y, w, h]
* [1, 1, 5, 8] (1,1) 5 8
*/
pos?: [number, number, number, number];
/**
* "f:8" 8mm
*/
font?: string;
/**
* "n" | "w" | "s" | "e"/西//
*/
up?: 'n' | 'w' | 's' | 'e';
}
/**
*
*/
@ -36,6 +62,7 @@ export interface CardField {
name: string;
description?: string;
examples?: string[];
style?: CardFieldStyle;
[key: string]: unknown;
}

View File

@ -1,6 +1,32 @@
import { writeFileSync, mkdirSync, existsSync } from 'fs';
import { join } from 'path';
/**
*
*
* x,y,w,h
* 5x8 1,1,5,8
*
* 使 f:8 8mm
*
* 使 u:n/w/s/e 西
*/
export interface CardFieldStyle {
/**
* [x, y, w, h]
* [1, 1, 5, 8] (1,1) 5 8
*/
pos?: [number, number, number, number];
/**
* "f:8" 8mm
*/
font?: string;
/**
* "n" | "w" | "s" | "e"/西//
*/
up?: 'n' | 'w' | 's' | 'e';
}
/**
*
*/
@ -8,6 +34,7 @@ export interface CardField {
name: string;
description?: string;
examples?: string[];
style?: CardFieldStyle;
}
/**