[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to add code syntax highlighting to blogger

Posted on 2012-04-04
8
Medium Priority
?
372 Views
Last Modified: 2012-04-27
I'm new to blog. I would like to add my powershell code to the blog. I had difficulty to follow below links.


http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

http://alexgorbatchev.com/SyntaxHighlighter/

I try to use syntaxhighlighter to add code but i have difficult to follow their instruction:


Installation


Basic Steps

To get SyntaxHighlighter to work on you page, you need to do the following:
1.Add base files to your page: shCore.js and shCore.css
2.Add brushes that you want (for example, shBrushJScript.js for JavaScript, see the list of all available brushes)
3.Include shCore.css and shThemeDefault.css
4.Create a code snippet with either <pre /> or <script /> method (see below)
5.Call SyntaxHighlighter.all() JavaScript method

<pre /> method

ADVANTAGES: Works everywhere, graceful fallback if there are script problems, shows up in all RSS readers as regular <pre />

PROBLEMS: Major issue with this method is that all right angle brackets must be HTML escaped, eg all < must be replaced with &lt; This will ensure correct rendering.

SyntaxHighlighter looks for <pre /> tags which have a specially formatted class attribute. The format of the attribute is the same as the CSS style attribute. The only required parameter is brush (see configuration), which should be set as one of the brush aliases

Start from step1, i already no idea to do that.

Please advice
0
Comment
Question by:suriyaehnop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37809537
Is this Blogger or WordPress?
0
 
LVL 19

Author Comment

by:suriyaehnop
ID: 37809581
Wordpress and blogspot. I have 2 blogs
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37809587
Wordpress.com or self-hosted?
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 19

Author Comment

by:suriyaehnop
ID: 37809609
sorry// wordpress.com
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 1200 total points
ID: 37814393
For Wordpress.com all you need to do is put the code in the sourcecode shortcode per their instructions:

http://en.support.wordpress.com/code/posting-source-code/

Example:

[sourcecode language="css"]
your code here
[/sourcecode]
0
 
LVL 19

Author Comment

by:suriyaehnop
ID: 37826271
Working on wordpress.com. Do you how to enable it on blogspot also?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37826302
0
 
LVL 12

Expert Comment

by:Anuradha Goli
ID: 37827488
You can add as per instructions shown in link
http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html
if any doubts please let me know
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question