There is a plugin, I’ve named it "DisplayCode", can’t remember if it’s the original name or not :
// plugin for MODx for not parsing Snippet, Chunk and Doc Var tags
// author: Marc Hinse, www.modxcms.de, [email protected]
// Version 1.0
// 17.07.07
function replace_modxtags($matches){
global $modx;
$code_entities_match = array('[', ']','{', '}');
$code_entities_replace = array(
'<span class="bracket">[</span>',
'<span class="bracket">]</span>',
'<span class="bracket">{</span>',
'<span class="bracket">}</span>',
);
$code = str_replace($code_entities_match,$code_entities_replace,$matches[1]);
return '<pre>'.$code.'</pre>';
}
$modx->documentObject['content']=preg_replace_callback("#<pre>(.*?)</pre>#s", "replace_modxtags", $modx->documentObject['content']);
Check the "OnLoadWebDocument" System Event for the plugin.
In your docs just surround the snippet call etc. with pre tags :
The plugin adds some span tags :
<pre><span class="bracket">[</span>!Fisheye!<span class="bracket">]</span></pre>
I’m using it
here.