Home > Blogger > Pasang Syntax Highlighter

Pasang Syntax Highlighter

Untuk sobat yang sering posting HTML code, agar tampilannya terlihat rapi dan juga menarik gak ada salahnya untuk mencoba memasang script syntax highlighter pada HTML template kita.
Caranya sebagai berikut :
  • Login akun blogger
  • Rancangan-> Edit HTML
  • Letakan code di bawah ini di bawah code <head>
<link href='http://cpakank.googlecode.com/files/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script src='http://cpakank.googlecode.com/files/shCore.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushXml.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushVb.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushSql.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushRuby.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushPython.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushPhp.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushJScript.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushJava.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushDelphi.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushCss.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushCSharp.js' type='text/javascript'/>
<script src='http://cpakank.googlecode.com/files/shBrushCpp.js' type='text/javascript'/>
  • Letakan code di bawah ini di atas code </body>
<script language='javascript'>
function start() {
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code', true, true, false, 1, false);
}
window.onload = start;
</script>
  • Save Template
  • Kembali ke dasbor->Setting->Format
  • Scroll ke bawah->Template Entri
  • Masukan code di bawah ini pada kotak Template Entri
<pre name="code" class="c-sharp">
.. Tulis code di sini ..
</pre>
  • Klik Save

Pada setiap kita akan membuat posting baru, code di atas akan selalu muncul. Tapi kalau kita hanya membuat postingan biasa bukan HTML, silakan dihapus saja code tersebut!

  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: