docs(reference): cover bare dice and tilde fences
Add the bare d-form (d20) to the dice notation table, and note that role fences accept backticks or tildes with hyphen-capable attribute keys. Regenerate both reference copies from known.ts and mirror the notes in the skill and markdown docs.
This commit is contained in:
@@ -54,7 +54,9 @@ in `reference.md`.
|
|||||||
|
|
||||||
## Code block roles
|
## Code block roles
|
||||||
|
|
||||||
Fenced blocks are dispatched by the `role=` attribute in the info string:
|
Fenced blocks are dispatched by the `role=` attribute in the info string. Both
|
||||||
|
backtick and tilde (`~~~`) fences work; the closing fence must reuse the opening
|
||||||
|
marker, and fence attribute keys may contain hyphens (e.g. `data-foo=bar`):
|
||||||
|
|
||||||
| Info string | Behavior |
|
| Info string | Behavior |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ Renders a clickable span that dispatches a journal command.
|
|||||||
The `role=` attribute on the info string determines how a fenced block is
|
The `role=` attribute on the info string determines how a fenced block is
|
||||||
handled.
|
handled.
|
||||||
|
|
||||||
|
Fences may use backticks or tildes (`~~~`); the closing fence must reuse
|
||||||
|
the opening marker. Fence attribute keys may contain hyphens (e.g.
|
||||||
|
`data-foo=bar`).
|
||||||
|
|
||||||
### `role=spark-table`
|
### `role=spark-table`
|
||||||
|
|
||||||
CSV (or markdown pipe table) rendered as `:md-table`.
|
CSV (or markdown pipe table) rendered as `:md-table`.
|
||||||
@@ -339,6 +343,7 @@ Used by `:md-dice`, spark-table headers, and the journal `/roll`:
|
|||||||
|---|---|
|
|---|---|
|
||||||
| `2d6` | two six-sided dice |
|
| `2d6` | two six-sided dice |
|
||||||
| `1d20+5` | d20 plus modifier |
|
| `1d20+5` | d20 plus modifier |
|
||||||
|
| `d20` | one twenty-sided die (count optional) |
|
||||||
| `3d6kh1` | keep highest 1 |
|
| `3d6kh1` | keep highest 1 |
|
||||||
| `3d6dl2-1` | drop lowest 2, minus 1 |
|
| `3d6dl2-1` | drop lowest 2, minus 1 |
|
||||||
| `{d4, d8}` | choose one of the listed dice |
|
| `{d4, d8}` | choose one of the listed dice |
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
`` ```yaml role=tag `` renders a custom element from YAML. `tag` names the
|
`` ```yaml role=tag `` renders a custom element from YAML. `tag` names the
|
||||||
element, `body` becomes its content, and any other key becomes an attribute.
|
element, `body` becomes its content, and any other key becomes an attribute.
|
||||||
Fence-line attributes override the YAML body. See `reference.md` for the
|
Fence-line attributes override the YAML body; both backtick and tilde (`~~~`)
|
||||||
element and role catalog.
|
fences work. See `reference.md` for the element and role catalog.
|
||||||
|
|
||||||
````markdown
|
````markdown
|
||||||
```yaml role=tag
|
```yaml role=tag
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
- [marked-gfm-heading-id](https://github.com/markedjs/marked-gfm-heading-id) - 标题 ID
|
- [marked-gfm-heading-id](https://github.com/markedjs/marked-gfm-heading-id) - 标题 ID
|
||||||
- [marked-directive](https://github.com/fengzilong/marked-directive) - 指令语法
|
- [marked-directive](https://github.com/fengzilong/marked-directive) - 指令语法
|
||||||
|
|
||||||
|
### 代码块围栏
|
||||||
|
|
||||||
|
代码块围栏可使用反引号或波浪号(`~~~`)书写;闭合围栏必须与开启围栏使用相同字符,且不短于开启围栏。声明 `role=` 的代码块同理。
|
||||||
|
|
||||||
## 指令语法
|
## 指令语法
|
||||||
|
|
||||||
通过 `marked-directive` 支持自定义组件插入:
|
通过 `marked-directive` 支持自定义组件插入:
|
||||||
@@ -123,6 +127,7 @@
|
|||||||
- 点击文本执行掷骰
|
- 点击文本执行掷骰
|
||||||
- 点击骰子图标重置为公式
|
- 点击骰子图标重置为公式
|
||||||
- `key` 属性将结果记录到 URL 参数中 (`?dice-attack=15`)
|
- `key` 属性将结果记录到 URL 参数中 (`?dice-attack=15`)
|
||||||
|
- 骰子数量可省略,`d20` 等价于 `1d20`
|
||||||
|
|
||||||
**属性:**
|
**属性:**
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ Renders a clickable span that dispatches a journal command.
|
|||||||
The `role=` attribute on the info string determines how a fenced block is
|
The `role=` attribute on the info string determines how a fenced block is
|
||||||
handled.
|
handled.
|
||||||
|
|
||||||
|
Fences may use backticks or tildes (`~~~`); the closing fence must reuse
|
||||||
|
the opening marker. Fence attribute keys may contain hyphens (e.g.
|
||||||
|
`data-foo=bar`).
|
||||||
|
|
||||||
### `role=spark-table`
|
### `role=spark-table`
|
||||||
|
|
||||||
CSV (or markdown pipe table) rendered as `:md-table`.
|
CSV (or markdown pipe table) rendered as `:md-table`.
|
||||||
@@ -339,6 +343,7 @@ Used by `:md-dice`, spark-table headers, and the journal `/roll`:
|
|||||||
|---|---|
|
|---|---|
|
||||||
| `2d6` | two six-sided dice |
|
| `2d6` | two six-sided dice |
|
||||||
| `1d20+5` | d20 plus modifier |
|
| `1d20+5` | d20 plus modifier |
|
||||||
|
| `d20` | one twenty-sided die (count optional) |
|
||||||
| `3d6kh1` | keep highest 1 |
|
| `3d6kh1` | keep highest 1 |
|
||||||
| `3d6dl2-1` | drop lowest 2, minus 1 |
|
| `3d6dl2-1` | drop lowest 2, minus 1 |
|
||||||
| `{d4, d8}` | choose one of the listed dice |
|
| `{d4, d8}` | choose one of the listed dice |
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ export interface DiceNotation {
|
|||||||
export const DICE_NOTATION: readonly DiceNotation[] = [
|
export const DICE_NOTATION: readonly DiceNotation[] = [
|
||||||
{ notation: "2d6", meaning: "two six-sided dice" },
|
{ notation: "2d6", meaning: "two six-sided dice" },
|
||||||
{ notation: "1d20+5", meaning: "d20 plus modifier" },
|
{ notation: "1d20+5", meaning: "d20 plus modifier" },
|
||||||
|
{ notation: "d20", meaning: "one twenty-sided die (count optional)" },
|
||||||
{ notation: "3d6kh1", meaning: "keep highest 1" },
|
{ notation: "3d6kh1", meaning: "keep highest 1" },
|
||||||
{ notation: "3d6dl2-1", meaning: "drop lowest 2, minus 1" },
|
{ notation: "3d6dl2-1", meaning: "drop lowest 2, minus 1" },
|
||||||
{ notation: "{d4, d8}", meaning: "choose one of the listed dice" },
|
{ notation: "{d4, d8}", meaning: "choose one of the listed dice" },
|
||||||
|
|||||||
@@ -151,6 +151,14 @@ export function renderReference(): string {
|
|||||||
);
|
);
|
||||||
lines.push("handled.");
|
lines.push("handled.");
|
||||||
lines.push("");
|
lines.push("");
|
||||||
|
lines.push(
|
||||||
|
"Fences may use backticks or tildes (`~~~`); the closing fence must reuse",
|
||||||
|
);
|
||||||
|
lines.push(
|
||||||
|
"the opening marker. Fence attribute keys may contain hyphens (e.g.",
|
||||||
|
);
|
||||||
|
lines.push("`data-foo=bar`).");
|
||||||
|
lines.push("");
|
||||||
for (const role of ROLE_SPECS) {
|
for (const role of ROLE_SPECS) {
|
||||||
lines.push(`### \`role=${role.role}\``);
|
lines.push(`### \`role=${role.role}\``);
|
||||||
lines.push("");
|
lines.push("");
|
||||||
|
|||||||
Reference in New Issue
Block a user