15
September
2010
For Train (The CMS that preceded this blog) I wrote a BBCode plugin in to start off with it was called like this:
Which is ugly to say the least, and a PITA to configure. I still use this ancient version of the plugin on something I wrote for work and its in dire need of an upgrade.
The new version works allot better, the biggest improvement is a configurable call on strings, for example:
OPTIONS in this case is optional, you can run .tbbc with all defaults, which will include the global config which you can set in config/tbbc.rb (in your rails config directory). This means that it is possible to have one global config that controls all the .tbbc calls, this is perfect for defining custom tags like the gist tag here. In my config/tbbc.rb I have:
which turns [gist[/gist] into what you see above. This improvement has long been needed, I found myself defining the same custom tags every time I used .tbbc and my only solution was to move the .tbbc call into a rails helper method which was fine for that project but not what you the rails community will be looking for in a gem so I added tbbc.rb. A simple solution that greatly increases the usability of tbbc, things look so much neater when even with custom tags etc... <%= post.body.tbbc %> is all you need in a view.
Which is ugly to say the least, and a PITA to configure. I still use this ancient version of the plugin on something I wrote for work and its in dire need of an upgrade.
The new version works allot better, the biggest improvement is a configurable call on strings, for example:
OPTIONS in this case is optional, you can run .tbbc with all defaults, which will include the global config which you can set in config/tbbc.rb (in your rails config directory). This means that it is possible to have one global config that controls all the .tbbc calls, this is perfect for defining custom tags like the gist tag here. In my config/tbbc.rb I have:
which turns [gist[/gist] into what you see above. This improvement has long been needed, I found myself defining the same custom tags every time I used .tbbc and my only solution was to move the .tbbc call into a rails helper method which was fine for that project but not what you the rails community will be looking for in a gem so I added tbbc.rb. A simple solution that greatly increases the usability of tbbc, things look so much neater when even with custom tags etc... <%= post.body.tbbc %> is all you need in a view.

CSS Based on Twitters Bootstrap

All Content is written by Adam Laycock (Arcath) unless otherwise stated.




