Nip the online HAML editor
February 9th 2011 byEdit
Nip has been removed due to obvious security flaws. The code will be made available for anyone who wants to use it internally, but I wouldn't suggest it making it public.
Why?...
HAML is a great markup language. Unfortunately, very few blog engines will allow you to use it. HTML, on the other hand, is long and painful to write. When I started this blog I didn't want to have to use the WYSIWYG tool or write plain HTML.
This is why I wrote Nip. You can input HAML code and output either a rendered page or the plain HTML so that you can copy and paste it in your page or your editor.
What it can do
- HTML to HAML conversion
- HAML to rendered
- HAML to raw HTML
- Real-time updating
- Progress auto-save via localStorage
How I did it
Ruby. Sinatra application. Prototype and LivePipe for JavaScript libraries. I believe all these are the right tools for the work. This is all it takes to convert your HAML to HTML.
# params[:html_code] is the HAML passed from the client
rendered = haml(params[:haml_code])
html = params[:raw_html] == 'true' ?
"<pre>#{CGI.escapeHTML(rendered)}</pre>" : rendered
And this will convert the HTML to HAML (for easier importing).
haml = Haml::HTML.new(params[:html_code], :xhtml => true).render
Check it out here
Removed for security reasons