fix up blob page to allow sidescrolling
MODIFIED
appview/pages/pages.go
MODIFIED
appview/pages/pages.go
@@ -50,6 +50,9 @@ }return pairs, nil},"timeFmt": humanize.Time,+ "length": func(v []string) int {+ return len(v)+ },}}@@ -255,10 +258,12 @@type RepoBlobParams struct {LoggedInUser *auth.UserRepoInfo RepoInfo+ Active stringtypes.RepoBlobResponse}func (p *Pages) RepoBlob(w io.Writer, params RepoBlobParams) error {+ params.Active = "overview"return p.executeRepo("repo/blob", w, params)}
@@ -1,12 +1,9 @@{{ define "repoContent" }}- <table>- <tbody><tr>- <td class="line-numbers">- {{ range $i, $x := split .Contents }}- {{ add $i 1 }} {{ $x }} <br>- {{ end }}- </td>- <td class="file-content"></td>- </tbody></tr>- </table>-{{end}}+{{ $lines := split .Contents }}+{{ $tot_lines := len $lines }}+{{ $tot_chars := len (printf "%d" $tot_lines) }}+{{ $code_number_style := "code-line-num text-gray-400 mr-2 px-1 sticky left-0 bg-white border-r border-black text-right w-[{{$tot_chars}}rem]" }}+<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex">+ <span class="{{ $code_number_style }}">{{ add $idx 1 }}</span>+ <span class="whitespace-pre">{{ $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>+{{ end }}
MODIFIED
flake.nix
MODIFIED
flake.nix
@@ -54,27 +54,19 @@ cp -f ${htmx-src} appview/pages/static/htmx.min.js${pkgs.tailwindcss}/bin/tailwindcss -i input.css -o appview/pages/static/tw.css'';subPackages = ["cmd/appview"];- vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";+ vendorHash = "sha256-t7lWrCyFWCI7zjUcC6XNWzCrUPSCFnFu9gTmRTsYrz0=";env.CGO_ENABLED = 1;stdenv = pkgsStatic.stdenv;};-- knotserver = with final;+ knotserver = with final;final.pkgsStatic.buildGoModule {- pname = "knotserver";- version = "0.1.0";- src = gitignoreSource ./.;- subPackages = ["cmd/knotserver"];- vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";- env.CGO_ENABLED = 1;- nativeBuildInputs = with pkgsMusl; [ pkg-config ];-- # Add these ldflags for static compilation- ldflags = [ "-s" "-w" "-linkmode external" ''-extldflags "-static -L${pkgsStatic.musl}/lib"'' ];-- # Use static stdenv- stdenv = pkgMusl.stdenv;- };+ pname = "knotserver";+ version = "0.1.0";+ src = gitignoreSource ./.;+ subPackages = ["cmd/knotserver"];+ vendorHash = "sha256-t7lWrCyFWCI7zjUcC6XNWzCrUPSCFnFu9gTmRTsYrz0=";+ env.CGO_ENABLED = 1;+ };};packages = forAllSystems (system: {inherit (nixpkgsFor."${system}") indigo-lexgen appview knotserver;
MODIFIED
go.mod
MODIFIED
go.mod
@@ -10,6 +10,7 @@ github.com/bluekeyes/go-gitdiff v0.8.0github.com/bluesky-social/indigo v0.0.0-20250123072624-9e3b84fdbb20github.com/bluesky-social/jetstream v0.0.0-20241210005130-ea96859b93d1github.com/casbin/casbin/v2 v2.103.0+ github.com/dustin/go-humanize v1.0.1github.com/gliderlabs/ssh v0.3.5github.com/go-chi/chi/v5 v5.2.0github.com/go-git/go-git/v5 v5.12.0@@ -37,7 +38,6 @@ github.com/cespare/xxhash/v2 v2.3.0 // indirectgithub.com/cloudflare/circl v1.4.0 // indirectgithub.com/cyphar/filepath-securejoin v0.3.3 // indirectgithub.com/davecgh/go-spew v1.1.1 // indirect- github.com/dustin/go-humanize v1.0.1 // indirectgithub.com/emirpasic/gods v1.18.1 // indirectgithub.com/felixge/httpsnoop v1.0.4 // indirectgithub.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect