Cara memasang syntaxhighlighter di blogger/ blogspot

Menulis kode menjadi lebih asyik dengan Syntaxhighlighter. Syntaxhighlighter buatan Alex Gorbatchev ini salah satu yang digemari oleh blogger. Selain mudah memasangnya, juga tersedia banyak Tema. Untuk tema Syntaxhighlighter by Alex Gorbatchev bisa dilihat di sini.



Cara Memasang
  1. Buka Blogger Dashboard > Design > Edit HTML.
  2. Tekan CTRL+F untuk mencari kode </head>.
  3. Copy semua kode dibawah ini:
    <!--SYNTAX HIGHLIGHTER BEGINS-->
    <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
    <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/shCore.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/shBrushCSharp.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/shBrushJScript.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/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 src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script>
    <script language='javascript'>
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
    SyntaxHighlighter.all();
    </script>
    <!--SYNTAX HIGHLIGHTER ENDS-->
  4. Selanjutnya paste diatas kode </head>
  5. Kemudian simpan.
Untuk menggunakannya gunakan kode berikut untuk HTML:
<pre class="brush:html">
Your 'HTML' code goes here
</pre>
Untuk menampilkan kode CSS:
<pre class="brush:css">
Your 'CSS' code goes here
</pre>
Dan seterusnya... Berikut contohnya:
Tes Syntaxhighlighter by Alex Gorbatchev

Your 'CSS' code goes here
Kode css kita akan tampil disini
ini baris ketiga

Your 'HTML' code goes here

Selamat mencoba...

Anda baru saja membaca artikel yang berkategori Blogger / other dengan judul Cara memasang syntaxhighlighter di blogger/ blogspot. Anda bisa bookmark halaman ini dengan URL http://bisidamuda.blogspot.com/2012/05/cara-memasang-syntaxhighlighter-di.html. Terima kasih!
Ditulis oleh: Bisidamu

1 Komentar untuk "Cara memasang syntaxhighlighter di blogger/ blogspot"