Friday, August 12, 2005

My HTML Editor

Well, I’ve been trying it out for a while now, and I’m ready go go ahead and recommend the HTML editor I’ve been using. It’s called HTML-Kit, and you can get it here.

Now that I have a good HTML editor, what I’ve been able to do is create an HTML template on my computer which looks just like the blog, and then see exactly what my posts will look like, before I post them. It’s also easier to save them and come back to them, for the longer ones, than it would have been if I were using Notepad.

As well as being a good overall HTML editor (and general text editor), it allows you to create plugins, which are your own custom macros, to do various types of things. For example, for the definition popups that I use in this site, I use a <span> which looks something like this:

<span class="definition" onclick="openDefinitionWindow('popups', 'This is a popup.')">popup</span>
(On some browsers, that long line of code is going to cause grief...)

I’ve created a macro where I can just select a piece of text, click a button, and HTML-Kit will surround that text with the <span> open and close tags, with the class and onclick attributes already filled in. All I have to do is fill in the specifics of what text to go into the popup window.

Also, because of the way that I set up my blog, it automatically replaces newlines with <BR> tags, when it displays posts. This was fine when I was using the Blogger editor, but now that I’m basically just copying and pasting my HTML right into Blogger, I kind of regret it. But I get around that by using <BR> tags when I’m writing my posts, and then I have a macro that can go through and remove them all for me.

As another example, I’ve created some macros for working with quotation marks, so that I can use “smart quotes”, rather than the usual "ASCII quotes".

So, yeah, I’m sure most people don’t care about all of this. But if you’re looking for a good, light-weight HTML editor, give HTML-Kit a try, and I don’t think you’ll be disappointed. If you do, and you want a plugin that will help you work with quotes, let me know. The one I’ve created does the following:
  • If you select a piece of text, it can surround it with “smart quotes”
  • It can do the same to surround with ‘smart single quotes’
  • If you select some text, it can replace all apostrophes with an entity, representing a “smart apostrophe” - that is, it will insert the text &#8217;
  • It can do the reverse, and replace those entities with regular apostrophes again.
  • It can “escape” apostrophes within Javascript strings. So something like 'I won't do it' will become 'I won\'t do it'
  • It can insert a single open quote entity - &#8220;
  • It can insert a single close quote entity - &#8221;
  • It can insert a single apostrophe entity - &#8217;

0 comments: