Another revamping

I have done another significant revamping of this site. All code snippets are now in color. I will share the Vim script I used to do this, so that other bloggers may benefit from my work:

" Script converts syntax highlighting
" into a form suitable for my blog.

let html_use_css = 0
TOhtml
%s/00c000/00c000/g
%s/c0c000/c0c000/g
%s/0000ff/0000ff/g
%s/00c0c0/00c0c0/g
%s/<br>//g
w

To use this script, copy the code into a file named “blog.vim”, and then enter :so blog.vim in Vim. Open the resulting file in your web browser of choice, then go to the source and copy and paste the code into your blog (in HTML mode, starting after the <font face="monospace"> tag and ending before the final </font> tag. Surround the code with <pre><code> at the beginning and </code></pre> at the end in your HTML. You can modify the script to get the colors you want.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s