Created
October 10, 2010 16:50
-
-
Save fumokmm/619371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #g100pon No.84 creating HTML | |
import groovy.xml.MarkupBuilder | |
def writer = new FileWriter('g100pon.html') | |
def html = new MarkupBuilder(writer) | |
html.doubleQuotes = true // using " (not ') | |
html.html { | |
head { | |
title('「Groovyスクリプト100本斬り」') | |
style(type:'text/css') { | |
mkp.yieldUnescaped(''' | |
<!-- | |
body { | |
color : #000000; | |
background : #E6DED9; | |
font-size : 200%; | |
} | |
h1 { | |
text-align : center; | |
} | |
//--> | |
''') | |
} | |
} | |
body { | |
h1('「Groovyスクリプト100本斬り」') | |
div { | |
a(href: 'http://bit.ly/bJZ3fK', '企画書 (PDF)'); br() | |
a(href: 'https://spreadsheets.google.com/ccc?key=0Au1YHLJ4YZmbdEtGeUgxRTRxVGJpbHFXUGVFRndieVE&hl=ja&authkey=CLjYzYoF#gid=0', 'お題一覧 (Google Docsのスプレッドシート)'); br() | |
mkp.yield('ハッシュタグ') | |
a(href: 'http://twitter.com/#!/search/%23g100pon', '#g100pon') | |
} | |
hr() | |
div { | |
mkp.yield('No.84を解いた人:') | |
a(href: 'http://twitter.com/#!/fumokmm', '@fumokmm') | |
} | |
div { | |
mkp.yield('参考:') | |
a(href: 'http://d.hatena.ne.jp/fumokmm/20090131/1233428513', 'MarkupBuilderでHTML生成を試してみた') | |
} | |
} | |
} | |
writer.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment