in

Emerald Hand

Emerald Hand, Inc. community home page.

This Blog

  • Home
  • Contact
  • About
  • Directory of Computers/Tech Blogs

Syndication

News

I'm back to blogging

Worm in liquid maze

Design and development of information management tools.

Code highlighting

I've added some support for code samples highlight in the posts. I use CSS so any highlighting is only visible on the web page of the blog. I would really like to make automatic it in RSS and Atom feeds, but I'm not yet sure how to do it correctly.

One solution would be to add link to the CSS with rules on highlighting. I'm not very fond of this solution as the blog client application would attempt to access the webpage to get CSS file and there might be no Internet connection available. Another solution would be to embed current rules into the post when RSS or Atom XML is generated. In either case I need to modify XML generation process and that might be tricky. I will look into doing it sometime soon, but to be truthful I'm not 100% sure I will be able to implement it. In that case I will need to find another solution (like falling back to <code> and <pre> tags instead of using classes).

Above paragraph has an example of the inline code (inline code is just bold). Bellow is example of a code block. It's the CSS code I use for highlighting.

.ic { display: inline; font-weight: bold; } .code { display: block; border: 1px solid #D0D0D0; padding: 10px; background-color: #F4F4F4; white-space: pre; }
Share this post: Email it! | bookmark it! | digg it! | reddit!
Readability Stats: Word Count: 230; Sentence Count: 14; Grade Level: 6.5, more info...
Published Aug 07 2005, 11:30 PM by Ornus
Filed under:

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About Ornus

Lead Sider and Xelog developer. I'm interested in information and how we can better manage it using computers. I'm also into design and understanding how to creating cool, useful, simple things.
Copyright © 2006-2007 EmeraldHand, Inc. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems