@treasure-ai/treasure-deck 0.0.0-stage → 2026.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +5 -0
- package/README.md +109 -2
- package/dist/analytics.d.ts +34 -0
- package/dist/analytics.js +93 -0
- package/dist/analytics.js.map +1 -0
- package/dist/attrs.d.ts +10 -0
- package/dist/attrs.js +22 -0
- package/dist/attrs.js.map +1 -0
- package/dist/build.d.ts +67 -0
- package/dist/build.js +247 -0
- package/dist/build.js.map +1 -0
- package/dist/check.d.ts +30 -0
- package/dist/check.js +142 -0
- package/dist/check.js.map +1 -0
- package/dist/chrome.d.ts +20 -0
- package/dist/chrome.js +162 -0
- package/dist/chrome.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +246 -0
- package/dist/cli.js.map +1 -0
- package/dist/dev.d.ts +28 -0
- package/dist/dev.js +557 -0
- package/dist/dev.js.map +1 -0
- package/dist/diagrams.d.ts +18 -0
- package/dist/diagrams.js +57 -0
- package/dist/diagrams.js.map +1 -0
- package/dist/highlight.d.ts +7 -0
- package/dist/highlight.js +26 -0
- package/dist/highlight.js.map +1 -0
- package/dist/hot.d.ts +31 -0
- package/dist/hot.js +34 -0
- package/dist/hot.js.map +1 -0
- package/dist/media.d.ts +24 -0
- package/dist/media.js +82 -0
- package/dist/media.js.map +1 -0
- package/dist/parse.d.ts +109 -0
- package/dist/parse.js +313 -0
- package/dist/parse.js.map +1 -0
- package/dist/patch.d.ts +22 -0
- package/dist/patch.js +53 -0
- package/dist/patch.js.map +1 -0
- package/dist/pdf.d.ts +10 -0
- package/dist/pdf.js +53 -0
- package/dist/pdf.js.map +1 -0
- package/dist/render.d.ts +101 -0
- package/dist/render.js +513 -0
- package/dist/render.js.map +1 -0
- package/dist/scaffold.d.ts +27 -0
- package/dist/scaffold.js +83 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/themecheck.d.ts +34 -0
- package/dist/themecheck.js +228 -0
- package/dist/themecheck.js.map +1 -0
- package/docs/adrs/2026-10-03-chrome-over-devtools.md +29 -0
- package/docs/adrs/2026-10-03-fixed-canvas.md +25 -0
- package/docs/adrs/2026-10-03-four-layouts-plus-attributes.md +25 -0
- package/docs/adrs/2026-10-03-hybrid-pdf-over-devtools.md +25 -0
- package/docs/adrs/2026-10-03-keyword-lines-and-one-attribute-syntax.md +36 -0
- package/docs/adrs/2026-10-03-one-behavior-instead-of-settings.md +30 -0
- package/docs/adrs/2026-10-03-overflow-is-reported-not-hidden.md +27 -0
- package/docs/adrs/2026-10-03-single-file-html.md +26 -0
- package/docs/adrs/2026-10-03-strict-build-forgiving-preview.md +31 -0
- package/docs/adrs/2026-10-04-edit-in-place-by-alignment.md +28 -0
- package/docs/adrs/2026-10-04-editor-in-the-deck-page.md +31 -0
- package/docs/adrs/2026-10-04-edits-are-line-range-patches.md +35 -0
- package/docs/adrs/2026-10-04-per-slide-hot-swap.md +33 -0
- package/docs/adrs/2026-10-04-theme-colors-derive-in-css.md +32 -0
- package/docs/adrs/2026-10-05-host-owns-undo.md +26 -0
- package/docs/adrs/2026-10-07-anonymous-access-metrics.md +38 -0
- package/docs/adrs/2026-10-14-dev-links-media-by-url.md +25 -0
- package/docs/adrs/2026-10-14-media-dir-for-the-publish-limit.md +28 -0
- package/docs/adrs/2026-10-14-videos-are-inlined-images.md +28 -0
- package/docs/adrs/2026-10-15-public-npm-under-labs-terms.md +37 -0
- package/docs/adrs/README.md +34 -0
- package/docs/commands.md +104 -0
- package/docs/editor.md +114 -0
- package/docs/syntax.md +157 -0
- package/docs/themes.md +134 -0
- package/package.json +68 -4
- package/runtime/base.css +354 -0
- package/runtime/edit-core.cjs +877 -0
- package/runtime/embed.js +5259 -0
- package/runtime/hot.js +136 -0
- package/runtime/runtime.js +729 -0
- package/skills/treasure-deck/SKILL.md +136 -0
- package/templates/deck.md +78 -0
- package/templates/specimen/specimen.md +104 -0
- package/templates/theme/assets/mark.svg +1 -0
- package/templates/theme/theme.css +97 -0
- package/templates/theme/theme.yaml +7 -0
- package/themes/default/theme.css +183 -0
- package/themes/default/theme.yaml +6 -0
- package/themes/editorial/theme.css +168 -0
- package/themes/editorial/theme.yaml +7 -0
- package/themes/gold/assets/gem.svg +130 -0
- package/themes/gold/theme.css +303 -0
- package/themes/gold/theme.yaml +7 -0
- package/themes/pastel/theme.css +187 -0
- package/themes/pastel/theme.yaml +6 -0
- package/themes/treasure-ai/assets/gem-line.svg +7 -0
- package/themes/treasure-ai/assets/gem.png +0 -0
- package/themes/treasure-ai/assets/gem.svg +25 -0
- package/themes/treasure-ai/assets/glass.svg +12 -0
- package/themes/treasure-ai/assets/logo-white.png +0 -0
- package/themes/treasure-ai/assets/logo.png +0 -0
- package/themes/treasure-ai/theme.css +239 -0
- package/themes/treasure-ai/theme.yaml +6 -0
- package/themes/wvlet/assets/wvlet-icon.svg +27 -0
- package/themes/wvlet/theme.css +238 -0
- package/themes/wvlet/theme.yaml +6 -0
package/docs/syntax.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Syntax
|
|
2
|
+
|
|
3
|
+
A deck is CommonMark + GFM (tables, task lists, strikethrough, autolinks) with a few additions for slides, columns, and attributes, so it never needs `<div>` markup. Slides are 16:9 on a 1280×720 canvas; sizes in canvas px mean the same on every screen and in PDFs.
|
|
4
|
+
|
|
5
|
+
The build is strict: an unknown layout, attribute, or class, a separator typo (`=== column`), or a missing image fails with its line number instead of reaching the audience. (`deck dev` and `deck editor` show such a slide as an error slide and keep the rest of the deck; see [ADR: strict build, forgiving preview](adrs/2026-10-03-strict-build-forgiving-preview.md).)
|
|
6
|
+
|
|
7
|
+
## Frontmatter
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
deck: true
|
|
12
|
+
title: "Wvlet: A Flow-Style Query Language"
|
|
13
|
+
author: Taro L. Saito
|
|
14
|
+
date: 2026-10-15
|
|
15
|
+
theme: wvlet # default | editorial | pastel | gold | treasure-ai | wvlet | ./my-theme (a theme folder, relative to the deck)
|
|
16
|
+
mode: dark # light | dark (each theme has both)
|
|
17
|
+
accent: "#25a7c1" # recolors the accent, and everything derived from it, on every slide
|
|
18
|
+
footer: "Treasure AI · DB Study Group"
|
|
19
|
+
section_slides: true # show section divider slides (hidden by default)
|
|
20
|
+
toc: sidebar # show the table of contents column from the start (`t` toggles it)
|
|
21
|
+
parts: [01-intro.md, 02-arch.md] # continue the deck in more files
|
|
22
|
+
---
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`deck: true` is what marks a Markdown file as a deck. `parts:` splits a long deck across files: the parts follow in order, each continuing the slide stream and starting a new slide. Each part is parsed as its own file, so errors, `deck check` findings, and the editor's source lines point into the part.
|
|
26
|
+
|
|
27
|
+
Everything else has one built-in behavior, with no setting: page numbers show on every slide except title and section slides, slides switch instantly with no transition, and slides containing Japanese get `lang="ja"` (Japanese line breaking and a Japanese fallback font), so a mixed Japanese/English deck needs nothing.
|
|
28
|
+
|
|
29
|
+
## Slides, columns, rows, and notes
|
|
30
|
+
|
|
31
|
+
| Syntax | Meaning |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `---` | Next slide (even with nothing after it yet, at the end of the file: an empty slide) |
|
|
34
|
+
| `--- <layout> <args> {attrs}` | Next slide, with a layout and attributes (`--- columns 3:2 {.class mode=dark}`) |
|
|
35
|
+
| `=== col` / `=== col {.class}` | Next column. A slide with `=== col` is a `columns` slide. |
|
|
36
|
+
| `=== row` / `=== row 2:1 {.class}` | Next row: a band of its own columns, at its own widths, under the ones before. A slide with `=== row` is a `columns` slide. |
|
|
37
|
+
| `=== notes` | Speaker notes until the end of the slide |
|
|
38
|
+
| `{…}` after a block, image, or `[span]` | Attributes: `.class`, `key=value`, flags |
|
|
39
|
+
|
|
40
|
+
Header and separator lines count only on a line of their own, outside fenced code. A bare `===` is left to Markdown (a setext heading underline), and `=== col` inside a sentence is text. A `---` header right after the frontmatter sets the first slide's layout without adding an empty slide.
|
|
41
|
+
|
|
42
|
+
### Layouts
|
|
43
|
+
|
|
44
|
+
| Layout | Args | Behavior |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| `content` (default) | | Heading + body |
|
|
47
|
+
| `title` | | Centered title slide: H1 title, `{.subtitle}` and `{.meta}` paragraphs |
|
|
48
|
+
| `section` | | Starts a section (see below) |
|
|
49
|
+
| `columns` | ratio, e.g. `3:2`, `1:1:1` (default: equal) | Columns separated by `=== col`; a leading `#`/`##` heading spans all of them. A column that opens with `###` becomes a card. |
|
|
50
|
+
|
|
51
|
+
Other kinds of slides come from attributes rather than more layouts: `{side=right w=40%}` on an image makes a split slide, `{bg}` a full-bleed image slide, and `{.center}` or `{.lead}` a statement slide.
|
|
52
|
+
|
|
53
|
+
Slide attributes in the header: `{mode=dark}` (or `light`) for one slide, `{bg=img.jpg dim=0.5}` for a background image, `{fit}`, `{hide}`, and on section slides `{show}` and `{nonum}` (below), plus classes.
|
|
54
|
+
|
|
55
|
+
### Rows
|
|
56
|
+
|
|
57
|
+
`=== row` stacks bands of columns in one slide, each as tall as its content: three cards over a full-width summary, or a lead paragraph over two columns. The header's ratio sets the first row's widths and `=== row 2:1` sets that row's; each row is even without one.
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
--- columns
|
|
61
|
+
# Three pillars
|
|
62
|
+
|
|
63
|
+
### Ingest
|
|
64
|
+
…
|
|
65
|
+
=== col
|
|
66
|
+
### Unify
|
|
67
|
+
…
|
|
68
|
+
=== col
|
|
69
|
+
### Activate
|
|
70
|
+
…
|
|
71
|
+
=== row
|
|
72
|
+
Every layer is replaceable; the contracts between them are not.{.callout}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Spacing
|
|
76
|
+
|
|
77
|
+
Blank lines work as in a block editor. One separates blocks; each blank line more adds a small gap between them on the slide (`--deck-gap`, 0.6em by default), so three blank lines before a paragraph push it down twice as far as two. Blank lines inside a list or code block, and at the start or end of a column, add nothing.
|
|
78
|
+
|
|
79
|
+
### Sections
|
|
80
|
+
|
|
81
|
+
`--- section` followed by `# Name` starts a section. Sections are numbered (`01`, `02`, …), and later slides show the number and name in the eyebrow above their titles (`01 · THE SYNTAX`). The divider slide itself is hidden by default, as in Beamer; show one with `--- section {show}`, or all of them with `section_slides: true`. `--- section {nonum}` shows a divider without its big number; the section stays numbered above its slides' titles and in the table of contents.
|
|
82
|
+
|
|
83
|
+
### Dense slides
|
|
84
|
+
|
|
85
|
+
Text never shrinks on its own; `deck check` reports a slide that overflows. For a slide that has to hold more, such as a reference table or an appendix, mark it `--- {fit}` (or `--- columns 1:1 {fit}`). The body below the title then zooms down just enough to fit, never below 14px text, while the title keeps its size. `deck check` warns when a fitted slide's text drops below 16px. See [ADR: overflow is reported, not hidden](adrs/2026-10-03-overflow-is-reported-not-hidden.md).
|
|
86
|
+
|
|
87
|
+
### Drafts
|
|
88
|
+
|
|
89
|
+
`--- {hide}` leaves a slide out of the build without deleting it. On a section slide (`--- section {hide}`) it leaves out the whole section, up to the next `--- section`, and later sections are numbered as if it weren't there. `deck editor` still shows hidden slides, dimmed, to edit them; they're left out only when the deck is presented or built.
|
|
90
|
+
|
|
91
|
+
### Table of contents
|
|
92
|
+
|
|
93
|
+
Press `t` to show or hide a left column on every slide; `toc: sidebar` shows it from the start. The slide is scaled down beside it as a whole, so its layout stays exactly as without the column: nothing rewraps or moves. It lists the sections (including those whose divider is hidden), highlights the current one, and shows the titles of the current section's slides with the current slide marked. Click an entry to jump to that slide. It is on title, section, and full-bleed slides too, so the outline stays in view while paging through the deck. It is part of the slide, so it appears when presenting and in PDFs, where its entries are links.
|
|
94
|
+
|
|
95
|
+
## Images
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
{h=400 shadow}
|
|
99
|
+
{bg dim=0.5}
|
|
100
|
+
{side=left w=40%}
|
|
101
|
+
{at=top-right w=120}
|
|
102
|
+
{fit}
|
|
103
|
+
{w=60%}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Attribute | Effect |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `w=`, `h=` | Size in canvas px or `%` of the column |
|
|
109
|
+
| `fit` / `cover` | Fill the column (contain / crop) |
|
|
110
|
+
| `left`, `center`, `right` | Horizontal alignment in the flow (images center by default) |
|
|
111
|
+
| `bg`, `bg dim=0.6`, `bg blur=4` | Full-slide background behind the content |
|
|
112
|
+
| `side=left\|right` (+ `w=`, default 45%) | A full-height side panel, so the slide becomes a split without declaring a layout |
|
|
113
|
+
| `at=<anchor>` / `at=x%,y%` | Pinned out of the flow: one of nine anchors (`top-left`, `top`, `top-right`, `left`, `center`, `right`, `bottom-left`, `bottom`, `bottom-right`, 32px in from the edges) or the top-left corner at x%, y% of the slide body |
|
|
114
|
+
| `shadow`, `round`, `circle`, `border` | Decoration, styled by the theme |
|
|
115
|
+
| `"Caption"` (the Markdown image title) | A caption under the image |
|
|
116
|
+
|
|
117
|
+
Several images in one paragraph lay out as an evenly spaced row. Paths resolve relative to the Markdown file; images are inlined into the built page. The editor writes most of these for you: it aligns, decorates, resizes, and moves images on the slide ([Editor: images](editor.md#images)).
|
|
118
|
+
|
|
119
|
+
### Videos
|
|
120
|
+
|
|
121
|
+
A video file uses the same syntax, told apart by its extension (`.mp4`, `.webm`, `.mov`, `.m4v`), and takes the same size, alignment, `at=`, decoration, and caption attributes as an image, plus three of its own:
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
{w=70% round}
|
|
125
|
+
{autoplay loop nocontrols}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
| Attribute | Effect |
|
|
129
|
+
|---|---|
|
|
130
|
+
| (none) | Shows the first frame with the browser's play bar |
|
|
131
|
+
| `autoplay` | Plays, muted, each time its slide is shown, and pauses when the slide is left |
|
|
132
|
+
| `loop` | Plays again from the start when it ends |
|
|
133
|
+
| `nocontrols` | No play bar (pair with `autoplay`) |
|
|
134
|
+
|
|
135
|
+
A video plays on its own in the audience window and the editor; the presenter window mutes its copy (so the talk is heard once), and the overview doesn't play it. A video with `nocontrols` and no `autoplay` plays and pauses on a click. In a PDF it shows its first frame. A video can't be a `{bg}` or `{side}` yet.
|
|
136
|
+
|
|
137
|
+
Local videos are inlined into the built page like images, so the deck stays one file. That makes the file as large as its videos and a third more, and a page over about 9 MB can't be published as a web page (Apps Script refuses it): keep clips short. `deck build` warns about a page that large, naming its largest files, and about a video over 20 MB. `deck build --media-dir <dir>` keeps videos out of the page instead: they are copied into the folder, which goes with the page. QuickTime (`.mov`) files play when they are H.264, as most screen recordings are. A video by URL (`https://…`) is left as a link.
|
|
138
|
+
|
|
139
|
+
## Text and classes
|
|
140
|
+
|
|
141
|
+
Attributes on headings, paragraphs, lists, and spans take a fixed vocabulary of classes that every theme styles, so switching themes needs no edits:
|
|
142
|
+
|
|
143
|
+
- Blocks: `{.lead}` `{.small}` `{.muted}` `{.center}` `{.subtitle}` `{.meta}` `{.callout}` `{.note}` `{.warn}`
|
|
144
|
+
- Spans: `[key insight]{.hl}`, `[new]{.badge}`, `[old]{.del}`
|
|
145
|
+
- Inside headings, `*emphasis*` renders in the theme's accent style.
|
|
146
|
+
|
|
147
|
+
A block's braces go right after its text (`Plain text{.center}`); after an inline element such as `**bold**`, braces belong to that element, so a block's braces then need a space before them (`Some **bold** {.muted}`). Define more classes in a deck-local `theme.css` ([Themes](themes.md)).
|
|
148
|
+
|
|
149
|
+
## Code
|
|
150
|
+
|
|
151
|
+
Fenced code is highlighted at build time for every [highlight.js](https://highlightjs.org/) language plus [Wvlet](https://wvlet.org/wvlet/docs/development/syntax-highlighting/) (` ```wvlet ` or ` ```wv `), colored by the theme. ` ```sql {2-3} ` highlights lines 2–3. A slide holding only a code block gets a larger code font, and a block whose longest line is wider than its panel shrinks just enough to fit, down to 12px, instead of clipping (`deck check` reports code still clipped, and warns below 14px).
|
|
152
|
+
|
|
153
|
+
## Diagrams
|
|
154
|
+
|
|
155
|
+
` ```mermaid ` blocks render as diagrams colored by the theme, and follow light and dark mode. `deck build` draws them ahead of time in headless Chrome with a bundled Mermaid and inlines the SVG, so the page needs no network and a diagram with a syntax error fails the build (without Chrome, they render in the browser from jsDelivr). Nodes are bold, gradient-filled, and shadowed; give one a palette role with `A[Label]:::accent`, `:::dark`, `:::muted`, or `:::light` (the default is the primary gradient).
|
|
156
|
+
|
|
157
|
+
A diagram is as wide as Mermaid draws it, up to its column. ` ```mermaid {w=60%} ` scales it to that width (canvas px or % of the column, larger as well as smaller), centered, and `{h=300}` to that height.
|
package/docs/themes.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Themes
|
|
2
|
+
|
|
3
|
+
Six themes are built in: three unbranded ones, `default` (used when a deck names no theme), `editorial`, and `pastel`, and three branded ones, `gold` (Treasure Work), `treasure-ai`, and `wvlet` (`deck themes` lists them). Every theme styles the same four layouts, every class, and every Markdown element, so switching themes is one line of frontmatter:
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
theme: default # or editorial, pastel, gold, treasure-ai, wvlet, or ./my-theme (a folder, relative to the deck)
|
|
7
|
+
mode: dark # light | dark
|
|
8
|
+
accent: "#25a7c1" # recolors the accent, and everything derived from it
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`--theme` on the command line overrides it (a folder there is relative to the current directory), so `deck dev talk.md --theme wvlet --port 4302` previews another theme side by side.
|
|
12
|
+
|
|
13
|
+
## Tweaking a theme: `theme.css`
|
|
14
|
+
|
|
15
|
+
A `theme.css` next to the deck loads after the theme. It can add rules and classes, and override tokens. Themes set tokens with `.deck[data-theme="<name>"] .slide`, so an override needs a selector at least that specific (it wins by loading later); for the accent color, `accent:` in the frontmatter is simpler:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
.deck[data-theme] .slide { --deck-card: #fff; } /* light slides; dark ones keep the theme's */
|
|
19
|
+
.deck .slide .kicker { text-transform: uppercase; letter-spacing: .08em; }
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Writing a theme
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
deck theme init my-theme # a small template: seed colors, fonts, every semantic class
|
|
26
|
+
deck theme init my-theme --from gold # or a copy of a built-in theme, renamed
|
|
27
|
+
deck theme check ./my-theme # required tokens, every class styled, WCAG AA contrast, light and dark
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A theme is a folder: `theme.yaml` (the manifest), `theme.css`, and `assets/`. CSS references like `url(assets/slide-bg.jpg)` are inlined at build time, so the output stays one file. All of a theme's CSS is scoped under `.deck[data-theme="<name>"]`, where the name is `theme.yaml`'s `name:` (default: the folder name). `deck dev` reloads when the theme's files change, even outside the deck's folder.
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
# theme.yaml
|
|
34
|
+
name: gold
|
|
35
|
+
modes: [light, dark]
|
|
36
|
+
default_mode: light
|
|
37
|
+
fonts:
|
|
38
|
+
display: "Inter Tight:wght@400;500;600;700"
|
|
39
|
+
accent: "Source Serif 4:ital,opsz,wght@1,8..60,400..700"
|
|
40
|
+
body: "Inter Tight:wght@400;500;600;700"
|
|
41
|
+
mono: "JetBrains Mono:wght@400;500"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### The contract
|
|
45
|
+
|
|
46
|
+
A theme sets a few **seed** colors on `.slide` (and again for dark slides): `--deck-bg`, `--deck-fg`, `--deck-accent`, and optionally `--deck-accent-2` (default: the accent's hue turned 150°), `--deck-warn`, and `--deck-ok`. It also sets `--deck-font-display`, `--deck-font-body`, `--deck-font-mono`, and `--deck-radius`.
|
|
47
|
+
|
|
48
|
+
`runtime/base.css` derives every other color from the seeds: muted text, lines, cards, the text on the accent, highlights, chips, chart series, code token colors, and the whole Mermaid palette. So dark mode only re-sets the seeds, and `accent:` recolors the whole deck. A theme can still set any derived token itself, as the built-in themes do for their brand palettes; set it on `.slide` too, never on `.deck`, where the derivation would shadow it ([ADR: theme colors derive from seeds in CSS](adrs/2026-10-04-theme-colors-derive-in-css.md)).
|
|
49
|
+
|
|
50
|
+
| Tokens | For |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `--deck-fg-muted`, `--deck-strong`, `--deck-line`, `--deck-card`, `--deck-on-accent`, `--deck-hl`, `--deck-chip` | Derived text, rule, card, and highlight colors |
|
|
53
|
+
| `--deck-series-1` … `-6` | Chart series |
|
|
54
|
+
| `--deck-diagram-fill/-fill-2/-node-text/-stroke/-line/-text/-alt/-shadow` | Mermaid diagrams |
|
|
55
|
+
| `--deck-diagram-<role>-fill/-fill-2/-text` for `accent`, `dark`, `muted`, `light` | Diagram nodes with `:::role` |
|
|
56
|
+
| `--code-comment/-keyword/-string/-number/-title/-type/-variable/-operator/-meta` on `pre.code` | Code highlighting |
|
|
57
|
+
| `--deck-scale-*`, `--deck-pad-*` (on `.deck`) | Density: type sizes and margins |
|
|
58
|
+
| `--deck-col-rule` | Opt-in divider between columns |
|
|
59
|
+
|
|
60
|
+
A theme must style the four layouts, every semantic class, and the standard Markdown elements (lists, tables, blockquotes, code, images). Beyond that it can do anything CSS allows: generated backgrounds, decorations per layout. Creativity lives in how a theme renders the same four layouts, not in extra layouts, so every deck works under every theme.
|
|
61
|
+
|
|
62
|
+
### Slide anatomy (shared by every theme)
|
|
63
|
+
|
|
64
|
+
- **Density:** body text is 22px on the 1280×720 canvas, with `#` at 34–36px and `###` at about 21px. Margins are 36px top, 56px sides and 52px bottom, with 36px between columns. Title and section slides use 46–60px type.
|
|
65
|
+
- **Header band:** a leading `#`/`##` on a content or columns slide becomes the slide header, with an **eyebrow** naming the current section (`01 · THE SYNTAX`).
|
|
66
|
+
- **Section numbers:** a shown section divider has a large `.section-num`.
|
|
67
|
+
- **Footer banner:** every slide has a `.footer-brand` slot at bottom left that the theme fills with its logo and wordmark; the deck's `footer:` text and the page number follow it.
|
|
68
|
+
- **Columns:** a divider when the theme sets `--deck-col-rule`; a column that opens with `###` is a card.
|
|
69
|
+
|
|
70
|
+
### `deck theme check`
|
|
71
|
+
|
|
72
|
+
`deck theme check <name | dir>` builds a bundled specimen deck (every layout, class, and element) with the theme, in light and dark, and inspects it in headless Chrome:
|
|
73
|
+
|
|
74
|
+
- **Errors:** a missing seed or font token, a semantic class that looks like plain text, and body text, headings, tables, code, links, badges, and diagram labels below WCAG AA contrast (4.5:1, or 3:1 for large text).
|
|
75
|
+
- **Warnings:** a derived token set on `.deck` (shadowed), and low contrast in the quiet tiers (`.muted`, `.meta`, footer, eyebrow, section numbers, code comments, captions).
|
|
76
|
+
|
|
77
|
+
Contrast is measured against the rendered pixels, so gradients, grain, and frosted cards count. `--snapshots dir` saves the specimen's slides as PNGs.
|
|
78
|
+
|
|
79
|
+
## Built-in themes
|
|
80
|
+
|
|
81
|
+
**`default` — unbranded** (the theme a deck gets when it names none)
|
|
82
|
+
|
|
83
|
+
- Plain at heart, with some polish. Light: white `#ffffff` / ink `#1d2129`, soft indigo `#5e6ad2` as the accent and violet `#7654dd` as the second; the two make the accent gradient. Dark: near-black `#0c0e13` / `#e4e7ed`, with `#8e97f0` and `#b4a6f7`. Everything follows the seeds, so `accent:` recolors the whole deck, gradients and section slides included.
|
|
84
|
+
- Inter throughout (700 headings with tight tracking, 800 on title and section slides); `*accent*` words in headings carry the accent gradient. JetBrains Mono for code and page numbers.
|
|
85
|
+
- Content slides: white with a faint accent glow in the top-right and bottom-right corners. The header is the section in a small chip, the title, and a hairline that starts with a short gradient stroke. Bullets are small gradient squares, with hollow rings on nested levels. Cards are raised white panels with a gradient top edge. Tables are raised panels with a tinted, small-caps header row. Callouts are tinted panels with a side rule.
|
|
86
|
+
- Code: a dark panel on every slide, with GitHub-dark token colors, line numbers, and the language in the corner.
|
|
87
|
+
- Title: big 800-weight type at left, a gradient bar above it, and a soft indigo and violet glow with a dot grid fading in from the right. Section: a full-bleed accent color block (its lightness capped so white type always reads) with a large number and the dot grid.
|
|
88
|
+
- Banner: no logo; the footer shows only the deck's `footer:` text and the page number.
|
|
89
|
+
|
|
90
|
+
**`editorial` — unbranded, newspaper-inspired**
|
|
91
|
+
|
|
92
|
+
- Crisp cool paper `#f7f7f4`, black ink, one muted oxblood accent `#8a2b36`, and navy `#1f3a5f` as the second color. Highlights are a yellow marker. Dark: near-black `#121212` with a soft rose `#d98a92`.
|
|
93
|
+
- Playfair Display for headings (`*accent*` words in its italic, in oxblood) over a Source Sans 3 body at 23px, and IBM Plex Mono for code.
|
|
94
|
+
- Rules instead of boxes: a small-caps kicker with an italic section number, and a double rule (heavy over hairline) under each header. Lists use em dashes. Cards sit under a heavy rule like newspaper columns, and tables use booktabs rules with no fills. Blockquotes are italic pull quotes behind a large oxblood quotation mark.
|
|
95
|
+
- Code: a white sheet with a hairline and an oxblood left edge (a deep sheet on dark slides).
|
|
96
|
+
- Halftone: newsprint dots fade in from one corner of each slide, and the corner moves from slide to slide (bottom right, top right, bottom left), so consecutive slides read as different pages.
|
|
97
|
+
- Title: large Playfair between a heavy rule and a hairline, with an italic subtitle, an oxblood band down the left edge, and a wide halftone at right. Section: the page inverts (black on a light deck, paper on a dark one) with a large oxblood italic numeral over a heavy rule and rose halftone dots.
|
|
98
|
+
- Banner: no logo; a small-caps footer and italic page numbers.
|
|
99
|
+
|
|
100
|
+
**`pastel` — unbranded, friendly and warm**
|
|
101
|
+
|
|
102
|
+
- A blush-white canvas `#fffaf8` with soft blobs from one warm family (rose, pink, peach, and apricot) in the corners, so the background never mixes clashing hues. The accent is rose `#b83c6c` with coral `#c4542b`. Dark: a warm plum night `#221a1f` with the pastels glowing, and pink `#ff9fbf` / peach `#ffb08a` accents.
|
|
103
|
+
- Rounded Nunito throughout (800–900 headings, `*accent*` words in a rose → coral gradient), and JetBrains Mono for code.
|
|
104
|
+
- The section sits in a rose pill above the title, with a short pink → apricot bar under the header. Bullets are round dots that cycle through pink, coral, apricot, and rosewood. Cards are rounded white panels with a pastel top edge, tables are rounded panels with a rose header row, and callouts are rose, pink, and peach bubbles.
|
|
105
|
+
- Code: a rounded warm plum panel with three window dots and soft pastel token colors.
|
|
106
|
+
- Title and section: a full warm pastel mesh with floating translucent circles. On section slides, the number sits in a white circle.
|
|
107
|
+
- Banner: no logo; the page number sits in a soft pill.
|
|
108
|
+
|
|
109
|
+
**`gold` — Treasure Work** (tokens and assets from `treasure-work/website`, the work.treasure.ai landing page)
|
|
110
|
+
|
|
111
|
+
- Light: cream `#fbf8f2` / ink `hsl(25 35% 10%)`, primary `hsl(30 62% 32%)`. Dark: slate gray `hsl(224 11% 19%)` as in the Treasure Work app / ink `hsl(210 15% 91%)`, primary `hsl(42 85% 64%)`. Series colors are the six "ray" hues.
|
|
112
|
+
- Inter Tight 700 headings with tight tracking, and 21px body text (a touch below the 22px default). `*Accent*` words in headings stay in Inter Tight, set in its 700 italic with an animated gold shimmer. Serif italics (Instrument Serif, then Fraunces and Source Serif) were tried and dropped: inside a bold sans title the mix never sat well, however the weight was matched. Source Serif 4 italic remains for blockquotes, where it sets a quote apart from body text. JetBrains Mono for code and page numbers.
|
|
113
|
+
- Paper feel: content slides carry a softer version of the title aurora around the right and bottom edges, with a fine grain texture. The top left stays flat cream so titles read cleanly. Under the title, a long gold bar (deep amber → bright gold) fades out over a hairline. Bullets are gold diamonds (the gem motif), and nested levels hang off a thin gold guide line. Tables use small-caps headers on a gradient that runs from deep amber at the left to bright gold at the right. Cards are cream with a shine edge. `.muted` text uses its own lighter warm grey, so it stands clearly apart from body text.
|
|
114
|
+
- Code: flat charcoal panels above the grain, with line numbers, the language in the top-right corner, Rosé Pine token colors (iris keywords, gold strings, rose numbers, foam types), and highlighted lines on a neutral lifted band with a gold left edge. Inline code is a gold-tinted chip.
|
|
115
|
+
- Title: a full aurora with the 3D gem floating at right. Section: a giant gold-gradient number above the title.
|
|
116
|
+
- Banner: the gem and the "Treasure Work" wordmark at bottom left.
|
|
117
|
+
|
|
118
|
+
**`treasure-ai` — Treasure AI corporate brand** (colors and gem from the Treasure AI mark; logo extracted from the Google Slides template)
|
|
119
|
+
|
|
120
|
+
- Palette: the gem's violet `#b96fe7` → periwinkle `#7878ff` → blue `#29aaff` → cyan `#93e2ff`, plus the indigo wordmark `#3240a4`. Inter throughout, with 21px body text (like gold; Inter is a wide face, so 22px read large).
|
|
121
|
+
- **The gem:** the logo's gem, traced to a vector (`assets/gem.svg`, with a line version `gem-line.svg`), floats on the title slide and scatters on section slides. Bullets and the section-number badge use the gem's silhouette.
|
|
122
|
+
- **Living gradient:** title and section slides are a mesh gradient (violet, blue, and cyan glows over deep indigo) with white type. Each slide carries `--deck-progress` (0 → 1 across the deck), and the glows' focal points drift with it, so the deck feels continuous as you advance.
|
|
123
|
+
- **Pastel light slides:** content slides carry the brand background's sweep of peach → pink → violet → blue, rising from the lower right, with two frosted, tilted gem-facet slabs (`assets/glass.svg`) at right and fine grain. The slabs also appear faintly on title, section, and night slides, and they drift slightly with progress. The upper left stays clear for text. Cards and tables are frosted white panels over it.
|
|
124
|
+
- Content: indigo titles with a short gem-gradient bar, an eyebrow with the section number in a gem badge, tables with a continuous deep-indigo gradient header, and deep-indigo code panels.
|
|
125
|
+
- **Night mode** (`mode: dark`): a deep-indigo canvas (`#0b0d29`) with stronger glows, white titles, and cyan accents.
|
|
126
|
+
- Banner: the Treasure AI logo at bottom left, with a white wordmark on gradient and night slides.
|
|
127
|
+
|
|
128
|
+
**`wvlet` — Wvlet** (after the Trino Summit 2024 Wvlet deck; icon from `wvlet/logos/wvlet-icon.svg`)
|
|
129
|
+
|
|
130
|
+
- Light by default: an icy blue-white gradient with soft bokeh highlights. Titles are Roboto Bold in deep teal `#246570` with a soft lift shadow; `*accent*` words carry a slow teal → cyan shimmer (lighter cyans on section terminals and dark slides, where titles turn white). Top-level bullets are teal statements and nested levels are gray details with hollow ○ markers. Links are coral.
|
|
131
|
+
- Code is a navy terminal panel (`#2f3249`) with a `wv>` prompt bar and line numbers. Image captions are teal gradient chips, and tables have a teal header row.
|
|
132
|
+
- Query motifs: the eyebrow is a SQL comment (`-- 01 · the syntax`), and ordered lists render as `|` pipeline stages.
|
|
133
|
+
- Title: the W mark beside the title, as on the Trino Summit cover. Section: a navy terminal window reading `wv> <title>` with a blinking cursor.
|
|
134
|
+
- Banner: the W mark and the "Wvlet" wordmark at bottom left. `mode: dark` switches to a near-black blueprint grid with a teal glow.
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treasure-ai/treasure-deck",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2026.10.0",
|
|
4
|
+
"description": "Markdown presentations without <div> markup: four layouts, themes, and a single-file HTML output that publishes to Apps Script",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
|
+
"homepage": "https://www.npmjs.com/package/@treasure-ai/treasure-deck",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/treasure-data/treasure-ai-labs/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/treasure-data/treasure-deck.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"slides",
|
|
16
|
+
"presentation",
|
|
17
|
+
"markdown",
|
|
18
|
+
"deck",
|
|
19
|
+
"treasure-ai"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"packageManager": "pnpm@11.9.0",
|
|
23
|
+
"bin": {
|
|
24
|
+
"deck": "./dist/cli.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"docs",
|
|
29
|
+
"!docs/design.md",
|
|
30
|
+
"runtime",
|
|
31
|
+
"skills",
|
|
32
|
+
"templates",
|
|
33
|
+
"themes",
|
|
34
|
+
"LICENSE.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"prepack": "pnpm build",
|
|
39
|
+
"deck": "tsx src/cli.ts",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"demo": "for t in default editorial pastel gold treasure-ai wvlet; do tsx src/cli.ts build examples/tour/tour.md --theme $t -o examples/tour/tour-$t.html; done",
|
|
43
|
+
"demo:pdf": "for t in default editorial pastel gold treasure-ai wvlet; do tsx src/cli.ts pdf examples/tour/tour.md --theme $t -o examples/tour/tour-$t.pdf; done",
|
|
44
|
+
"release": "scripts/release.sh",
|
|
45
|
+
"promote": "scripts/promote.sh"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=22"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@wvlet/highlightjs-wvlet": "^2026.3.0",
|
|
55
|
+
"highlight.js": "^11.12.0",
|
|
56
|
+
"lucide-static": "^1.52.0",
|
|
57
|
+
"markdown-it": "^15.0.2",
|
|
58
|
+
"markdown-it-attrs": "^5.0.1",
|
|
59
|
+
"markdown-it-bracketed-spans": "^1.0.3",
|
|
60
|
+
"mermaid": "^11.17.2",
|
|
61
|
+
"vite": "^8.3.2",
|
|
62
|
+
"yaml": "^2.9.1"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/node": "^26.6.4",
|
|
66
|
+
"tsx": "^4.23.15",
|
|
67
|
+
"typescript": "^7.0.2",
|
|
68
|
+
"vitest": "^5.0.3"
|
|
69
|
+
}
|
|
70
|
+
}
|