Re: [心得] HTML?New Template System ?

看板Ruby作者 (Test)時間18年前 (2006/09/18 14:07), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串2/3 (看更多)
※ 引述《giive (lala)》之銘言: : require 'markaby' : mab = Markaby::Builder.new : mab.html do : head { title "Boats.com" } : body do : h1 "Boats.com has great deals" : ul do : li "$49 for a canoe" : li "$39 for a raft" : li "$29 for a huge boot that floats and can fit 5 people" : end : end : end 其實這個和 Common Lisp 的 Uncommon Web 架構類似說 @_@ 如以下的 @_@ (defmethod render ((hello-world hello-world)) (<:as-is "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \ """ rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/transitional.dtd\">" #\Newline) (<:html (<:head (<:meta :http-equiv "Content-Type" :content "text/html; charset=utf-8;") (<:title (<:as-html "hi")) (<:link :rel "stylesheet" :href "sheet.css" :type "text/css") (<:link :rel "stylesheet" :href "sheet2.css" :type "text/css") (<:script ;; most browsers (firefox, safari and ie at least) really, ;; really, really don't like empty script tags. The "" forces ;; yaclml to generate a seperate closing tag. :type "text/javascript" :src "dojo.js" "") (<:script :type "text/javascript" (<:as-is (js:js* '(dojo.require "dojo.ev ent.*")))) (<:script :type "text/javascript" (<:as-is "var foo = 3;"))) (<:body (<:as-html "hello world")))) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.220.34.34

09/18 16:48, , 1F
看來會是LISP統治全世界  ̄▽ ̄
09/18 16:48, 1F

09/19 05:10, , 2F
Lisp 本身問題很多的, 不過一些概念還可以參考說 @_@
09/19 05:10, 2F
文章代碼(AID): #153ZUCWX (Ruby)
討論串 (同標題文章)
文章代碼(AID): #153ZUCWX (Ruby)