okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

nekomimi.petview: review the diff first, and fix what a model found using it2e306d5

main
606 B14 linesraw

albedo-render

Turns part of a source file into pictures of the code, with syntax colors and line numbers, so the model can look at code the way a person does. albedo's view extension runs it when the model calls view_code or view_diff.

It colors the whole file, so a range that starts inside a comment or string still looks right. Long lines wrap at 79 columns with an arrow marking the wrap, and long ranges are split into several images.

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

Install it with ./install.sh (needs cargo), which puts the binary in priv/bin.

1# albedo-render
2
3Turns part of a source file into pictures of the code, with syntax colors and
4line numbers, so the model can look at code the way a person does. albedo's
5`view` extension runs it when the model calls `view_code` or `view_diff`.
6
7It colors the whole file, so a range that starts inside a comment or string
8still looks right. Long lines wrap at 79 columns with an arrow marking the
9wrap, and long ranges are split into several images.
10
11![Lines 86-104 of src/layout.rs, rendered; line 97 wraps](example.png)
12
13Install it with `./install.sh` (needs cargo), which puts the binary in
14`priv/bin`.