iens

Manager of links to read
git clone https://git.instinctive.eu/iens.git
Log | Files | Refs | README | LICENSE

commit 52e376569b495be234efc9a54b574450834cf406
parent 44078c34c8dbf0eae5ca106c2c9f46e69a169c33
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Sun, 12 Apr 2026 17:01:52 +0000

Initial gruik notes is wrapped around at 79 characters
Diffstat:
Msrc/cgi.scm | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/cgi.scm b/src/cgi.scm @@ -267,6 +267,24 @@ END-OF-CSS result default-value))) +(define (line->notes line max-width) + (let loop ((rest (string-split line " " #t)) + (lines '()) + (words "")) + (cond + ((null? rest) + (reverse-string-append (cons words lines))) + ((<= (+ (string-length words) 1 (string-length (car rest))) max-width) + (loop (cdr rest) + lines + (string-append words + (if (string=? words "") "" " ") + (car rest)))) + (else + (loop (cdr rest) + (cons (string-append words "\n") lines) + (car rest)))))) + (define (insert-line line offset) (let ((parsed (parse irc-line line)) (now (current-seconds))) @@ -275,7 +293,7 @@ END-OF-CSS (sql db "INSERT INTO gruik(position, notes, ptime, section, title, url, ctime, mtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?);") offset - line + (line->notes line 79) (car parsed) (list-ref parsed 2) (list-ref parsed 3)