Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jeffscottbrown/a82dabc95f13cafa2581088b831d21a6 to your computer and use it in GitHub Desktop.

Select an option

Save jeffscottbrown/a82dabc95f13cafa2581088b831d21a6 to your computer and use it in GitHub Desktop.
~ $ cat htmlTest.groovy
import groovy.xml.MarkupBuilder
def writer = new StringWriter()
def markup = new MarkupBuilder(writer)
markup.html {
body {
div {
h1 "Test Page"
}
}
}
println writer
~ $
~ $ groovy htmlTest
<html>
<body>
<div>
<h1>Test Page</h1>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment