small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
README.md

albedo-render #

albedo-render renders source ranges and compaction text as PNG pages and resizes image inputs. The view and snapcompact extensions call this executable.

  • src/main.rs defines albedo-render FILE --start N --end N --out DIR and options for columns, tabs, language, and page limits.
  • --snapcompact PATH and --snapcompact-dir PATH render dense text frames with the supplied advance, pitch, and width.
  • --fit EDGE IMAGE --out DIR resizes a PNG, JPEG, or WebP input to fit the requested edge limit.
  • Standard output reports image paths and dimensions. Code-range output also reports language and remaining lines. Errors go to standard error.

See compaction for frame use.

Code rendering #

The renderer colors the whole file before selecting a range, so a range that starts inside a comment or string keeps its syntax colors. The default width is 79 columns. Long lines wrap with an arrow. A source line that fits within --max-rows stays on one image. When every line fits, the renderer uses the fewest images possible and aims for an even row count across them. A line taller than the limit starts on a fresh image and continues across images.

Lines 86-104 of src/layout.rs, rendered; line 97 wraps

install.sh builds with Cargo and installs the binary in apps/albedo/priv/bin.