Gem: TrainBBCode

TrainBBCode Provides BBCode for Ruby. It is able to turn [b]bold text[/b] [i]italics [u]Underlined Italics[/u][/i] into bold text italics Underlined Italics.

It is available from Gemcutter and can be installed by using the command:


1 gem install trainbbcode




The source code is available on GitHub at http://github.com/Arcath/TrainBBCode

Options
OptionDefaultDescription
:url_target_BLANKSet this to an acceptable url target, it will then be used as the target for all links
:image_altPosted ImageThis controls the alt tag for all images
:allow_defaultstrueIf set to false the default tags will not be applied
:table_width100%Controls the Width of all tables, can be lowered if your layout breaks when large objects pop out
:syntax_highlightingtrueIf set to false [code] tags will be ignored
:tagname_enabledtrueIf set to false the selected tag will be disabled. Some Tags fall in groups


Tags
TagOutputParsed Output
[b]Bold[/b]<strong>Bold</strong>Bold
[i]Italics[/i]<i>Italics</i>Italics
[u]Underline[/u]<u>Underline</u>Underline
[color=yellow]Yellow Text[/color]<span style="color:yellow">Yellow Text</span>Yellow Text
[center]Centered Text[/center]<div style="text-align:center;">Centered Text</div>
Centered Text
[left]Left Aligned Text[/left]<div style="text-align:left;">Left Aligned Text</div>
Left Aligned Text
[right]Right Aligned Text[/right]<div style="text-align:right;">Right Aligned Text</div>
Right Aligned Text
[url]http://www.arcath.net[/url]<a href="http://www.arcath.net" target=":url_target">http://www.arcath.net</a>http://www.arcath.net
[url=http://www.arcath.net]Arcath.net[/url]<a href="http://www.arcath.net" target=":url_target">Arcath.net</a>Arcath.net
[img]http://www.arcath.net/images/rails.png[/img]<img src="http://www.arcath.net/images/rails.png" alt=":image_alt" />Posted Image
[img alt=Rails Logo]http://www.arcath.net/images/rails.png[/img]<img src="http://www.arcath.net/images/rails.png" alt="Rails Logo" />Rails Logo
[quote]A Quote[/quote]<blockquote>A Quote</blockquote>
A Quote