I have a text area in one of my scaffolds that is inserted into a div
element on one of my rails pages.
Right now I can white HTML in the text area and have it show with the
respective formatting when I view my page. However, I don't want to
use HTML, I want to use some markup language. Some that I've heard of
are texitle and markdown.
Does anybody have any suggestions on which one to use?
Then, how do I serialize the markup language to HTML when the page
renders?
It would be cool if the text area had sometime of menu bar for
formatting that inserted the appropriate markup language for the user.
I just want a quick implementation of this and I don't want to use a
full CMS.
So far, in my scaffold, If I just write my page with the textile
syntax and save it, it will be rendered to HTML if I just run the
following command in my view:
<%= RedCloth.new(@press_release.body).to_html %>
So, that's pretty cool, now I just need a WYSIWYG type control to
write the textile for me.
I use Textile quite a bit and it works great - it's the RedCloth
implementation. I believe that's the one also used in Radiant (though
I'm not 100% sure).
I prefer Markdown since the markup doesn’t interfere much with the readability as text.
Others use Textile to get more control over the styling.
However Maruku is a fairly new implementation of Markdown for Ruby and it also
implements Markdown+extra and Markdown+meta which gives you the
benefits of markdown syntax with the ability to specify additional
styling and attributes where necessary. To me, this is the best of both
worlds (readability + plus additional style where needed). So I’d suggest taking a look at Maruku.