Switch things over to using scrubl
[mudsync.git] / mudsync / scrubl.scm
index 1d82338e6d9999672fb1fa078438ce424ea009e2..a3daa26b882bf258353ebb7696ca8e59d1cd199d 100644 (file)
@@ -16,7 +16,7 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with Mudsync.  If not, see <http://www.gnu.org/licenses/>.
 
-;;; SCRUBL: S-exps Craftily/Crappily Representing the Underlying Basic Language
+;;; SCRUBL: S-exps Craftily/Crappily Rendering Underlying Basic Language
 ;;; a micro-"skribe-like" system (kinda ugly tho)
 ;;; Turns quasiquoted structures into something rendered.
 ;;;
   #: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))
-                 (bold . ,(scrubl-sxml-simple-field 'b))
-                 (it . ,(scrubl-sxml-simple-field 'it))
-                 (emph . ,(scrubl-sxml-simple-field 'it)))
+                 (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))