Hi!

I've just released tapestry-syntax-highlighter, a package for Tapestry 5.2+[1] which integrates the Prism source code syntax highlighter (http://prismjs.com). The source code is at https://github.com/thiagohp/tapestry-syntax-highlighter and the JAR is already at the Maven Central Repository: http://search.maven.org/#artifactdetails%7Cbr.com.arsmachina%7Ctapestry-syntax-highlighter%7C0.0.1%7Cjar.

To use it, just add the JAR in the classpath and add the syntax-highlighter/SyntaxHighlighter mixin to any component (including the Any one). You can use its enabled parameter to enable or disable it using custom logic if needed. Of course, you'll need to have your source code surrounded by <pre><code language="language-xxx">...</code></pre>, where 'xxx' is the name of a language (such as css or java).

By default, it uses the default theme and adds the Line Highlight plugin. To change this, create your own version of Prism using the form at http://prismjs.com/download.html and override the SyntaxHighlighter.DEFAULT_JAVASCRIPT_FILE_PATH and/or SyntaxHighlighter.DEFAULT_JAVASCRIPT_FILE_PATH Tapestry-IoC symbols to point to your versions of these files.

[1] I've tested it only in 5.4-alpha-22, but it doesn't use anything that 5.2 doesn't, so it should work.

Cheers!

--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to