Edgewall Software

ProcessorBazaar: js-0.1.py

File js-0.1.py, 511 bytes (added by Jason Wadsworth <jdwadsworth@…>, 22 months ago)

JavaScript Syntax Formatting Processor

Line 
1"""
2Processor that calls the JavaScript Mimeview processor.
3
4Version: 0.1 (2007-01-22)
5
6Example:
7{{{
8#!js
9var func = function() {
10  this.obj = new Object();
11  this.flag = true;
12  return 49;
13}
14}}}
15
16wadsworth(at)thefrontside(dot)net
17
18Blatantly copied and slightly altered from the pascal processor at:
19http://trac.edgewall.org/attachment/wiki/ProcessorBazaar/pascal-0.0.1.py
20"""
21
22from trac.mimeview import Mimeview
23
24def execute(hdf, text, env):
25        return Mimeview(env).render(None, 'text/x-javascript', text)