views:

1011

answers:

3

Does anyone know of a Javascript based HAML editor out there? I'm looking for for something like TinyMCE that just understands HAML (so it does indenting and highlighting correctly)

I'm thinking of using an editor like this for a dynamic website I'm building.

Clarification The site I am building allows the users to define layouts(in the rails sense) and css. So finer grain control than textile and markdown is required, I know I can include raw html in markdown but haml is so much prettier.

+2  A: 

I noticed this question hasn't been answered in a while. While this isn't a complete answer, you may want to look at MarkItUp. Its specifically not a WYSIWYG editor, but rather, an extensible and friendly markup editor. It doesn't support HAML directly, but its fairly easy to extend it to support different languages. It can also do AJAX round trips to the server so you can preview the markup using a server side renderer.

Soviut
markitup look super awesome, thanks for the link +1
Sam Saffron
+3  A: 

HAML was designed as a more elegant way to define page structure; It was not intended to be used for formatting text, like what you're asking it to do.

In this case, you're probably better off using something like Markdown or Textile. Both of these already have WYSIWYGs (for Markdown, for Textile (forked version)), and Haml's got built-in filters to convert it into HTML.

e.g.:

#content
  :markdown
    @post.body

(Haml's wonderful space-indentation will even be preserved on output!)

gabriel
+1  A: 

I have something pretty basic up and running for interpreting javascript HAML code. Alternatively, you can go direct to the jHaml javascript source.

Thunder3