Public: anyone can read this; the crew can change it.

Code colouring's token classes are named in docs/design/areas/highlight.md, and the .tok-* lines leave §5d #5514

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/5502-code-colouring-s-token-classes-are-named → main 1 commit fork

  • Merged. mason/5502-code-colouring-s-token-classes-are-named was merged into main as 5aa0bc2.

Review

Sign in to review this change.
2 files changed +23 −19
docs/DESIGN.md −19
@@ -514,27 +514,8 @@ the same line (#4888).
514514 - **`style/content.ts`, code view** — the source view and the syntax-highlight token classes `highlight-html.ts` builds as `tok-${kind}`:
515515 - `.blob-view`
516516 - `.ln`
517 - `.tok-attribute`
518 - `.tok-comment`
519 - `.tok-constant`
520 - `.tok-decorator`
521517 - `.tok-deleted`
522 - `.tok-emphasis`
523 - `.tok-function`
524 - `.tok-heading`
525518 - `.tok-inserted`
526 - `.tok-keyword`
527 - `.tok-link`
528 - `.tok-meta`
529 - `.tok-number`
530 - `.tok-operator`
531 - `.tok-property`
532 - `.tok-punctuation`
533 - `.tok-regex`
534 - `.tok-string`
535 - `.tok-tag`
536 - `.tok-type`
537 - `.tok-variable`
538519 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`:
539520 - `.ta-c`
540521 - `.ta-r`
docs/design/areas/highlight.md added +23
@@ -0,0 +1,23 @@
1 # Code, coloured
2
3 The highlighter's token colours (§6b): one component, written as `tok-${kind}` by `tokenClasses` in `src/web/highlight-html.ts` and coloured by the `--tok-*` tokens in `src/design/themes.ts`. A token span carries its colour class, plus a finer kind class when it has one; the file browser, the diff viewer and the editor all draw the same spans.
4
5 - `.tok-attribute` — an attribute name, as in markup.
6 - `.tok-comment` — a comment.
7 - `.tok-constant` — a constant: `true`, `null`, a named constant.
8 - `.tok-decorator` — a decorator or annotation.
9 - `.tok-emphasis` — emphasised prose, as in markdown.
10 - `.tok-function` — a function name.
11 - `.tok-heading` — a heading, as in markdown.
12 - `.tok-keyword` — a language keyword.
13 - `.tok-link` — a link, as in markdown.
14 - `.tok-meta` — meta syntax: a preprocessor line, a front-matter fence.
15 - `.tok-number` — a numeric literal.
16 - `.tok-operator` — an operator; muted, it is a line's scaffolding.
17 - `.tok-property` — a property or key name.
18 - `.tok-punctuation` — punctuation; muted, it is a line's scaffolding.
19 - `.tok-regex` — a regular-expression literal.
20 - `.tok-string` — a string literal.
21 - `.tok-tag` — a tag name, as in markup.
22 - `.tok-type` — a type name.
23 - `.tok-variable` — a variable or parameter name.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs