1. First you need to HTML-escape your code snippet to convert special characters to such as < and > to their escape form < and > respectively. You can do this manually or use an online escape tool.
http://www.htmlescape.net/htmlescape_tool.html
2. Go to post editor and switch to Edit HTML mode.
3. Place the escaped code inside tags, with class attribute included, like so:
<pre class="brush: js">
ENTER YOUR ESCAPED CODE SNIPPET HERE
</pre>
If you use Window Live Writer to edit you posts, you can
use this Syntax Highlighter plug-in by Arnold Matusz.
With this plug-in, you just copy and paste the code into the plug-in screen.
You don’t have to escape the code or manually enter it, all you have to do is
paste the code inside the plugin window.
http://www.bloggersentral.com/2009/04/how-to-show-code-in-blog-post.html
Aucun commentaire:
Enregistrer un commentaire