SyntaxHighlighter
Official website: http://alexgorbatchev.com/SyntaxHighlighter/"SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript."
Download or using hosted version
From http://alexgorbatchev.com/SyntaxHighlighter/download/, two ways to use SyntaxHighlighter:- Download whole package(ex: "syntaxhighlighter_3.0.83.zip") and upload to your host server.
- Use a free hosted version according to http://alexgorbatchev.com/SyntaxHighlighter/hosting.html. (You can donate to help SyntaxHighlighter author pay for these extra bandwidth :))
Installation
Two way to install:- You can add all brushes manually to your post: http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html
- You can also use dynamic brush loader: http://alexgorbatchev.com/SyntaxHighlighter/manual/api/autoloader.html
Here I choose manually way.
Available brushes
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/Configuration for Blogger
http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/My steps for Blogger
1. Where are those scripts and css files:- syntaxhighlighter_3.0.83\scripts\*.js
- syntaxhighlighter_3.0.83\styles\*.css
3. Add below content before </head> tag ends:
4. Save the template.
5. Here’s examples:
- <pre /> method:
/** * SyntaxHighlighter */ function foo() { if (counter <= 10) return; // it works! }
/** * SyntaxHighlighter */ function foo() { if (counter <= 10) return; // it works! }
- <script /> method:
References
http://geektalkin.blogspot.in/2009/11/embed-code-syntax-highlighting-in-blog.htmlhttp://wesingkasu.blogspot.in/2013/05/blogger-syntaxhighlighter.html [Chinese]
http://pydoing.blogspot.in/2010/11/syntaxhighlighter-blogger.html [Chinese]
No comments:
Post a Comment