Syntax highlighter permits
code within posts to be highlighted based on the language structure it's
written in, to make it simpler to peruse. In other word add code to your blog post
and have it format the same way as it does inside the IDE. Syntax Highlighter
runs in the browser which means it doesn’t care about what kind of server you
have. In fact, Syntax Highlighter can run provincially on your machine without
any web server worst case scenario of all it runs in essentially every advanced
web browser. That implies you can introduce Syntax Highlighter in your landing
page, blog, CMS, documentation CD or whatever other site page.
It truly takes simply
several minutes to get going and you will have delightfully highlighted code
for all your clients to appreciate.
Or
You can copy and paste
below code in your blog <head> section.
<
link
href
=
"http://alexgorbatchev.com/pub/sh/current/styles/shCore.css"
rel
=
"stylesheet"
type
=
"text/css"
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js"
type
=
"text/javascript"
></
script
>
<
link
href
=
"http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css"
rel
=
"stylesheet"
type
=
"text/css"
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"
type
=
"text/javascript"
></
script
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</
script
>
Let's go to know how to use this code in blog post, go to HTML view of your post and put the whole code within the <pre> tag will be look like this:
<
preclass
=
'brush:xml'
>
// Your programming code here
</
pre
>
Only use scripts correspond to
a programing language. If you want to be able to format a particular language,
then you need to provide a script for that language. You can add them all, but
this might slow down your page load times so avoid all, only use perfected
scripts according your language structure.
No comments