-
Notifications
You must be signed in to change notification settings - Fork 3
Add Go, Gruvbox themes, and the README banner #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eeef555
docs: use the dynamic README header endpoint
AlemTuzlak eb4dc42
Support Go
lukasbindreiter b342002
Add Gruvbox Themes
lukasbindreiter 35f4090
Improve go number regex
lukasbindreiter a57246c
Merge Gruvbox theme contribution
tannerlinsley d2466dd
Merge dynamic README banner contribution
tannerlinsley 3b3c716
Merge Go language contribution
tannerlinsley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@tanstack/highlight": minor | ||
| --- | ||
|
|
||
| Add an isolated Go language definition with the `golang` alias and isolated Gruvbox Dark and Light themes. Existing selective language bundles and the core are unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { defineLanguage } from '../core.js' | ||
| import { patternTokenizer } from '../internal/patterns.js' | ||
|
|
||
| export const go = defineLanguage({ | ||
| name: 'go', | ||
| aliases: ['golang'], | ||
| tokenize: patternTokenizer([ | ||
| { | ||
| className: (match) => | ||
| match[0].startsWith('/') ? 'comment' : 'string', | ||
| regex: | ||
| /\/\/[^\n]*|\/\*[\s\S]*?\*\/|`[\s\S]*?`|"(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'/g, | ||
| }, | ||
| { | ||
| className: 'keyword', | ||
| regex: | ||
| /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g, | ||
| }, | ||
| { className: 'literal', regex: /\b(?:false|iota|nil|true)\b/g }, | ||
| { className: 'type', regex: /\btype\s+([A-Za-z_]\w*)/g, group: 1 }, | ||
| { | ||
| className: 'type', | ||
| regex: | ||
| /\b(?:any|bool|byte|comparable|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\b/g, | ||
| }, | ||
| { className: 'function', regex: /\b[A-Za-z_]\w*(?=\s*\()/g }, | ||
| { | ||
| className: 'number', | ||
| regex: | ||
| /(?:^|[^\w.])((?:0[bB]_?[01](?:_?[01])*|0[oO]_?[0-7](?:_?[0-7])*|0[xX](?:(?:_?[\da-fA-F](?:_?[\da-fA-F])*(?:\.(?:[\da-fA-F](?:_?[\da-fA-F])*)?)?|\.[\da-fA-F](?:_?[\da-fA-F])*)[pP][+-]?\d(?:_?\d)*|_?[\da-fA-F](?:_?[\da-fA-F])*)|\d(?:_?\d)*\.(?:\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*|\.\d(?:_?\d)*(?:[eE][+-]?\d(?:_?\d)*)?|\d(?:_?\d)*)(?:i)?)(?![\w.])/g, | ||
| group: 1, | ||
| }, | ||
| { className: 'property', regex: /\.\s*([A-Za-z_]\w*)/g, group: 1 }, | ||
| { | ||
| className: 'operator', | ||
| regex: | ||
| /\.\.\.|<<=?|>>=?|&\^=?|:=|<-|\+\+|--|==|!=|<=|>=|&&|\|\||[+\-*/%&|^!<>=~]=?/g, | ||
| }, | ||
| ]), | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import type { HighlightTheme } from '../theme.js' | ||
|
|
||
| export const gruvboxDarkTheme = { | ||
| background: '#282828', | ||
| foreground: '#ebdbb2', | ||
| name: 'gruvbox-dark', | ||
| type: 'dark', | ||
| tokens: { | ||
| attr: '#8ec07c', | ||
| 'code-inline': '#8ec07c', | ||
| command: '#b8bb26', | ||
| comment: '#928374', | ||
| deleted: '#fb4934', | ||
| function: '#b8bb26', | ||
| heading: '#b8bb26', | ||
| inserted: '#b8bb26', | ||
| keyword: '#fb4934', | ||
| link: '#d3869b', | ||
| literal: '#d3869b', | ||
| meta: '#928374', | ||
| number: '#d3869b', | ||
| operator: '#ebdbb2', | ||
| property: '#8ec07c', | ||
| selector: '#fe8019', | ||
| string: '#b8bb26', | ||
| tag: '#8ec07c', | ||
| token: '#ebdbb2', | ||
| type: '#fabd2f', | ||
| variable: '#83a598', | ||
| }, | ||
| } as const satisfies HighlightTheme | ||
|
|
||
| export default gruvboxDarkTheme | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import type { HighlightTheme } from '../theme.js' | ||
|
|
||
| export const gruvboxLightTheme = { | ||
| background: '#fbf1c7', | ||
| foreground: '#3c3836', | ||
| name: 'gruvbox-light', | ||
| type: 'light', | ||
| tokens: { | ||
| attr: '#427b58', | ||
| 'code-inline': '#427b58', | ||
| command: '#79740e', | ||
| comment: '#928374', | ||
| deleted: '#9d0006', | ||
| function: '#79740e', | ||
| heading: '#79740e', | ||
| inserted: '#79740e', | ||
| keyword: '#9d0006', | ||
| link: '#8f3f71', | ||
| literal: '#8f3f71', | ||
| meta: '#928374', | ||
| number: '#8f3f71', | ||
| operator: '#3c3836', | ||
| property: '#427b58', | ||
| selector: '#af3a03', | ||
| string: '#79740e', | ||
| tag: '#427b58', | ||
| token: '#3c3836', | ||
| type: '#b57614', | ||
| variable: '#076678', | ||
| }, | ||
| } as const satisfies HighlightTheme | ||
|
|
||
| export default gruvboxLightTheme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Increase contrast for comments and metadata.
#928374has about 4.0:1 contrast on the dark background and 3.3:1 on the light background. Comments and metadata are difficult to read.src/themes/gruvbox-dark.ts#L12-L12: use a higher-contrastcommentcolor, such as#a89984.src/themes/gruvbox-dark.ts#L20-L20: use the same higher-contrast color formeta.src/themes/gruvbox-light.ts#L12-L12: use a higher-contrastcommentcolor, such as#665c54.src/themes/gruvbox-light.ts#L20-L20: use the same higher-contrast color formeta.Add a regression assertion for token-to-background contrast.
📍 Affects 2 files
src/themes/gruvbox-dark.ts#L12-L12(this comment)src/themes/gruvbox-dark.ts#L20-L20src/themes/gruvbox-light.ts#L12-L12src/themes/gruvbox-light.ts#L20-L20🤖 Prompt for AI Agents