RubyFlow The Ruby and Rails community linklog

W2TAGS 0.9.3 is HAML for ERB

Develop your RAILS / SINATRA using HAML-like-command, at Production-Server run on ERB. W2Tags is the way to tags, a short cut / macros. When it do, it use some patern define in HOT file to produce tags from minimal code to become full fledge tags, Syntax mimics HAML to easy transisition, and proven to be use-able and best. just type “sudo gem install w2tags”. release-note.

Comments

I believe http://github.com/wharsojo/w2tags/tree/master to be a more relevant link.

Nope, I have difficulty updating github (on client behind firewall), and yes it suppose to be the edge on github. But for now, get it from rubyforge, its edge and stable… :)
“sudo gem install w2tags”, enjoy…

just wondering is this a replacement for HAML? what advantages does it have over HAML?

No, since HAML is a view engine and W2TAGS is a Parser which parse the HAML-like syntax to ERB, Benefit using W2TAGS are:

  1. Some repetitive code in HAML can be save to a HOT file (Patern): HAML like: ~~~~~~~~~~ %h1 New user = error_messages_for :user -form_for @user do |f| %p %b Name %br = f.text_field :name %p %b Email %br = f.text_field :email %p %b Last login %br = f.datetime_select :last_login %p = f.submit “Create” = link_to ‘Back’, users_path

You can see that it not DRY, some patern will go to HOT files “rails_basic.hot“ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  »input %p %b $0.capitalize.gsub(‘’,’ ‘)- %br = f.text_field :$0

_submit !/ %p = f.submit “$0”

and code in source: ~~~~~~~~~~~~~~~~~~~ !hot!rails_basic %h1 New user = error_messages_for :user -form_for @user do |f| -input name;email;last_login -submit Create = link_to ‘Back’, users_path

  1. NextTag (^) Ex: Last Command “%ul” and the NextTag will be “%li” combine with Var and Unique Var set and get ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @myvar=one;two;three @myvar=five;one;two %ul ^ @myvar!
  • one
  • two
  • three
  • five

too many if I List them all, you can see some of the benefit in Release note: http://rubyforge.org/frs/shownotes.php?group_id=6464&release_id=33258

and try it your self in irb: “w2tags -irb”

/wh

auch…, no pre :(

/wh

thanks for the explanation!

After reading the above, I still have no idea what this does. I realize the author’s native tongue is not English…can someone else sum it up?

Nice work. IMO, goodies in this lib should be added to HAML to improve reuse in HAML. Do you agree?

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in