How to post source code in blogspot andrey понедельник, 14 января 2013 г. No Comment

when I tried to publish a post in which I can show code snippets, I encountered some difficulties:
(1)Pieces between arrow brackets can not be displayed because in such a case Blogger will try to automatically corrected the HTML code by closing all tags such as an C++ library import.
(2)There is neither line indent nor highlight. The code is ugly and hard to read.

So, how to display source code in a good manner? I did some research online. Here are the steps I followed to give the source code a "makeup":

1.In the blogger,Click on Layout tab ->Edit HTML and put following things Before



3. encode (HTML Encode) your source code. for this, you can use this.
OR

Copy your code in notepad and replace all < in < etc.

4. Put your updated code between:


….My code here…


when I tried to publish a post in which I can show code snippets, I encountered some difficulties:
(1)Pieces between arrow brackets can not be displayed because in such a case Blogger will try to automatically corrected the HTML code by closing all tags such as an C++ library import.
(2)There is neither line indent nor highlight. The code is ugly and hard to read.

So, how to display source code in a good manner? I did some research online. Here are the steps I followed to give the source code a "makeup":

1.In the blogger,Click on Layout tab ->Edit HTML and put following things Before



3. encode (HTML Encode) your source code. for this, you can use this.
OR

Copy your code in notepad and replace all < in < etc.

4. Put your updated code between:


….My code here…


by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment