formic

formic seperate the sematic UI from the markup. It allows you to write code likes:

=form.create @dog, :id => 'my_dog' do
  =input.required 'name'
  =checkbox 'registered'
  =selection 'sex', :options => {'Male' => 'm', 'Female' => 'f'}

or

(tab.html.haml)

=tab_panel.fancy
  =tab "Tab Title Number One" do
    %p Some fancy Content here, can be whatever free style

  =tab.fancy "Tab Title Number Two", :id => 'tab_id' do
    %p Some other fancy content

Since formic seperate the markup and the sematic, you will need to define the markup yourself. Formic ships with default markup for each element in views/formic/default/*, but it is pretty minimal and it expects users to extend the markup as they like.

For example. I would extend my input markup to have a auto-generated id or classes. I can also rewrite my checkbox markup to be something else which is bigger and looks totally different (think mobile)

formic is in early stage of development thus currently lacking some essential features. These are the features will be implemented soon.

  • Template per class. If the element have a special class and the markup for that class exits then use that markup.

For example list.sortable might use markup views/formic/list/sortable.html.haml if it exists.

  • dynamic changing of style, like dynamically point formic to the new template directory like /views/formic/mobile/*

  • extra elements like tables, radios, range selection etc

  • Nested input. something like field_for

Contributing to formic

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2010 Vinh Tran. See LICENSE.txt for further details.