Changeset main,3


Ignore:
Timestamp:
02/05/2008 07:03:19 PM (14 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tags
revision id:
dsowen@fugue88.ws-20080205190319-ua05iw3kwktv81m1
Message:
  • Added ASDF file.
  • Redirect output to *TAG-OUT*.
Location:
main
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/tags.lisp

    r2 r3  
    11(defpackage #:dso-tags
    2   (:use #:cl)
    3   (:export #:expand-tag #:render-tag #:render #:do-body))
     2  (:use #:cl #:cl-ppcre)
     3  (:export #:*tag-out* #:expand-tag #:render-tag #:do-body))
    44
    55(in-package #:dso-tags)
     
    77
    88
    9 (defvar *tag-out* nil)
     9(defvar *tag-out* t)
    1010
    1111
     
    3434    (etypecase item
    3535      (string
    36        (format t "~A" item))
     36       (format *tag-out* "~A" (regex-replace-all "([^ ])  ([^ ])" item "\\1&nbsp; \\2")))
    3737      (list
    3838       (multiple-value-bind (tag-name tag-body tag-attrs) (break-tag item)
     
    4646(defun render-empty-tag (tag body args)
    4747  (assert (null body))
    48   (format t "<~(~A~)~{ ~(~A~)='~A'~}/>" tag args))
     48  (format *tag-out* "<~(~A~)~{ ~(~A~)='~A'~}/>" tag args))
    4949
    5050(defun render-simple-tag (tag body args)
    5151  (if body
    5252      (progn
    53         (format t "<~(~A~)~{ ~(~A~)='~A'~}>" tag args)
     53        (format *tag-out* "<~(~A~)~{ ~(~A~)='~A'~}>" tag args)
    5454        (do-body body)
    55         (format t "</~(~A~)>" tag))
     55        (format *tag-out* "</~(~A~)>" tag))
    5656      (render-empty-tag tag body args)))
    5757
Note: See TracChangeset for help on using the changeset viewer.