Grails BB-Codes plugin

  • Tags: markup language, bb
  • Latest: 1.0
  • Last Updated: 27 July 2013
  • Grails version: 2.0.0 > *
0 vote
Dependency:
compile ":bb:1.0"

 Documentation  Source  Issues

Summary

The plugin supports text processing with the KefirBB library. The KefirBB allows to create flexible configurations for different text translations. For example, BB-to-HTML or HTML filtration.

Description

This plugin uses the KefirBB for text convertation. You can use one of standard configurations or make youself. The plugin contains one service and some GSP tags.

The Service

Inject it in your Grails class.
BbService bbService

Use it to conver a text.

def converted = bbService.process(text);

Tags

Convert BB-codes to HTML
<bb:process text="${text}"/>
or
<bb:process>${text}</bb:process>

Convert with custom configuration

<bb:process conf="my" text="${text}"/>
or
<bb:process conf="my">${text}</bb:process>

Escape XML symbols

<bb:xml text="${text}"/>
or
<bb:xml>${text}</bb:xml>

Safe HTML

<bb:html text="${text}"/>
or
<bb:html>${text}</bb:html>

Custom configuration

You also can use a custom configuration. See the the KefirBB documentation. It is enough to put your configuration XML file to the "grails-app/conf" directory.

The sample application

There is a sample application to demonstrate futures of the BB-codes plugin. https://github.com/kefirfromperm/grails-bb-sample