Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,20 @@ description of what scroll ships today.
- **Minimum Go: 1.25.9.** Bumped from 1.25.3 to pick up
stdlib security fixes flagged by govulncheck (crypto/x509,
crypto/tls, net/url, os).
- Makefile targets: `build`, `test`, `release`, `clean`.
`make release` cross-compiles linux + darwin (amd64 + arm64).
- Makefile targets: `build`, `test`, `release`, `licenses`,
`clean`. `make release` cross-compiles linux + darwin
(amd64 + arm64). `make licenses` walks `go list -deps` and
copies each dependency's LICENSE / COPYING file into
`third_party/`.
- GitHub Actions workflow `ci.yml`: `go vet`, `staticcheck`,
`govulncheck`, `go test -race`, `go build` on every PR and
push to `main`.
- GitHub Actions workflow `release.yml`: tag-triggered
cross-platform build, archives each binary as
`scroll-<tag>-<os>-<arch>.tar.gz` with `LICENSE` and
`README.md`, generates `checksums.txt`, attaches everything
to the GitHub release.
`scroll-<tag>-<os>-<arch>.tar.gz` containing the binary,
`LICENSE`, `README.md`, and the `third_party/` tree of
dependency notices. Generates `checksums.txt`, attaches
everything to the GitHub release.
- Dependabot enabled (monthly) for both `gomod` and
`github-actions`.

Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Optional but recommended:

- `staticcheck` — `go install honnef.co/go/tools/cmd/staticcheck@latest`
- `govulncheck` — `go install golang.org/x/vuln/cmd/govulncheck@latest`
- `go-licenses` — `go install github.com/google/go-licenses@latest`
- `termaid` — for testing mermaid rendering:
`go install github.com/fasouto/termaid@latest`

Expand Down
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,31 @@ release:
GOOS=darwin GOARCH=amd64 go build -o bin/scroll-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o bin/scroll-darwin-arm64 .

# licenses regenerates ./third_party/ — one LICENSE file per module
# scroll's main binary actually links against. Bundled into every
# release archive by .github/workflows/release.yml. Run locally
# whenever go.mod changes if you want to inspect the output.
# licenses regenerates ./third_party/ — one LICENSE file per
# module scroll's main binary actually links against. Bundled
# into every release archive by .github/workflows/release.yml.
# Run locally whenever go.mod changes if you want to inspect.
#
# Implemented as a shell loop over `go list -deps` rather than
# google/go-licenses because go-licenses currently fails on
# Go 1.25 stdlib introspection (upstream issue #128).
licenses:
go install github.com/google/go-licenses@latest
go-licenses save . --save_path=./third_party --force --ignore github.com/rynobey/scroll
@rm -rf third_party && mkdir -p third_party
@go list -deps -f '{{if .Module}}{{.Module.Path}}|{{.Module.Dir}}{{end}}' . \
| sort -u \
| grep -v '^github.com/rynobey/scroll|' \
| while IFS='|' read -r modpath moddir; do \
[ -z "$$modpath" ] && continue; \
lic=$$(ls "$$moddir"/LICENSE "$$moddir"/LICENSE.txt "$$moddir"/LICENSE.md "$$moddir"/COPYING "$$moddir"/COPYING.txt "$$moddir"/COPYING.md 2>/dev/null | head -1); \
if [ -z "$$lic" ]; then \
echo "WARN: no license file found for $$modpath" >&2; \
continue; \
fi; \
mkdir -p "third_party/$$modpath"; \
cp "$$lic" "third_party/$$modpath/$$(basename $$lic)"; \
done
@count=$$(find third_party -mindepth 2 -type f | wc -l); \
echo "wrote $$count license files to third_party/"

clean:
rm -f scroll
Expand Down
25 changes: 0 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ things that workflow needs:
- **Live reload, per-file scroll-position memory, TOML themes**
with a template DSL for custom decoration.

See the [comparison table](#how-does-it-compare) below for how
this lines up against `glow` and `mdcat`.

<!-- TODO: screenshot at docs/screenshots/multi-column.png. -->

## Install
Expand Down Expand Up @@ -102,28 +99,6 @@ Common keybindings (full list under `?` in the viewer):
| `?` | help overlay |
| `q` | quit |

## How does it compare?

| | scroll | [glow][glow] | [mdcat][mdcat] |
|---------------------------------|:--:|:--:|:--:|
| Static render to stdout | ✓ | ✓ | ✓ |
| Interactive viewer | ✓ | ✓ | |
| Multi-column reading layout | ✓ | | |
| Live reload | ✓ | | |
| Within-doc search | ✓ | ✓ | |
| Heading-tree folding | ✓ | | |
| Link nav with back/forward | ✓ | | |
| GFM tables (per-cell wrap) | ✓ | | ✓ |
| Image impressions on any terminal (block-glyph approximation) | ✓ | | |
| Pixel-accurate inline images (Kitty / iTerm protocol) | (experimental, Kitty only) | | ✓ |
| Mermaid → terminal art | ✓ (termaid) | | |
| Syntax-highlighted code blocks | ✓ | ✓ | ✓ |
| Configurable themes (TOML) | ✓ | ✓ | |
| Scroll-position memory per file | ✓ | | |

[glow]: https://github.com/charmbracelet/glow
[mdcat]: https://github.com/swsnr/mdcat

## Configuration

Put a TOML config at `~/.config/scroll/config.toml` (or pass
Expand Down
12 changes: 5 additions & 7 deletions cmd/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ func (m model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
}

// Extra quit keys (comma-separated list) declared via
// SCROLL_QUIT_KEYS. Lets the parent process map arbitrary keys
// to "close scroll" — used by sesh-cheatsheet to make alt+h
// toggle the cheatsheet.
// SCROLL_QUIT_KEYS. Lets a host CLI map arbitrary keys to
// "close scroll" — useful when scroll is launched as a popup
// from an outer app and the popup wants its own dismiss key.
if extra := os.Getenv("SCROLL_QUIT_KEYS"); extra != "" {
for _, qk := range strings.Split(extra, ",") {
if strings.TrimSpace(qk) == key {
Expand Down Expand Up @@ -1945,8 +1945,7 @@ func (m model) renderSearchPrompt() string {
// rendered by scroll itself (dogfooding) via renderHelp.
// helpMarkdownWide is the 4-column layout shown on wide terminals
// (≥ 160 cols). Halves the vertical extent of each section by
// pairing rows side-by-side, matching the sesh cheatsheet's wide
// variant.
// pairing rows side-by-side.
const helpMarkdownWide = "# scroll — keybindings\n" +
"\n" +
"## Scrolling\n" +
Expand Down Expand Up @@ -2128,8 +2127,7 @@ func (m model) renderHelp() string {
helpTheme.H1.Align = "center"
helpTheme.H2.Align = "center"
// Always render in a single document-column; the wide variant
// uses 4-column tables to spread keys side-by-side, matching
// the sesh cheatsheet layout.
// uses 4-column tables to spread keys side-by-side.
helpTheme.Columns = 1
src := helpMarkdown
if m.width >= 160 {
Expand Down
11 changes: 6 additions & 5 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ broken state.
- [ ] `go test -race -count=1 ./...` passes.
- [ ] `make release` succeeds locally — proves all four
cross-targets actually compile from the current tree.
- [ ] `make licenses` succeeds locally — proves go-licenses can
still resolve every module's license file. (Run separately
from `make release` so the failure mode is obvious if a
newly-added dep ships without a recognised license.)
- [ ] `make licenses` succeeds locally — proves every module
ships a discoverable LICENSE / COPYING file in its module
cache directory. Run separately from `make release` so
the failure mode (`WARN: no license file found for X`)
is obvious if a newly-added dep ships without one.

### Smoke tests

Expand Down Expand Up @@ -96,7 +97,7 @@ The convention is documented in
- [ ] `git push origin vX.Y.Z`.
- [ ] Watch the `release.yml` workflow on the
[Actions tab](https://github.com/rynobey/scroll/actions/workflows/release.yml).
It should: generate `third_party/` via `go-licenses`,
It should: generate `third_party/` via `make licenses`,
cross-compile four binaries, package each as
`scroll-vX.Y.Z-<os>-<arch>.tar.gz` (containing the
binary, `LICENSE`, `README.md`, and the `third_party/`
Expand Down
4 changes: 1 addition & 3 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Concrete steps to take the repo from "imported" to
markers point at `docs/screenshots/{hero,multi-column,fineblocks-photo}.png`.
Capture and drop them in (the docs/screenshots/README.md
has capture suggestions).
- **Clean `testdata/`.** Current footprint ~600K; audit for
fixtures that aren't load-bearing for any test and remove.
- **GoReleaser (optional).** The current `release.yml` is a
hand-rolled cross-compile + archive flow that works for
linux/darwin amd64+arm64. If we want windows builds, signed
Expand All @@ -40,7 +38,7 @@ Concrete steps to take the repo from "imported" to
(indirect dep via bubbletea) declares MIT in its `README.md`
but ships no committed `LICENSE` file. Currently a non-issue
for scroll because the package only compiles on Windows and
we don't ship Windows builds — `go-licenses` skips it. If
we don't ship Windows builds — `make licenses` skips it. If
Windows ever becomes a release target, we'd hit it; worth
filing an upstream PR adding a `LICENSE` file as defensive
hygiene either way.
Expand Down
8 changes: 4 additions & 4 deletions examples/nvim-preview.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Scroll theme used when the nvim `<leader>mp` floating terminal
# Scroll theme used when the nvim plugin's floating terminal
# launches scroll. Overrides only the status-bar colour so the
# preview reads as a distinct sesh-branded overlay — everything
# else inherits scroll's defaults.
# preview reads as a distinct overlay against the surrounding
# editor — everything else inherits scroll's defaults.

[status_bar]
color = "0" # black text
background = "215" # orange bg (sesh accent, matches popup border)
background = "215" # orange bg (matches the float's border)
8 changes: 3 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// scroll — a terminal markdown viewer. This binary is being built
// incrementally alongside sesh; long-term it will live in its own repo.
// scroll — a terminal markdown viewer.
//
// Current capabilities: static render (--static) of a markdown file.
// Interactive viewer, tables, navigation, config loading, and theming
// land in subsequent tranches.
// CLI entrypoint. The actual rendering and viewer logic live under
// internal/render and cmd/. See docs/design.md for architecture.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion testdata/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spaces or a backslash still wrap correctly.

Links come in several flavours: a [relative markdown file](sample2.md),
an [absolute URL](https://example.com), an [in-doc anchor](#tables),
an autolink <https://github.com/rynobey/sesh>, and an email autolink
an autolink <https://github.com/rynobey/scroll>, and an email autolink
<ryno@example.com>.

Images render as inline placeholders — ![diagram](./assets/flow.png)
Expand Down
5 changes: 2 additions & 3 deletions testdata/image-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ If you're inside tmux, you also need
set -g allow-passthrough on
```

in `~/.config/tmux/tmux.conf` (or wherever your sesh tmux config
lives). Without it tmux silently swallows the escape and the image
area shows as a blank gap.
in `~/.config/tmux/tmux.conf`. Without it tmux silently
swallows the escape and the image area shows as a blank gap.

## 1. Wide landscape (800×200)

Expand Down
Loading