Skip to content

Instantly share code, notes, and snippets.

@kkismd
Created February 26, 2016 09:35
Show Gist options
  • Save kkismd/494397046385f0ad18fd to your computer and use it in GitHub Desktop.
Save kkismd/494397046385f0ad18fd to your computer and use it in GitHub Desktop.
require 'cgi/util'
require 'cgi/html'
ch5 = CGI::HTML5.new
puts ch5.instance_eval {
html {
head {
title { "XML encoding with Ruby" }
} +
body {
h1 { "XML encoding with Ruby" } +
p { "this format can be used as an alternative markup to XML" } +
a(href: "https://www.ruby-lang.org/") { "Ruby" } +
p {
"This is some" +
b { "mixed" } +
"text. For more see the" +
a(href: "https://www.ruby-lang.org/") { "Ruby" } +
"project"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment