tilde-site/generate/genuserdescs.scm
2025-11-18 11:51:54 -03:00

15 lines
831 B
Scheme
Executable file

#!/home/afiw/opt/bin/csi -s
(import (chicken file)
(chicken format)
(chicken io)
(chicken pathname))
(for-each print (find-files "/home"
#:limit 0
#:test (lambda (s) (not (string=? s "/home/!common")))
#:action (lambda (homedir acc)
(let* ((path (sprintf "~a/.config/tilde/description" homedir))
(username (pathname-file homedir))
(desc (if (file-exists? path) (apply string-append (with-input-from-file path read-lines)) "Description file not found")))
(cons (sprintf "<li><a href=\"~~~a/\">~~~a</a><p>~a</p></li>" username username desc) acc)))))