Switch things over to using scrubl
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 23 Jan 2017 21:41:56 +0000 (15:41 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 23 Jan 2017 21:41:56 +0000 (15:41 -0600)
mudsync/networking.scm
mudsync/room.scm
mudsync/scrubl.scm

index 228a89fd4377da5da2ec4ada75fddb4127402d4b..33ad424f3234c497f01e8de21bf0580bad128af0 100644 (file)
@@ -27,7 +27,7 @@
   #:use-module (oop goops)
 
   ;; Formatting
-  #:use-module (sxml simple)
+  #:use-module (mudsync scrubl)
 
   ;; used by web server only
   #:use-module (sxml simple)
 (define* (nm-send-to-client-id nm message #:key client data)
   "Send DATA to TO-CLIENT id"
   (define formatted-data
-    (call-with-output-string
-      (lambda (p)
-        (sxml->xml data p))))
+    (scrubl-write scrubl-sxml data))
   (define client-obj (hash-ref (nm-clients nm) client))
   (match client-obj
     (#f (throw 'no-such-client
index 6efac433f4c34b895c31a738511a53ac602ec3d7..8dc1d847fa6637d654eb4e729a62486382e9c00e 100644 (file)
   (define final-text
     (if occupant-names-string
         `(,@room-text
-          (p (i ,occupant-names-string)))
+          (p (em ,occupant-names-string)))
         room-text))
   
   (<- player-id 'tell
index 88438be8f14ff26c03d63ee95243250a59c09959..a3daa26b882bf258353ebb7696ca8e59d1cd199d 100644 (file)
   #:use-module (srfi srfi-9)
   #:use-module (sxml simple)
   #:use-module (oop goops)
+  #:use-module (ice-9 vlist)
+  #:use-module (ice-9 vlist)
+  #:use-module (ice-9 hash-table)
   #:export (make-scrubl
             scrubl? scrubl-extend-fields
+            scrubl-write
             scrubl-sxml scrubl-sxml-simple-field))
 
 (define (order-symlist-args symlist-args)
@@ -113,7 +117,10 @@ Pass in optional extra ARGS to the main META-WRITE"
 (define (scrubl-sxml-write scrubl obj)
   (call-with-output-string
     (lambda (p)
-      (sxml->xml (scrubl-write-obj scrubl obj) p))))
+      (sxml->xml
+       (scrubl-write-obj scrubl obj)
+       ;; (list 'pre (scrubl-write-obj scrubl obj))
+       p))))
 
 
 (define (scrubl-sxml-simple-field sym)
@@ -126,7 +133,12 @@ Pass in optional extra ARGS to the main META-WRITE"
 
 (define scrubl-sxml
   (make-scrubl `((p . ,(scrubl-sxml-simple-field 'p))
-                 (strong . ,(scrubl-sxml-simple-field 'strong)) ; usually bold
-                 (emph . ,(scrubl-sxml-simple-field 'em))
-                 (br . ,(scrubl-sxml-simple-field 'br))) ; usually italicized
+                 (strong . ,(scrubl-sxml-simple-field 'strong))
+                 (bold . ,(scrubl-sxml-simple-field 'strong))
+                 (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?
+                 (ul . ,(scrubl-sxml-simple-field 'ul))
+                 (li . ,(scrubl-sxml-simple-field 'li)))
                scrubl-sxml-write))