The Problem:
I am still using Blogger.com to host my blog, which works pretty good, you just don't have too many options and no server control. This means I can't just include my scripts on the fly (for now). I have been working with my layout, client side syntax highlighting, and general look and feel of the blog and I am getting somewhat comfortable with it. For syntax highlighting I decided to go with syntaxhighlighter, a google code project written in javascript. It works well, it's just slow. The problem with doing using plugins and including the script right into your post is that I have to generate the html for each blog post... and I want them all to be consistent.
The Solution:
Wanting things to be as simple as possible for me to post and edit my new scripts I wanted a simple code generator. I wanted it to create the html for adding a collapsed code section with a link to the script on my server on the top. I like this format because you can copy it, read it or just download it. Maybe I'll edit the syntaxhighlighter so that it takes a link for downloading the code... but for now this works. Just for fun, here's the code for my code generator:
convert_script.py
Note: The html for the presentation of my code generator on my blog was created by this script...
Further Explanation:
So in essence, all I have to do is point the script at a file on my server and bam! the code is in the clipboard! I love it. It supports code snippits and local or web script files. You can also add options for the syntaxhighlighter javascript. Yea... it's a bit rough, but what do you expect in under an hour...
Saturday, December 20, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment