<commit_before>= Sinatra Support

==== A collection of useful utilities.

== Plugins

[{Sinatra::CssSupport}]       Provides CSS/Sass/Less support.
[{Sinatra::JsSupport}]        Provides JavaScript/CoffeeScript support.
[{Sinatra::Numeric}]          Helpers for showing percentages and currencies.
[{Sinatra::DateForms}]        Provides dropdowns for year/month/date.

== Helpers

[{Sinatra::CountryHelpers}]   Country dropdowns and stuff.
[{Sinatra::HtmlHelpers}]      Provides many common HTML helpers.
[{Sinatra::IfHelpers}]        Common HAML condition helpers.
[{Sinatra::OhmErrorHelpers}]  Allows you to present errors nicely
                              in HAML templates.

== How to use

Require the Sinatra support gem. For those using Bundler, that is:

  # Gemfile
  gem "sinatra_support", require: "sinatra/support"

Or otherwise:

  require 'sinatra/support'

In your Sinatra application, use +register+ or +helpers+ to add
in plugins as you need them.

  class Main < Sinatra::Base
    register Sinatra::Date
    helpers  Sinatra::HtmlHelpers
    helpers  Sinatra::CountryHelpers
  end

== Common examples

==== Provided by {Sinatra::HtmlHelpers}:

  <%= h "<Bar>" %>
  
==== Provided by {Sinatra::CountryHelpers}:

  <select name="country">
    <%= country_choices %>
  </select>

==== Provided by {Sinatra::DateForms}:

  <select name="birthday[month]">
    <%= month_choices %>
  </select>
  
  <select name="birthday[day]">
    <%= day_choices %>
  </select>

  <select name="birthday[year]">
    <%= year_choices %>
  </select>
  
==== Provided by {Sinatra::HtmlHelpers}:

  <select name="categories">
    <%= select_options [['First', 1], ['Second', 2]] %>
  </select>
  
==== Provided by {Sinatra::Numeric}:

  <%= currency(100) %>
  <!-- $100 -->

  <%= percentage(100) %>
  <!-- 100.00% -->

== Copyright

Copyright (c) 2010 <NAME>, <NAME> and Sinefunc, Inc.
See LICENSE for details.<commit_msg>Update docs.<commit_after>= Sinatra Support

==== A collection of useful utilities.

== Plugins

[{Sinatra::CssSupport}]       Provides CSS/Sass/Less support.
[{Sinatra::JsSupport}]        Provides JavaScript/CoffeeScript support.
[{Sinatra::Numeric}]          Helpers for showing percentages and currencies.
[{Sinatra::DateForms}]        Provides dropdowns for year/month/date.

== Helpers

[{Sinatra::CountryHelpers}]   Country dropdowns and stuff.
[{Sinatra::HtmlHelpers}]      Provides many common HTML helpers.
[{Sinatra::IfHelpers}]        Common HAML condition helpers.
[{Sinatra::OhmErrorHelpers}]  Allows you to present errors nicely
                              in HAML templates.

== How to use

Require the Sinatra support gem. For those using Bundler, that is:

  # Gemfile
  gem "sinatra_support", require: "sinatra/support"

Or otherwise:

  require 'sinatra/support'

In your Sinatra application, use +register+ or +helpers+ to add
in plugins as you need them.

  class Main < Sinatra::Base
    register Sinatra::DateForms
    helpers  Sinatra::HtmlHelpers
    helpers  Sinatra::CountryHelpers
  end

== Common examples

==== Provided by {Sinatra::CssSupport}:

Serve up dynamic stylesheets (Sass/Less) with ease. Dynamic JavaScript files
(CoffeeScript) are also available via {Sinatra::JsSupport}.

  register Sinatra::CssSupport
  serve_css '/css', from: './app/css'

  # curl "http://localhost:4567/css/print.css"   # reads app/css/print.sass 
                                                 # (or .less, .scss, .css)

==== Provided by {Sinatra::IfHelpers}:

Conditional helpers for HAML (+checked_if+, +hide_if+, etc):

   %input{checked_if(page.available?), type: 'checkbox'}
   %div#comments{hide_if(post.comments.empty?)}

==== Provided by {Sinatra::CountryHelpers}:

  <select name="country"><%= country_choices %></select>

==== Provided by {Sinatra::DateForms}:

  <select name="birthday[month]"><%= month_choices %></select>
  <select name="birthday[day]"><%= day_choices %></select>
  <select name="birthday[year]"><%= year_choices %></select>
  
==== Provided by {Sinatra::Numeric}:

  <%= currency(100) %><!-- $100 -->
  <%= percentage(100) %><!-- 100.00% -->

==== Provided by {Sinatra::HtmlHelpers}:

  <%= h "<Bar>" %>
  
  <select name="categories">
    <%= select_options [['First', 1], ['Second', 2]] %>
  </select>
  
== Copyright

Copyright (c) 2010 <NAME>, <NAME> and Sinefunc, Inc.
See LICENSE for details.
{'fraction_non_alphanumeric': 0.15159148156629265, 'fraction_numerical': 0.010075566750629723, 'mean_word_length': 3.7018299246501614, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7002158', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1342, 'n_words': 374}