diff --git a/README.rdoc b/README.rdoc index 3ab2fc2..29e21c3 100644 --- a/README.rdoc +++ b/README.rdoc @@ -47,18 +47,64 @@ We will provide a gem based installation in the next release. In your application layout (typically somewhere below <%= javascript_include_tag(:defaults) %>) ... - <%= bespin_include_tag %> + + ... + <%= bespin_include_tag %> + ... -In your views (example form) +In your views (examples) <% form_tag ... do %> ... - <%= bespin_editor_tag :content, '
some html snippet
', :editor_style => 'height: 600px', :language => 'html' %> + <%= bespin_editor_tag 'snippet', '
some html snippet
' %> + ... + <% end %> + + <% form_for @code_snippet do |f| %> + ... + <%= bespin_editor_tag 'code_snippet[snippet]', '
some html snippet
' %> + ... <% end %> == Configuration -TODO +You may pass an optional hash of options as a third parameter to +bespin_editor_tag+ as follows: + +* :editor_style - CSS style attributes as a string for styling the editor. The editor + is just a
. + +Example: + + <% form_for @code_snippet do |f| %> + ... + <%= bespin_editor_tag 'code_snippet[snippet]', '
some html snippet
', :editor_style => 'height: 600px' %> + ... + <% end %> + +This will set the height of the editor to 600px. + +* :language - A string telling Bespin which syntax highlighter to use. This default to 'html'. + +Example: + + <% form_for @code_snippet do |f| %> + ... + <%= bespin_editor_tag 'code_snippet[snippet]', '
some html snippet
', :language => 'javascript' %> + ... + <% end %> + +This will set the syntax highlighter for JavaScript. Available highlighters are 'arduino', 'css', 'html', +'javascript', 'php'. + +* :settings - A hash of Bespin settings. + +Example: + + <% form_for @code_snippet do |f| %> + ... + <%= bespin_editor_tag 'code_snippet[snippet]', '
some html snippet
', :settings => {strictlines => 'on'} %> + ... + <% end %> Copyright (c) 2009 Provideal Systems GmbH, released under the MIT license