Pernah melihat kode program di blog yang berwarna-warni layaknya melihat kode program di text editor komputer sampeyan ?... itu namanya Syntax Highlighter. Syntax Highlighter untuk menempatkan kode HTML yang biasa di posting di blog menjadi sama seperti di text editor layaknya memakai Notepad atau Dreamweaver ataupun program text editor lainnya. Jadi akan terasa lebih indah, berwarna-warni, lebih enak dilihat, dan lebih enak dibaca. Cara membuat untuk blogger berikut ini langkahnya :
- Backup terlebih dahulu template blogger kamu.
- Setelah dibackup, masuk ke Dasbor - Design - Edit HTML
- Tekan CTR+F dan cari kode </head>
- Pasang code berikut diatasnya;
<!--SYNTAX HIGHLIGHTER BEGINS-->
<link href='http://alexgorbatchev.com/pub/sh/2.1.364/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/2.1.364/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushXml.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushPerl.js' type='text/javascript'></script>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.1.364/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
<!--SYNTAX HIGHLIGHTER ENDS-->
Cara penulisan untuk menggunakan dalam tampilan posting sebagai berikut;
<pre class="brush:html">
tulis disini kode 'HTML' sampeyan
</pre>
Contoh hasilnya ya seperti yang sampeyan lihat diatas ini... Demikian mase, dipake sukur gak dipake juga gak apa-apa
No comments:
Post a Comment