Changes
3 changed files (+109/-4)
-
-
@@ -103,7 +103,7 @@ if style == nil {return "", fmt.Errorf("No chroma style found for '%s'", styleQuery) } formatter := html.New() formatter := html.New(html.WithClasses(true), html.ClassPrefix("chroma-")) iter, err := lexer.Tokenise(nil, code) if err != nil {
-
-
static/repo-blob-ref.css (new)
-
@@ -0,0 +1,104 @@/* Copyright 2025 Shota FUJI <pockawoooh@gmail.com> * SPDX-License-Identifier: MIT */ .blob-preview { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: var(--space-xxs) var(--space-xs); font-family: var(--font-mono); font-size: var(--font-sm); line-height:1.3; border: 1px solid var(--color-border-subtle); padding: var(--space-md) var(--space-lg); box-shadow: 1px 1px 3px var(--color-shadow); border-radius: var(--radii-md); } .blob-preview--line-number-list { padding: 0; margin: 0; list-style: none; text-align: end; } .blob-preview--line-number { padding: 0; margin: 0; list-style: none; color: var(--color-fg-subtle); } .blob-preview--line-number:target { font-weight: var(--font-thick); color: var(--color-fg); } .blob-preview > pre { margin: 0; padding: 0; padding-inline-start: var(--space-sm); overflow-x: auto; } /* * https://github.com/alecthomas/chroma/blob/e0c774731c6f55889d36c4cbf18e7480e24c1020/types.go#L211 */ .chroma-chroma { --_color-string: var(--uchu-blue-9); --_color-keyword: var(--uchu-blue-8); } .chroma-k { color: var(--_color-keyword); } .chroma-kc, .chroma-kd, .chroma-kp, .chroma-kr { font-weight: var(--font-thick); color: var(--color-fg-weak); } .chroma-kn, .chroma-kt { font-weight: var(--font-thick); font-style: italic; } .chroma-na, .chroma-nt { font-weight: var(--font-thick); color: var(--color-fg-weak); } .chroma-s, .chroma-sa, .chroma-sb, .chroma-sc, .chroma-dl, .chroma-sd, .chroma-s2, .chroma-se, .chroma-sh, .chroma-si, .chroma-sx, .chroma-s1, .chroma-ss { color: var(--_color-string); } .chroma-o, .chroma-ow, .chroma-p { color: var(--color-fg-weak); } .chroma-c, .chroma-ch, .chroma-cm, .chroma-cp, .chroma-cpf, .chroma-c1, .chroma-cs { font-style: italic; color: var(--color-fg-subtle); } .chroma-ge { font-style: italic; } .chroma-gh, .chroma-gs { font-weight: var(--font-chonk); } .chroma-gu { font-weight: var(--font-thick); color: var(--color-fg-weak); } .chroma-gl { text-decoration: underline; } @media (prefers-color-scheme: dark) { .chroma-chroma { --_color-string: var(--uchu-blue-2); --_color-keyword: var(--uchu-blue-1); } }
-
-
-
@@ -7,6 +7,7 @@ <!DOCTYPE html><html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-blob-ref.css" /> {{- $path := "" -}} {{- $name := "" -}} {{- range .Path -}}
-
@@ -52,11 +53,11 @@ {{ template "repo-header" . }}{{ template "repo-nav" . }} </header> <main class="main"> <div style="display:grid;grid-template-columns:max-content minmax(0,1fr);gap:1px 1ch;font-family:monospace;line-height:1.3;"> <ol style="list-style:none;padding:0;"> <div class="blob-preview"> <ol class="blob-preview--line-number-list"> {{- range .LineNumbers -}} <li> <a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> <a id="L{{ . }}" class="blob-preview--line-number" href="#L{{ . }}">{{ . }}</a> </li> {{- end -}} </ol>
-