Cara Menambahkan Syntax Highlighting ke Blogger

  1. Pergi ke link http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css , copy semua css yang ada dihalaman tersebut.
  2. Sisipkan css yang di copy di bagian akhir css template html blogger (yaitu, setelah <b:skin> <!--[ CDATA [/ * dan sebelum ]]--></ b: skin> ) .
  3. Sisipkan javascript - javascipt dibawah ini sebelum tag </head>
  4. <- Add-in CSS untuk sintaks ->  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'>  
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'> 
    
  5. Masukan script dibawah ini sebelum tag </body>
  6. <script language='javascript'>  
    dp.SyntaxHighlighter.BloggerMode();  
    dp.SyntaxHighlighter.HighlightAll('code');  
    </script>
    
  7. Dan "Save Template".
  8. Untuk menggunakannya, lihat contoh dibawah...
  9. <pre name="code" class="cpp">  
    ...Your html-escaped code goes here...  
    </pre>
    

Comments

Popular posts from this blog

Tipe File dan Macam - Macam File

Model Warna YIQ