-40
appview/pages/chroma.go
-40
appview/pages/chroma.go
···
1
-
package pages
2
-
3
-
import "github.com/alecthomas/chroma/v2"
4
-
5
-
var tangledTheme map[chroma.TokenType]string = map[chroma.TokenType]string{
6
-
// Keywords
7
-
chroma.Keyword: "text-blue-400",
8
-
chroma.KeywordConstant: "text-indigo-400",
9
-
chroma.KeywordDeclaration: "text-purple-400",
10
-
chroma.KeywordNamespace: "text-teal-400",
11
-
chroma.KeywordReserved: "text-pink-400",
12
-
13
-
// Names
14
-
chroma.Name: "text-gray-700",
15
-
chroma.NameFunction: "text-green-500",
16
-
chroma.NameClass: "text-orange-400",
17
-
chroma.NameNamespace: "text-cyan-500",
18
-
chroma.NameVariable: "text-red-400",
19
-
chroma.NameBuiltin: "text-yellow-500",
20
-
21
-
// Literals
22
-
chroma.LiteralString: "text-emerald-500 ",
23
-
chroma.LiteralStringChar: "text-lime-500",
24
-
chroma.LiteralNumber: "text-rose-400",
25
-
chroma.LiteralNumberFloat: "text-amber-500",
26
-
27
-
// Operators
28
-
chroma.Operator: "text-blue-500",
29
-
chroma.OperatorWord: "text-indigo-500",
30
-
31
-
// Comments
32
-
chroma.Comment: "text-gray-500 italic",
33
-
chroma.CommentSingle: "text-gray-400 italic",
34
-
35
-
// Generic
36
-
chroma.GenericError: "text-red-600",
37
-
chroma.GenericHeading: "text-purple-500 font-bold",
38
-
chroma.GenericDeleted: "text-red-400 line-through",
39
-
chroma.GenericInserted: "text-green-400 underline",
40
-
}
+2
-2
appview/pages/pages.go
+2
-2
appview/pages/pages.go
···
497
497
}
498
498
499
499
func (p *Pages) RepoBlob(w io.Writer, params RepoBlobParams) error {
500
-
style := styles.Get("bw")
500
+
var style *chroma.Style = styles.Get("catpuccin-latte")
501
501
b := style.Builder()
502
-
b.Add(chroma.LiteralString, "noitalic")
503
502
style, _ = b.Build()
504
503
505
504
if params.ShowRendered {
···
516
515
chromahtml.WithLineNumbers(true),
517
516
chromahtml.WithLinkableLineNumbers(true, "L"),
518
517
chromahtml.Standalone(false),
518
+
chromahtml.WithClasses(true),
519
519
)
520
520
521
521
lexer := lexers.Get(filepath.Base(params.Path))
+1
appview/pages/templates/repo/blob.html
+1
appview/pages/templates/repo/blob.html