> Club Elektronika: Cara highlight syntax c++ di Blogger

Cara highlight syntax c++ di Blogger


To highlight a code block in blogger you can use Google’s handy google-code-prettify client side code highlighting library.

To implement it, follow these steps:

1. Go to the “Design” setting section of your blog
2. Click on the “Edit HTML” tab. This will show you the HTML code of your blog post template.
3. Look for the  tag and place the following two lines just under it.
     <link href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css' rel='stylesheet' type='text/css'/>

    <script src='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js' type='text/javascript'/>

4.Then look for the <body> tag and append 'onload=prettyprint()'

    <body onload='prettyPrint()'>

5.The setup is now complete. To include the highlighted code block in your post, select the “Edit HTML” mode in the Post creation/editing page.
6. Enclose the code that you wish to be highlighted as shown:

    <pre class="prettyprint">

    ... # Your code goes here

    </pre>

You can also use the predefined “code” blocks: <code>Your code here</code>

sumber: http://mateenmoosa.wordpress.com/2011/08/09/blogger-code-block/ 

Tidak ada komentar :

Posting Komentar