In order to install & use it on Blogger, follow the below simple steps:
1) Go to your Template Layout->Download your template as a backup first
2)Now click Edit HTML for Layout & then paste the below code in your Template before your </head> tag ends. Note this is pointing to the Latest released version v2.1.364
3)Save the template & open you blog in IE & Firefox to test if
any javascript errors are reported as this might conflict with various
other embedded scripts in your template.
This completes the direct embedding of SyntaxHighlighter in your Blog. Now lets proceed how to use it in your posts:
Usage:
For SyntaxHighlighter 2.0 & above:
Any code you want to be placed & displayed using SyntaxHighlighter must be enclosed in:
-- OR --
Note that we have option of using different brushes for highlighting different type of codes..e.g. HTML/ASP/C++ etc
In order to choose the appropriate brush, following are the various
brush aliases supporting the corresponding code highlighting:
------------------------------------------------
Above aliases can be used at: class="brush: alias" while embedding your code in the Blog.
1) Go to your Template Layout->Download your template as a backup first
2)Now click Edit HTML for Layout & then paste the below code in your Template before your </head> tag ends. Note this is pointing to the Latest released version v2.1.364
3)Save the template & open you blog in IE & Firefox to test if
any javascript errors are reported as this might conflict with various
other embedded scripts in your template.
This completes the direct embedding of SyntaxHighlighter in your Blog. Now lets proceed how to use it in your posts:
Usage:
For SyntaxHighlighter 2.0 & above:
Any code you want to be placed & displayed using SyntaxHighlighter must be enclosed in:
-- OR --
// HTML Code here
Note that we have option of using different brushes for highlighting different type of codes..e.g. HTML/ASP/C++ etc
In order to choose the appropriate brush, following are the various
brush aliases supporting the corresponding code highlighting:
Brush name | Brush aliases | File name |
---|---|---|
ActionScript3 | as3, actionscript3 | shBrushAS3.js |
Bash/shell | bash, shell | shBrushBash.js |
ColdFusion | cf, coldfusion | shBrushColdFusion.js |
C# | c-sharp, csharp | shBrushCSharp.js |
C++ | cpp, c | shBrushCpp.js |
CSS | css | shBrushCss.js |
Delphi | delphi, pas, pascal | shBrushDelphi.js |
Diff | diff, patch | shBrushDiff.js |
Erlang | erl, erlang | shBrushErlang.js |
Groovy | groovy | shBrushGroovy.js |
JavaScript | js, jscript, javascript | shBrushJScript.js |
Java | java | shBrushJava.js |
JavaFX | jfx, javafx | shBrushJavaFX.js |
Perl | perl, pl | shBrushPerl.js |
PHP | php | shBrushPhp.js |
Plain Text | plain, text | shBrushPlain.js |
PowerShell | ps, powershell | shBrushPowerShell.js |
Python | py, python | shBrushPython.js |
Ruby | rails, ror, ruby | shBrushRuby.js |
Scala | scala | shBrushScala.js |
SQL | sql | shBrushSql.js |
Visual Basic | vb, vbnet | shBrushVb.js |
XML | xml, xhtml, xslt, html, xhtml | shBrushXml.js |
------------------------------------------------
Above aliases can be used at: class="brush: alias" while embedding your code in the Blog.
No comments:
Post a Comment