Permalink
Browse files

heading tags closes #5

  • Loading branch information...
1 parent 9da9dc0 commit 90aa3cf36da8dd7a2cb174a9ce7f46a8282544d8 @Arcath committed Apr 25, 2011
Showing with 36 additions and 32 deletions.
  1. +4 −4 README.rdoc
  2. +1 −1 lib/trainbbcode/application_helper.rb
  3. +26 −26 lib/trainbbcode/configure.rb
  4. +5 −1 lib/trainbbcode/tags.rb
View
@@ -10,15 +10,15 @@ Rails Gem for BBCode
For rails you will need to add:
- config.gem "trainbbcode"
+ gem "trainbbcode"
-to config/enviroments.rb and then install the gem using:
+to your Gemfile and then install the gem using:
- rake gems:install
+ bundle install
=== As a Plugin
- script/plugin install git://github.com/Arcath/TrainBBCode
+ rails plugin install git://github.com/Arcath/TrainBBCode
== Usage
@@ -4,4 +4,4 @@ def tbbc_css(config = nil)
bbc.conf(config) if config
bbc.css
end
-end
+end
@@ -20,31 +20,31 @@ def load_config_from_file
#
# Is non-overiding so any config set by the user in thier own file remains.
def load_config_from_defaults
- @config[:configed_by] ||= "user"
- @config[:image_alt] ||= "Posted Image"
- @config[:url_target] ||= "_BLANK"
- @config[:allow_defaults] ||= true
- @config[:table_width] ||= "100%"
- @config[:syntax_highlighting] ||= true
- @config[:syntax_highlighting_html] ||= "color:#E7BE69"
- @config[:syntax_highlighting_comment] ||= "color:#BC9358; font-style: italic;"
- @config[:syntax_highlighting_escaped] ||= "color:#509E4F"
- @config[:syntax_highlighting_class] ||= "color:#FFF"
- @config[:syntax_highlighting_constant] ||= "color:#FFF"
- @config[:syntax_highlighting_float] ||= "color:#A4C260"
- @config[:syntax_highlighting_function] ||= "color:#FFC56D"
- @config[:syntax_highlighting_global] ||= "color:#D0CFFE"
- @config[:syntax_highlighting_integer] ||= "color:#A4C260"
- @config[:syntax_highlighting_inline] ||= "background:#151515"
- @config[:syntax_highlighting_instance] ||= "color:#D0CFFE"
- @config[:syntax_highlighting_doctype] ||= "color:#E7BE69"
- @config[:syntax_highlighting_keyword] ||= "color:#CB7832"
- @config[:syntax_highlighting_regex] ||= "color:#A4C260"
- @config[:syntax_highlighting_string] ||= "color:#A4C260"
- @config[:syntax_highlighting_symbol] ||= "color:#6C9CBD"
- @config[:syntax_highlighting_html] ||= "color:#E7BE69"
- @config[:syntax_highlighting_boolean] ||= "color:#6C9CBD"
- @config[:syntax_highlighting_line_numbers]||= :inline
- @config[:swear_words] ||= []
+ @config[:configed_by] ||= "user"
+ @config[:image_alt] ||= "Posted Image"
+ @config[:url_target] ||= "_BLANK"
+ @config[:allow_defaults] ||= true
+ @config[:table_width] ||= "100%"
+ @config[:syntax_highlighting] ||= true
+ @config[:syntax_highlighting_html] ||= "color:#E7BE69"
+ @config[:syntax_highlighting_comment] ||= "color:#BC9358; font-style: italic;"
+ @config[:syntax_highlighting_escaped] ||= "color:#509E4F"
+ @config[:syntax_highlighting_class] ||= "color:#FFF"
+ @config[:syntax_highlighting_constant] ||= "color:#FFF"
+ @config[:syntax_highlighting_float] ||= "color:#A4C260"
+ @config[:syntax_highlighting_function] ||= "color:#FFC56D"
+ @config[:syntax_highlighting_global] ||= "color:#D0CFFE"
+ @config[:syntax_highlighting_integer] ||= "color:#A4C260"
+ @config[:syntax_highlighting_inline] ||= "background:#151515"
+ @config[:syntax_highlighting_instance] ||= "color:#D0CFFE"
+ @config[:syntax_highlighting_doctype] ||= "color:#E7BE69"
+ @config[:syntax_highlighting_keyword] ||= "color:#CB7832"
+ @config[:syntax_highlighting_regex] ||= "color:#A4C260"
+ @config[:syntax_highlighting_string] ||= "color:#A4C260"
+ @config[:syntax_highlighting_symbol] ||= "color:#6C9CBD"
+ @config[:syntax_highlighting_html] ||= "color:#E7BE69"
+ @config[:syntax_highlighting_boolean] ||= "color:#6C9CBD"
+ @config[:syntax_highlighting_line_numbers] ||= :inline
+ @config[:swear_words] ||= []
end
end
@@ -20,7 +20,11 @@ class TBBC
[/\[table\](.*?)\[\/table\]/,'<table width="@config[:table_width]">\1</table>',:table_enabled,"[table]...[/table]","<table width=\"100%\">...</table>"],
[/\[tr\](.*?)\[\/tr\]/,'<tr>\1</tr>',:table_enabled,"[tr]...[/tr]","<tr>...</tr>"],
[/\[td\](.*?)\[\/td\]/,'<td>\1</td>',:table_enabled,"[td]...[/td]","<td>...</td>"],
- [/\[th\](.*?)\[\/th\]/,'<th>\1</th>',:table_enabled,"[th]...[/th]","<th>...</th>"]]
+ [/\[th\](.*?)\[\/th\]/,'<th>\1</th>',:table_enabled,"[th]...[/th]","<th>...</th>"],
+ [/\[h1\](.*?)\[\/h1\]/,'<h1>\1</h1>',:header_enabled,'[h1]heading[/h1]',"<h1>heading</h1>"],
+ [/\[h2\](.*?)\[\/h2\]/,'<h2>\1</h2>',:header_enabled,'[h2]heading[/h2]',"<h2>heading</h2>"],
+ [/\[h3\](.*?)\[\/h3\]/,'<h3>\1</h3>',:header_enabled,'[h3]heading[/h3]',"<h3>heading</h3>"],
+ [/\[h4\](.*?)\[\/h4\]/,'<h4>\1</h4>',:header_enabled,'[h4]heading[/h4]',"<h4>heading</h4>"]]
private

0 comments on commit 90aa3cf

Please sign in to comment.