Aug 8, 2010

Easy way to embed ColdFusion code into your blog

OK I don't use a ColdFusion blog engine for my blog.  I have reasons for this.  I run my own ColdFusion servers and move/mess with my personal server enough that I don't really want to chance messing up the blog.  I have a really stable Railo VPS aswell and I could use that but I'm happy with blogger and the layout so I'm going to stick with it. 

The one thing that's always difficult is is code highlighting.  I have tried many different syntax highlighters and usually have quite a bit of trouble making them work properly and embedding code just takes too long.  But we all want to see the actual code in the page so I generally make that effort.

I found that pastebin.com provide a really good service and I knew you could share code via a URL but I didn't know they had an embed option which works perfectly.

Here is a demo:



And here is what I need to paste into the wizywig editor in Blogger:



Just use the "Embed" link to get the code and scale the height to match the length of the code block.

There you go embedded code.  Now if you/I were running on a CFML engine I'd investigate a custom tag

Enjoy.

3 comments:

  1. thanks for posting this, this is exactly what I've been after!

    ReplyDelete
  2. Hi, do you a good guide on how to embed coldfusion textboxes in html and output in my desired styling?

    ReplyDelete
  3. @neo I'm not really sure what you mean can you provide more detail or an example.

    ReplyDelete