gregwebs / hamlet.js

Javascript template language with DRY HTML
Other
36 stars 4 forks source link

spelling correction #1

Closed strathmeyer closed 12 years ago

gregwebs commented 12 years ago

This github spell checker lets me a complete dolt and let me not even use my own spellchecker :)

Let me know if you have any issue or concerns when trying out this library, I would be interested to know if you are using coffeescript or regular javascript, and what javascript technique you are using.

strathmeyer commented 12 years ago

Thanks, will do! I'm intrigued. :D Might be a good way to introduce haml-resistant people to significant-whitespace templates.

gregwebs commented 12 years ago

I think the valid resistance to HAML is that it abandons html syntax. The white space part is great. Designers that have used the Haskell version of Hamlet have really liked it.

On Fri, Oct 21, 2011 at 9:57 AM, Eric Strathmeyer < reply@reply.github.com>wrote:

Thanks, will do! I'm intrigued. :D Might be a good way to introduce haml-resistant people to significant-whitespace templates.

Reply to this email directly or view it on GitHub: https://github.com/gregwebs/hamlet.js/pull/1#issuecomment-2483616

strathmeyer commented 12 years ago

Good point. I think the use of % for tags in haml is a little weird, and in the end you're only saving one char over <...>. I'm a bigger fan of the Slim and Jade templates, but they can look really odd to someone who's not used to it.

Constructs like <.foo> and <button#submit-btn> are definitely awesome.

Might be fun to be able to do input:text or input:checkbox, mirroring the jQuery pseudo-selectors for form elements.

gregwebs commented 12 years ago

Actually, the '>' character is optional if there is no content on that line (still can be inner content indented). I just don't advertise it because some of those used to html don't find it aesthetically pleasing. So Haml doesn't save any chars :)

I like Slim better than HAML because it removed the %.

Those input shortcuts are good ideas. The Haskell version uses colons for conditional attributes as per below. It seem the 2 don't directly conflict, but I should be careful about overloading meaning. Let me know if you have thoughts on that.

<p :isRed:style="color:red">
<input type=checkbox :isChecked:checked>

isRed and isChecked are variables. http://www.yesodweb.com/book/templates

So overloaded would be

<input:checkbox :isChecked:checked>

On Fri, Oct 21, 2011 at 11:51 AM, Eric Strathmeyer < reply@reply.github.com>wrote:

Good point. I think the use of % for tags in haml is a little weird, and in the end you're only saving one char over <...>. I'm a bigger fan of the Slim and Jade templates, but they can look really odd to someone who's not used to it.

Constructs like <.foo> and <button#submit-btn> are definitely awesome.

Might be fun to be able to do input:text or input:checkbox, mirroring the jQuery pseudo-selectors for form elements.

Reply to this email directly or view it on GitHub: https://github.com/gregwebs/hamlet.js/pull/1#issuecomment-2484871

strathmeyer commented 12 years ago

Hah! Yeah, I agree with your decision to keep the sometimes-optional ">" a hidden feature.

I hadn't seen the part of the Hamlet docs that deals with conditional variables. Hrm... no, I don't think the overloading is worth the confusion. "type=" is just five characters, and it's very clear.

gregwebs commented 12 years ago

yeah, I think saving type= is not a huge win.

just to make sure I was being clear, hamlet.js does not yet support that conditional attribute syntax. There is already a Hamlet implementation in the Haskell programming language that is more featureful that I linked to. This conditional attribute feature is the only feature directly applicable to javascript that hamlet.js doesn't have yet, and I do plan to add it eventually. It could be implemented in hamlet.js with a different syntax although I do like the current colon syntax.

On Fri, Oct 21, 2011 at 12:49 PM, Eric Strathmeyer < reply@reply.github.com>wrote:

Hah! Yeah, I agree with your decision to keep the sometimes-optional ">" a hidden feature.

I hadn't seen the part of the Hamlet docs that deals with conditional variables. Hrm... no, I don't think the overloading is worth the confusion. "type=" is just five characters, and it's very clear.

Reply to this email directly or view it on GitHub: https://github.com/gregwebs/hamlet.js/pull/1#issuecomment-2485473

gregwebs commented 12 years ago

Since you mentioned Slim - I just implemented hamlet.rb on top of Slim: https://github.com/gregwebs/hamlet.rb

strathmeyer commented 12 years ago

badass! :D