Thursday, April 24, 2008

Does Blogger(blogspot) support code formatting?

Here are some attempts..
This is using format my source code for blogger utility.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>





Some trial with an excellent web based tool provided at http://www.manoli.net/csharpformat/

I copied the CSS given by this site to my blogger template.
The results are good. But needs tweaking as default blogger linespacing is kind of messed. Then I tweaked it a little bit and mixed with the pre tag in above code formatting style. Works to certain extend. But I am not satisfied with the output. May be I need to change my Blog's basic template to a wider one to accommodate the source code. Thats for later!!!