Welcome to the CHICKEN Scheme pasting service

sxml-transforms added by andyjpb on Tue May 22 19:26:05 2012

;
(define (knodium-page-template content #!key title)
; `((literal "<!DOCTYPE html>")
;	 (html (head (title ,(if title title "bonkers"))) (body ,content))))
(read-file "templates/_mainlayout.sxml"))

(define (knodium-sxml->html sxml)
  (let* ((knodium-rules `(
		  ;(knodium-header *preorder* . ,(lambda (t b) (pre-post-order* (read-file "templates/shared/_header.sxml") universal-conversion-rules*)))
		  ;(knodium-header *preorder* . ,(lambda (t b) (read-file "templates/shared/_header.sxml") ))
		  (*text* . ,(lambda (tag str) str))
		  (*default* . ,(lambda x x))
		  ))
	 (rules `(
		  (literal *preorder* . ,(lambda (t b) b))
		  (*DECL* *preorder* . ,(lambda (t b) (conc "<!" (apply conc (intersperse (car b) " ")) " " ">")))
		  (*COMMENT* *preorder* . ,(lambda (t b) (conc "<!-- " (apply conc b) " -->")))
		  . ,universal-conversion-rules*
		  )))
    (SRV:send-reply (pre-post-order* (pre-post-order* sxml knodium-rules) rules))
    (pp
     ;(pre-post-order*
     (pre-post-order* sxml knodium-rules)
     ;(append rules universal-conversion-rules*))
     ;rules)
     )
    ))

(knodium-sxml->html (knodium-page-template "The Content!"))



--- 

templates/_mainlayout.sxml
--------------------------
(literal "<!DOCTYPE html>") 
 (html 
(head 
     (meta (@ (charset utf-8))) 
     (title Knodium) 
     (link (@ (href /stylesheets/knodium.css) (media "screen, projection") (rel stylesheet) (type text/css))) 

     (script (@ (src /scripts/jquery.min.js) (type text/javascript))) 
     (script (@ (src /scripts/jquery-ui.min.js) (type text/javascript))) 
     (script (@ (src https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML) (type text/java
script))) 

...



$ csi -s sxml-fiddle.scm  |head
<!DOCTYPE html>
<html>
<head>
<meta>@ charset=" utf-8"</meta>
<title>
<Knodium></Knodium></title>
<link>@ href=" /stylesheets/knodium.css" media="screen, projection" rel=" stylesheet" type=" text/css"</link>
<script>@ src=" /scripts/jquery.min.js" type=" text/javascript"</script>
<script>@ src=" /scripts/jquery-ui.min.js" type=" text/javascript"</script>
<script>@ src=" https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type=" text/javascript"</script>

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
`call/cc' is a short name for which procedure?
Visually impaired? Let me spell it for you (wav file) download WAV