Skip to content

Commit d71370b

Browse files
committed
Read kv keys and table first columns as labels, the docs way
kv keys dropped the blanket monospace — they render as the docs' row labels (500, primary, sans), with backticks in the source opting a code-like key (a path, an env var) into the inline-code chip; keys now run through inline markdown to make that work. Table body first columns pick up the same label treatment the docs tables show.
1 parent 224d38d commit d71370b

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎apps/sim/lib/workspace-files/artifact-stylesheet.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; d
293293
rule under the header, --surface-active rules between rows, bare last row. */
294294
table { border-collapse: collapse; border-spacing: 0; width: 100%; font-size: var(--text-sm); }
295295
th, td { text-align: left; padding: 0.5rem 0.75rem; line-height: 1.5; }
296+
/* The docs' tables read their first column as the row's label. */
297+
tbody td:first-child { font-weight: 500; color: var(--text-primary); }
296298
thead th { font-weight: 600; color: var(--text-primary); border-bottom: 1px solid var(--border); white-space: nowrap; }
297299
td { color: var(--text-secondary); border-bottom: 1px solid var(--surface-active); }
298300
tbody tr:last-child td { border-bottom: none; }
@@ -402,7 +404,13 @@ figcaption { font-size: 0.875em; line-height: 1.4285714; color: var(--text-prima
402404
font-size: var(--text-sm);
403405
}
404406
@media (min-width: 720px) { .rows > li { grid-template-columns: 240px minmax(0, 1fr); } }
405-
.rows .key { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--text-secondary); word-break: break-all; }
407+
.rows .key {
408+
/* A label, not code — the docs' th treatment. Backticks in the source opt
409+
a code-like key (a path, an env var) into the inline-code chip. */
410+
font-weight: 500;
411+
color: var(--text-primary);
412+
font-size: var(--text-sm);
413+
}
406414
407415
/* Docs chrome --------------------------------------------------------------- */
408416
.art-bar {

‎apps/sim/lib/workspace-files/page-compile.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const FENCE_RENDERERS: Record<string, FenceRenderer> = {
184184
const rows = parsed.data
185185
.map(
186186
(item) =>
187-
`<li><span class="key">${escapeHtml(item.key)}</span><span>${renderInlineMarkdown(item.value)}</span></li>`
187+
`<li><span class="key">${renderInlineMarkdown(item.key)}</span><span>${renderInlineMarkdown(item.value)}</span></li>`
188188
)
189189
.join('')
190190
return `<ul class="rows">${rows}</ul>`

0 commit comments

Comments
 (0)