X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=mudsync%2Fscrubl.scm;h=de50108f72da4a41b576582e1bdad3bda5f74a3d;hb=055ce4c85ccf38385b80d1873927e059f7b58a20;hp=a3daa26b882bf258353ebb7696ca8e59d1cd199d;hpb=6f7c1d4f9a2043c16f83facef6b3216e45e14f40;p=mudsync.git diff --git a/mudsync/scrubl.scm b/mudsync/scrubl.scm index a3daa26..de50108 100644 --- a/mudsync/scrubl.scm +++ b/mudsync/scrubl.scm @@ -119,7 +119,6 @@ Pass in optional extra ARGS to the main META-WRITE" (lambda (p) (sxml->xml (scrubl-write-obj scrubl obj) - ;; (list 'pre (scrubl-write-obj scrubl obj)) p)))) @@ -131,6 +130,22 @@ Pass in optional extra ARGS to the main META-WRITE" (scrubl-write-obj scrubl arg)) args)))) +(define (scrubl-sxml-pre scrubl args) + `(span (@ (class "pre-ish")) + ,args)) + +;; @@: For a text-only interface, we could put links at end of rendered +;; text, similar to how orgmode does. +(define (scrubl-sxml-anchor scrubl args) + (define (maybe-uri->string obj) + (if (uri? obj) + (uri->string obj) + obj)) + (match args + (((= maybe-uri->string href) body1 body ...) + `(a (@ (href ,href)) + ,body1 ,@body)))) + (define scrubl-sxml (make-scrubl `((p . ,(scrubl-sxml-simple-field 'p)) (strong . ,(scrubl-sxml-simple-field 'strong)) @@ -138,7 +153,10 @@ Pass in optional extra ARGS to the main META-WRITE" (b . ,(scrubl-sxml-simple-field 'strong)) (em . ,(scrubl-sxml-simple-field 'em)) (i . ,(scrubl-sxml-simple-field 'em)) - (br . ,(scrubl-sxml-simple-field 'br)) ;; is this useful? + (br . ,(scrubl-sxml-simple-field 'br)) + (anchor . ,scrubl-sxml-anchor) + (a . ,scrubl-sxml-anchor) + (pre . ,scrubl-sxml-pre) ;; "pre" style whitespace handling. (ul . ,(scrubl-sxml-simple-field 'ul)) (li . ,(scrubl-sxml-simple-field 'li))) scrubl-sxml-write))