@Grab('org.pegdown:pegdown:1.2.1')defprocessor=neworg.pegdown.PegDownProcessor()deforiginal=$/This is Top Header---This is second Header===### This is topic#### Lists Item${(1..3).collect {"+ item${it}"}.join('\n')}and${(1..3).collect {"1. item${it}"}.join('\n')}#### Links+ [mike-neck's site](http://mike-neck.github.io/)+ [mike-neck's dq site](http://mikeneckdq.blog.fc2.com/)+ ![groovy image](http://groovy.codehaus.org/images/groovy-logo-medium.png)#### Html Tags<img src='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00' style='width : 400px;'>#### Codesfunction `lists:reverse/1` returns a List.tag `<em>` means emphasis``groovydef string = 'This is groovy code.'``#### emphasis*em?***bold?**#### Blockquotes> This is a blockquotes> from here./$processor.markdownToHtml(original)
実行結果はこんな感じ。
1234567891011121314151617181920
<h2>This is Top Header</h2><h1>This is second Header</h1><h3>This is topic</h3><h4>Lists Item</h4><ul><li>item1</li><li>item2</li><li>item3</li></ul><p>and</p><ol><li>item1</li><li>item2</li><li>item3</li></ol><h4>Links</h4><ul><li><ahref="http://mike-neck.github.io/">mike-neck's site</a></li><li><ahref="http://mikeneckdq.blog.fc2.com/">mike-neck's dq site</a></li><li><imgsrc="http://groovy.codehaus.org/images/groovy-logo-medium.png"alt="groovy image"/></li></ul><h4>Html Tags</h4><p><imgsrc='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00'style='width : 400px;'></p><h4>Codes</h4><p>function <code>lists:reverse/1</code> returns a List.</p><p>tag <code><em></code> means emphasis</p><p><code>groovy
def string = 'This is groovy code.'</code></p><h4>emphasis</h4><p><em>em?</em></p><p><strong>bold?</strong></p><h4>Blockquotes</h4><blockquote><p>This is a blockquotes from here.</p></blockquote>