Google Syntax Highlighter

less than 1 minute read

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’

<pre name="code" class="javascript">


</pre>

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

<pre name="code" class="javascript">





</pre>

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.

<pre name='code' class='css'>
/* 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;
}
</pre>

The final result ….

<pre name="code" class="java">
public class HelloSyntaxHighlighter
{
public HelloSyntaxHighlighter()
{
}

private void xx()
{
}

protected boolean static getXX()
{
return null;
}
}
</pre>

Categories:

Updated:

Leave a Comment