Grails - Radeox plugin

Radeox plugin

def title       = 'A plugin for the Radeox Wiki-render engine to allow easy markup and cross-linking.'
def author      = 'Dierk Koenig'
def authorEmail = 'dierk.koenig at canoo.com'
def description = '''
The Radeox plugin provides a new tag <g:radeoxRender> some content </g:radeoxRender> that 
processes the inlined content according to the Radeox Wiki Format, including directives like _bold_ and ~~italic~~ but also more advanced macros like 
"error">table: TableMacro: missing table content
and {table} Macro|Description|Parameters anchor| |unexplained, lazy programmer, probably [funzel]\\ api|Generates links to Java or Ruby API documentation.|1: class name, e.g. java.lang.Object or java.lang.Object@Java131\\2: mode, e.g. Java12, Ruby, defaults to Java (optional)\\ api-docs|Displays a list of known online API documentations and mappings.|none asin|Generates links to DVD/CD dealers or comparison services. Configuration is read from ~~conf/asinservices.txt~~|1: asin number\\ code|Displays a chunk of code with syntax highlighting, for example Java, XML and SQL. The none type will do nothing and is useful for unknown code types.|1: syntax highlighter to use, defaults to java (optional)\\ file-path|Displays a file system path. The file path should use slashes. Defaults to windows.|1: file path\\ hello|Say hello example macro.|1: name to print\\ info| |unexplained, lazy programmer, probably [funzel]\\ inter-wiki|Displays a list of known InterWiki mappings.|none\\ isbn|Generates links to book dealers or comparison services. Configuration is read from ~~conf/bookservices.txt~~.|1: isbn number\\ link|Generate a weblink.|unexplained, lazy programmer, probably [funzel]\\ list-of-macros|Displays a list of available macros.|unexplained, lazy programmer, probably [funzel]\\ mailto|Displays an email address.|1: mail address\\ note| |unexplained, lazy programmer, probably [funzel]\\ quote|Display quotations.|1: source (optional)\\2: displayed description, default is Source (optional)\\ rfc|Generates links to RFCs.|unexplained, lazy programmer, probably [funzel]\\ table|Displays a table.|none warning| |unexplained, lazy programmer, probably [funzel]\\ xref|Generates links to Java Xref source code.|1: class name, e.g. java.lang.Object or java.lang.Object@Nanning\\2: line number (optional)\\ {table}. You can also define your own macros in Groovy. Radeox is easy to extend and customize. The plugin comes with an inital implementation of cross liking to pages that are marked up like [pageName] in the content. this will link to the PageController show action.'''

For more details about the radeox wiki render engine, see http://radeox.org.

For a typical usage inside a wiki, see http://snipsnap.org.

For an overview of available markup options, see http://snipsnap.org/space/snipsnap-help.

Usage in Grails

Main usage scenarios for this plugin in a Grails application:

  • you are developing a Wiki based on Grails
  • part of your Grails app should have a wiki like behaviour (including automatic internal links)
  • you want to allow users to use radeox markup in plain text fields (no internal links needed)
  • you want to use radeox markup in your GSP pages or other rendering logic for convenience

How to customize

As of the current version (0.1) you best look into the provided artifacts ||location||artifact||note|| |domain| Page.groovy| Sample domain class that uses the plugin in a simple Wiki. | |taglib| RadeoxTagLib.groovy| Provides the <g:radeoxRender> tag and wires up the engine. Register more filters or macros here. Adapt Radeox config here. | |utils| GrailsWikiEngine.groovy| Hook to specify how internal wiki links should work in you Grails app. Adapt as needed. | |views| page/* | Sample views that use the new tag in a simple Wiki. | |utils| GroovyMacro.groovy| Custom macro example. |

The code is pretty small and easy to adapt.

Still to do:

  • webtests for the plugin (not sure how to do that...)
  • url mapping from app/page/show/$id to app/$name
  • enhance GroovyMacro to execute the contained code in a sandbox
  • make a Google-suggest-like sidebar for known page names
  • PageNameService that does name-to-id mapping with caching
  • backlinks ('who links to this page?')

Known issues:

  • requires grails 0.5.5