Embed Code Syntax in your posts

Steps to Add it to Blogger:
To highlight your code you just need to follow this steps:

1. You need to login to you account;

2.After that, go the Blogger Dashboard ->Design->Edit HTML.

The first step is making a backup of your current theme;

3. Now you need to copy the fowling code, and this is importing, copy it to Above/Before tag.

 <link href='http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
 <link href='http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
 <script src='http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> 
 <script src='http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
 <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>

4. Now we nee to include this scripts, copy this code to Above/Before the tag.

 <script language='javascript'>
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;

5. When you need to insert code, you just need to insert this tag, and paste it inside the tag:

 <pre class="brush: BRUSH-NAME">
 Paste Your Code Here

The "BRUSH-NAME" needs to be changes, so when your code is from a certain type, just change it to the right tag. For example, if is a xml code, change it to "BRUSH-NAME" with xml. All the code should be Escaped (Visit this Page to make your Code Escaped)

Note that there are a lot of different brush types that you can use:
• actionscript3, as3
• bash, shell
• c#, c-sharp, csharp
• coldfusion, cf
• cpp, c
• css
• delphi, pascal, pas
• diff, patch
• erl, erlang
• groovy
• java
• perl
• php
• plain
• powershell
• python
• ruby
• scala
• sql
• vb
• xml, html
The source list can be found at http://alexgorbatchev.com/pub/sh/

This is some features you can do:

This Line is Highlighted
This Line is not Highlighted
This Line is again Highlighted

You can hide the toolbar, if you want:

 If You observe ,there is no Toolbar

0 comentários:

Enviar um comentário