nerdzeu/nerdz.eu — pull request #56 by Robertof (2014-03-22 01:08:28+00:00)
Title: Enable callback usage in PrettyPrint.

This enables the possibility to use callbacks with PrettyPrint.

It is fairly easy: place in your template.values file, in whatever section you need to use the callback, a variable named `prettyPrintCallbackName`, and assign an UNIQUE name you will be using for that callback.

Then, in the corresponding JS file of your template, do something like `window['your_callback_name'] = function() { console.log ('Yay!'); }`. Voila, you're done.

This was done to circumvent an issue with the current NERDZ architecture: there is not a way to alter how BBCodes are displayed. My intention was to edit the output of the `[code]` tag, but without altering the main codebase (a thing which I don't wanna do) this is impossible without using an "hack" like this.

This commit **does not** break anything - any template not specifying this variable will not be affected.