Just another WordPress.com site

The bottom line:

do this:

[code lang=”javascript”]

your code

[/code]

The Full story…

The first thing I did before starting a blog, was to find a blog service that had two features:

  1. Free.
  2. Highlight code syntax without any “add-ons”.

It has been a long search and in the end I found a nice web-page at stack overflow: top-rated-javascript-blogs. After going over a few, I decided to give wordpress a try. I think that the nicest fact was that it has an HTML5 editor which I found to be very cool (maybe because I’m learning HTML5 this days….).

So, I registered. But there was no magic button that says: “this is a code section – please highlight this for me” – I wander why?…

After searching the web again I found en.support.wordpress.com/code/posting-source-code/ – which instruct to add [ sourcecode language=”javascript” ] - but still, it didn’t work. Luckily, the page 12-wordpress-plugins-to-display-and-highlight-code-within-your-blog/ really helped. With a big list of plugins, I finally found the magic word:


$(document).ready(function() { alert('booo'); });

all I needed to do was: [code lang = “javascript” ]

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: