metrics

12 cases. Source: tests/metrics.json.

#1 canonical

Source

:::metrics
| Metric  | Value | Δ     |
|---------|-------|-------|
| Revenue | $4.2M | +12%  |
| Churn   | 2.1%  | -0.4% |
:::

Rendered

Revenue
$4.2M
+12%
Churn
2.1%
-0.4%

Downgrade

| Metric  | Value | Δ     |
| ------- | ----- | ----- |
| Revenue | $4.2M | +12%  |
| Churn   | 2.1%  | -0.4% |

#2 inverse direction

Source

:::metrics{direction=inverse}
| a | b |
|---|---|
| 1 | 2 |
:::

Rendered

1
2

Downgrade

| a | b |
| - | - |
| 1 | 2 |

#3 two columns without a delta

Source

:::metrics
| a | b |
|---|---|
| 1 | 2 |
:::

Rendered

1
2

Downgrade

| a | b |
| - | - |
| 1 | 2 |

#4 alignment is kept

Source

:::metrics
| a | b |
|:--|--:|
| 1 | 2 |
:::

Rendered

1
2

Downgrade

| a  |  b |
| :- | -: |
| 1  |  2 |

#5 nested inside a card

Source

::::card
:::metrics
| a | b |
|---|---|
| 1 | 2 |
:::
::::

Rendered

1
2

Downgrade

| a | b |
| - | - |
| 1 | 2 |

#6 id and classes

Source

:::metrics{#kpis .wide}
| a | b |
|---|---|
:::

Rendered

Downgrade

| a | b |
| - | - |

#7 unclosed fence

Source

:::metrics
| a | b |
|---|---|
| 1 | 2 |

Rendered

1
2

Downgrade

| a | b |
| - | - |
| 1 | 2 |

Diagnostics: DIRECTIVE_UNCLOSED

#8 empty content

invalid

Source

:::metrics
:::

Rendered

Downgrade

(empty)

Diagnostics: METRICS_CONTENT

#9 wrong content type: list

invalid

Source

:::metrics
- a
:::

Rendered

  • a

Downgrade

- a

Diagnostics: METRICS_CONTENT

#10 wrong content type: one-column table

invalid

Source

:::metrics
| a |
|---|
| 1 |
:::

Rendered

a
1

Downgrade

| a |
| - |
| 1 |

Diagnostics: METRICS_CONTENT

#11 wrong content type: table plus paragraph

invalid

Source

:::metrics
| a | b |
|---|---|

note
:::

Rendered

a b

note

Downgrade

| a | b |
| - | - |

note

Diagnostics: METRICS_CONTENT

#12 invalid direction

invalid

Source

:::metrics{direction=up}
| a | b |
|---|---|
:::

Rendered

Downgrade

| a | b |
| - | - |

Diagnostics: DIRECTIVE_INVALID_ATTRIBUTE