1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

update readme

This commit is contained in:
Konstantin Haase 2011-05-09 08:36:48 +02:00
parent 5e22a22df6
commit 923e8080af
2 changed files with 21 additions and 11 deletions

View file

@ -23,27 +23,31 @@ installed with this gem.
Currently included: Currently included:
* `sinatra/capture`: Let's you capture the content of blocks in templates.
* `sinatra/config_file`: Allows loading configuration from yaml files. * `sinatra/config_file`: Allows loading configuration from yaml files.
* `sinatra/content_for`: Adds Rails-style `content_for` helpers to Haml, Erb, * `sinatra/content_for`: Adds Rails-style `content_for` helpers to Haml, Erb,
Erubis and Slim. Erubis and Slim.
* `sinatra/csrf`: Protects your Sinatra application from CSRF attacks.
* `sinatra/engine_tracking`: Adds methods like `haml?` that allow helper
methods to check whether they are called from within a template.
* `sinatra/json`: Adds a `#json` helper method to return JSON documents.
* `sinatra/link_header`: Helpers for generating `link` HTML tags and * `sinatra/link_header`: Helpers for generating `link` HTML tags and
corresponding `Link` HTTP headers. Adds `link`, `stylesheet` and `prefetch` corresponding `Link` HTTP headers. Adds `link`, `stylesheet` and `prefetch`
helper methods. helper methods.
* `sinatra/namespace`: Adds namespace support to Sinatra.
* `sinatra/respond_with`: Choose action and/or template depending automatically * `sinatra/respond_with`: Choose action and/or template depending automatically
depending on the incoming request. Adds helpers `respond_to` and depending on the incoming request. Adds helpers `respond_to` and
`respond_with`. `respond_with`.
To be included soon:
* Helpers for CSS/JS generation (currently in `sinatra-support`)
* Rewrite of `sinatra-reloader`
## Custom Extensions ## Custom Extensions
These extensions may add additional dependencies and enhance the behavior of the These extensions may add additional dependencies and enhance the behavior of the
@ -52,11 +56,9 @@ existing APIs.
Currently included: Currently included:
* `sinatra/decompile`: Recreates path patterns from Sinatra's internal data * `sinatra/decompile`: Recreates path patterns from Sinatra's internal data
structures (used by other extensions)/ structures (used by other extensions).
To be included soon: * `sinatra/reloader`: Automatically reloads Ruby files on code changes.
* Rewrite of `sinatra-compass`
## Other Tools ## Other Tools
@ -90,9 +92,13 @@ A single extension (example: sinatra-content-for):
require 'sinatra/base' require 'sinatra/base'
require 'sinatra/content_for' require 'sinatra/content_for'
require 'sinatra/csrf'
class MyApp < Sinatra::Base class MyApp < Sinatra::Base
register Sinatra::ContentFor # Note: Some modules are extensions, some helpers, see the specific
# documentation or the source
helpers Sinatra::ContentFor
register Sinatra::CSRF
end end
Common extensions: Common extensions:

View file

@ -23,3 +23,7 @@
* Extend `sinatra-content-for` to support Liquid, Radius, Markaby, Nokogiri and * Extend `sinatra-content-for` to support Liquid, Radius, Markaby, Nokogiri and
Builder. At least the first two probably involve patching Tilt. Builder. At least the first two probably involve patching Tilt.
* Rewrite of `sinatra-compass`?
* Helpers for HTML escaping and such.