Friday 13 July 2007

Google Syntax Highlighter

I'm just going to outline the three steps that are needed to enable the google syntax highlighter within blogger.com sites. A patched version of the 'shCore.js' script has been made available by Wctang, which corrects Issue 18 : Syntaxhighlighter doesn't work on blogger.com. In your template file

1 : Reference the wctang 'shCore.js'






2: Reference the 'svn/tags/1.5.0' version of the code scripts.









3 : Don't reference the 'SyntaxHighlighter.css'.

The '.dp-highlighter .tools' section needs to be patched to enable the syntax high lighter in firefox. Copy the content of the 'SyntaxHighlighter.css' to your template file, and make sure to update the correct section.


/* Styles for the tools */
.dp-highlighter .tools
{
padding: 3px 8px 3px 10px;
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: silver;
background-color: #f8f8f8;
/* text-align: right; */
padding-bottom: 10px;
border-left: 3px solid #6CE26C;
}


The final result ....


public class HelloSyntaxHighlighter
{
public HelloSyntaxHighlighter()
{
}

private void xx()
{
}

protected boolean static getXX()
{
return null;
}
}

No comments: