summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/Header.tsx
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-04-22 18:37:58 -0700
committerN. Taylor Mullen <[email protected]>2025-04-22 18:57:27 -0700
commite163e024996ff8bb1152284322831c4f35696801 (patch)
treee8799f87ba6b234136e56a1581ddd106962aa196 /packages/cli/src/ui/components/Header.tsx
parentffe368afed853f43c9ab8851c1edc86160db8486 (diff)
Colorize code blocks.
- This changeset uses lowlight.js to parse the code in codeblocks to derive an AST, it then translates that into CSS themes that are widely known via highlight.js (things that GitHub use), finally I translate those css.color attributes into Ink colors and effectivel do <Text color={the color}>the text</Text>. - To do this I needed to build color mappings from css -> Ink - I introduced a new `Theme` type that will be used to represent many different color themes. It also enabled the color mappings to be seamless. - Added a theme manager that only has one theme for now (VS2015). The theme works very well with our colorization. - Some other bits was removal of borders around our codeblocks since they now have richer rendering. - Most complex bits of code in this PR is in the `CodeColorizer.tsx` Fixes https://b.corp.google.com/issues/412433479
Diffstat (limited to 'packages/cli/src/ui/components/Header.tsx')
0 files changed, 0 insertions, 0 deletions