Wednesday
Mar092011
Adding Syntax Highlighter to Squarespace
Wednesday, March 9, 2011 at 11:39AM Syntax Highlighter is a Javascript library for showing formatted code snippets in a webpage. Adding the Syntax Highlighter to a Squarespace blog is simple. Here are the steps:
- Download the Syntax Highlighter from http://alexgorbatchev.com/SyntaxHighlighter/download/
- Loging into your Squarespace account.
- Click on Website Management
- Select File Storage under Data and Media
- Click on Upload Files
- Use the Select File button to select the Syntax Highlighter zip file
- Check "Decompress Zip Files After Uploading", and Begin Upload
- Now go back to Website Management and click on Website Settings
- Click on the Code Injection tab, and add the following code to the HTML code text box.
<!-- Include required JS files -->
<script type="text/javascript" src="/storage/syntaxhighlighter_3083/scripts/shCore.js"></script>
<!--
At least one brush, here we choose JS. You need to include a brush for every
language you want to highlight
-->
<script type="text/javascript" src="/storage/syntaxhighlighter_3083/scripts/shBrushJScript.js"></script>
<!-- Include *at least* the core style and default theme -->
<link href="/storage/syntaxhighlighter_3083/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="/storage/syntaxhighlighter_3083/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
And don't forget to tweet your thanks to @syntaxhighlight
Saqib Ali | Comments Off | 