about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorCase Duckworth2024-06-18 12:42:48 -0500
committerCase Duckworth2024-06-18 12:42:48 -0500
commitc30f5e0472f2463f475e6e4d4cf80341ab1e0e62 (patch)
tree5f74b174140c7ca9556d597c72166040fc2c0203 /lib
parentImplement verbatim piping (diff)
downloadjimmy-c30f5e0472f2463f475e6e4d4cf80341ab1e0e62.tar.gz
jimmy-c30f5e0472f2463f475e6e4d4cf80341ab1e0e62.zip
Fix verbatim processing fully
No more special-casing on the surface of the code; that is, the filter expects a list of strings and outputs a single string, etc.
Diffstat (limited to 'lib')
-rw-r--r--lib/emit.scm9
-rw-r--r--lib/html.scm4
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/emit.scm b/lib/emit.scm index 68912cf..6c0479c 100644 --- a/lib/emit.scm +++ b/lib/emit.scm
@@ -84,7 +84,7 @@
84 (printf (get-format 'verb 'stanza) 84 (printf (get-format 'verb 'stanza)
85 ((get-filter 'verb 'stanza) t))) 85 ((get-filter 'verb 'stanza) t)))
86 (let ((el (car stanza)) 86 (let ((el (car stanza))
87 (text (string-join (apply append (cdr stanza)) "\n"))) 87 (text (apply append (cdr stanza))))
88 (with-output-to-string 88 (with-output-to-string
89 (lambda () 89 (lambda ()
90 (cond 90 (cond
@@ -98,12 +98,13 @@
98 (process command (cdr cmdline) 98 (process command (cdr cmdline)
99 (cons `("JIMMY_OUTPUT" . ,(->string (output-type))) 99 (cons `("JIMMY_OUTPUT" . ,(->string (output-type)))
100 (get-environment-variables))) 100 (get-environment-variables)))
101 (display (ensure-newline text) out) 101 (display ((o ensure-newline (cut string-join <> "\n")) text)
102 out)
102 (close-output-port out) 103 (close-output-port out)
103 (display (read-string #f in)) 104 (display (read-string #f in))
104 (newline)) 105 (newline))
105 (emit-verbatim t)))) 106 (emit-verbatim text))))
106 (else (emit-verbatim t))))))) 107 (else (emit-verbatim text)))))))
107 108
108;;; Utilities 109;;; Utilities
109 110
diff --git a/lib/html.scm b/lib/html.scm index 6c16dd0..6780aea 100644 --- a/lib/html.scm +++ b/lib/html.scm
@@ -48,7 +48,9 @@
48 (stanza . "<h3>~a</h3>~%")))) 48 (stanza . "<h3>~a</h3>~%"))))
49 49
50(set-filters! 50(set-filters!
51 `((verb (stanza . ,(o ensure-newline (cut string-join <> "\n")))) 51 `((verb (stanza . ,(o ensure-newline
52 escape-entities
53 (cut string-join <> "\n"))))
52 (link (line . ,(lambda (ln) 54 (link (line . ,(lambda (ln)
53 (cons (car ln) 55 (cons (car ln)
54 ((o list 56 ((o list