Commit a553fb85 authored by Marco Baringer's avatar Marco Baringer

*** empty log message ***

parent 3f80c4e8
;;;; -*- lisp -*-
(defpackage :it.bese.yaclml.system
(:use :common-lisp
:asdf))
(in-package :it.bese.yaclml.system)
(defsystem :it.bese.yaclml
:version "0.3.1"
:components ((:static-file "it.bese.yaclml.asd")
(:module :src
:components ((:file "packages")
(:file "asdf" :depends-on ("yaclml"))
(:file "yaclml" :depends-on ("packages"))
(:file "html" :depends-on ("yaclml"))
(:file "tags" :depends-on ("yaclml")))))
:depends-on (:it.bese.arnesi)
:description
"Yet Another Common Lisp Markup Language"
:licence "
Copyright (c) 2002-2003, Edward Marco Baringer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Edward Marco Baringer, nor BESE, nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
")
;;;; -*- lisp -*-
;;;; $Id: packages.lisp,v 1.1 2003/08/17 14:15:04 mbaringer Exp $
;;;; $Id: packages.lisp,v 1.2 2003/08/17 15:51:31 mbaringer Exp $
;;;;
;;;; Copyright (c) 2002-2003, Edward Marco Baringer
;;;; All rights reserved.
......@@ -35,9 +35,14 @@
(defpackage :it.bese.yaclml
(:use :common-lisp :it.bese.arnesi)
(:export #:process-yaclml-file
(:export #:deftag
#:within-tag
#:defsimple-xtag
#:process-yaclml-file
#:*yaclml-stream*
#:yaclml-to-file))
#:yaclml-to-file
#:enable-yaclml-syntax
#:disable-yaclml-syntax))
(defpackage :it.bese.yaclml.tags
(:nicknames :<)
......@@ -182,3 +187,9 @@
#:define-condition
#:defmethod
#:defgeneric))
(defpackage :it.bese.yaclml.doc
(:use :common-lisp :it.bese.yaclml)
(:import-from :it.bese.yaclml.tags
#:p #:page #:i #:b #:href))
\ No newline at end of file
;;;; -*- lisp -*-
;;;; $Id: tags.lisp,v 1.7 2003/08/16 15:39:00 mb Exp $
;;;; $Id: tags.lisp,v 1.1 2003/08/17 15:52:00 mbaringer Exp $
;;;;
;;;; Copyright (c) 2002-2003, Edward Marco Baringer
;;;; All rights reserved.
......@@ -33,6 +33,12 @@
(in-package :it.bese.yaclml)
(deftag <:prin (thing)
(yaclml-collect `(princ (escape-as-html (princ-to-string ,data)) *yaclml-stream*)))
(deftag <:prin-raw (thing)
(yaclml-collect `(princ ,thing *yaclml-stream*)))
;;;_* HTML utility tags
;;;_ : General Markup stuff
......@@ -62,42 +68,3 @@
(deftag <:checkbox (&attribute name value &body body)
(within-tag ("input" "type" "checkbox" "name" name "value" value)
(yaclml-do-body body)))
;;;; these aren't really generic, but for what yaclml gets used for me
;;;; put them here.
(defmacro <:page (&rest body)
(multiple-value-bind (attributes real-body)
(collect-attributes body)
`(<:html
(<:head
(<:title ,(getf attributes :title))
,@ (let ((css (getf attributes :stylesheet)))
(if (consp css)
`((<:link :href ,(second (car css))
:title ,(first (pop css))
:rel "stylsheet"
:type "text/css")
,@(mapcar (lambda (sheet)
`(<:link :href ,(second sheet)
:title ,(first sheet)
:rel "alternate stylesheet"
:type "text/css"))
css))
(if (null css)
`((<:stylesheet))
`((<:stylesheet ,css))))))
(<:body
(<:div :class "heading"
(<:div :class "title" ,(getf attributes :title))
,@(when (getf attributes :sub-title)
`((<:div :class "sub-title" ,(getf attributes :sub-title)))))
(<:div :class "content"
,@real-body)))))
(deftag <:section (title &attribute subtitle &body body)
(within-tag ("div" "class" "section")
:body (within-tag
`(<:div :class "section"
(<:div :class "title" ,title)
,@body))
;;;; -*- lisp -*-
;;;; $Id: yaclml.lisp,v 1.1 2003/08/17 14:15:04 mbaringer Exp $
;;;; $Id: yaclml.lisp,v 1.2 2003/08/17 15:51:31 mbaringer Exp $
;;;;
;;;; Copyright (c) 2002-2003, Edward Marco Baringer
;;;; All rights reserved.
......@@ -227,12 +227,6 @@
`((locally ,@body))
body)))))
(deftag <:prin (thing)
(yaclml-collect `(princ (escape-as-html (princ-to-string ,data)) *yaclml-stream*)))
(deftag <:prin-raw (thing)
(yaclml-collect `(princ ,thing *yaclml-stream*)))
(defun |[ reader| (stream char)
(declare (ignore char))
(with-collector (forms)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment