html(attributes = {}) -> String
[permalink][rdoc]html(attributes = {}) { ... } -> String
トップレベルの html 要素を生成します。ブロックを与えると、ブロックを評価した結果が内容になります。
例:
html{ "string" } # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>string</HTML> html({ "LANG" => "ja" }){ "string" } # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML LANG="ja">string</HTML> html({ "DOCTYPE" => false }){ "string" } # <HTML>string</HTML> html({ "DOCTYPE" => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">' }){ "string" } # <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>string</HTML> html({ "PRETTY" => " " }){ "<BODY></BODY>" } # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> # <HTML> # <BODY> # </BODY> # </HTML> html({ "PRETTY" => "\t" }){ "<BODY></BODY>" } # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> # <HTML> # <BODY> # </BODY> # </HTML> html("PRETTY"){ "<BODY></BODY>" } # = html({ "PRETTY" => " " }){ "<BODY></BODY>" } html(if $VERBOSE then "PRETTY" end){ "HTML string" }