Friday, February 8, 2013

Adding console output formatting to blogger

I have been looking for a way to display properly formatted command line output in blogger for quite some times now, and I finally have a solution.
Go to Design page of your blog, then click on the "advanced" link on the top left of the page. Scroll all the way down to "Add css". On the text field right below "Add custom CSS" Type the following :
pre.console {
  background-color: #666666 ;
  border: 1px solid #006600 ;
  color: #FFFFFF ;
  font-size:.8em ;
}

Now each time you want to display command output prepend your text with <pre class="console">
and append your text with </pre>

It's not very pretty at the moment, but I will work on it ! Also this does not seem to work on mobile device....