mengu on web programming.

How To Use Markdown With Grails

In order to learn how Grails works I wanted to create something with it and it should have been something that I don't regret and something useful and I can use so I have decided to develop a project management application with Grails. So far it's going good. Ofcourse open source! :) I needed to use markdown with Grails, there is a plugin for that but it requires Grails 1.2 which is unstable. And then I remembered that I could use Java libraries with Grails since it's based on Groovy.

I made some searches and found markdownj. There is only two things you need to do in order to use markdownj with your Grails project. Just download it and move the .jar to your app/lib directory.

After that you are good to go and use markdownj library with your Grails application as simple as the following codes:

com.petebevin.markdown.MarkdownProcessor m = new com.petebevin.markdown.MarkdownProcessor();
println m.markdown("I am using **markdown** with lovely [Grails](http://www.grails.org)")

And you get the result as:

<p>I am using <strong>markdown</strong> with lovely <a href="http://www.grails.org">Grails</a></p>

Enjoy! :)

Comments

No comments made for this post.

Leave a Response

No HTML allowed. You can use markdown.
Name*:
E-Mail* (not published):
Web site:
Response: