Kamis, 27 Februari 2020

Show Code on Blogger Blog Post

this tutorial based on post : https://stackoverflow.com/questions/1644201/how-can-i-display-code-better-on-my-blogger-blog


Click on "Edit HTML" in Blogger and then insert the following in the <head> section of your HTML:
<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/shBrushRuby.js" type="text/javascript"></script> <script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shLegacy.js" type="text/javascript"></script>
<link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shCore.css" rel="stylesheet" type="text/css"></link>
<link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shThemeDefault.css" rel="stylesheet" type="text/css"></link>     <script language="javascript">
window.onload = function () {
    dp.SyntaxHighlighter.ClipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.1.364/scripts/clipboard.swf';
    dp.SyntaxHighlighter.HighlightAll('code');
    dp.SyntaxHighlighter.BloggerMode();
}
</script>


and the following into the <body> wherever you want to put your code:

<pre class="brush: ruby" name="code"># Your Ruby Code</pre>

Tidak ada komentar:

Posting Komentar

Foto Propades