19 May 2007

Making punctuations look good! #

Oops! Comments got disabled by mistake. Re-enabled them ... let me know what you think! :)


Recently, I’ve been rather taken in with smart punctions, rather than the dumb normal ASCII ones. You know, the straight dumbOpposite of ‘smart’ is? ;) quote marks (" and '), or the normal ellipsis made up of full stops (...) ? HTML has predefined special entities to draw these rather nicely, but we don’t use them normally because most of us don’t know about them, and Blogger natively doesn’t convert the characters. Typing them out manually can be such a pain, and you need to remember so much more stuff.

So, I worked up a quick Greasemonkey userscript that adds a nice little link in your row of buttons (in the post editor), which you can use to quickly convert all your punctuations to what they should be. Since there is no way of creating a “plug–in” for Blogger, anything which needs to affect a post directly needs to be tackled at the post editor level.

The script is ‘smart’, as in it understands when to use a left curly quote and a right curly quote. It also changes hyphens to what you want them to be. A single or a double ‘–’ generates an en–dash (–), whereas a triple ‘–’ generates an em–dash (—). To know which one to use where, and other punctuation marks, look up the A List Apart article. I referred to it while making this.

Known Bugs and License

Since this went through an extended testing period, and some live testing (I guess you could call it that) on Userscripts, and there hasn’t been a complaint or a request, I’ll assume there to be no bugs :) Except for some weird behaviour when it comes to apostrophes and quotation marks :P And like everything else, this script is licensed under an NC–ND Creative Commons License.

The name for the script is taken from the excellent SmartyPants project, by the oh–so–creative John Gruber. So a big thanks goes out to him for coming up with the idea. I had sent him a mail regarding using of the name and the basic concept. I never got a reply (it’s been about 2 months now), so I took it as a yes and published this :)

Get the script!

Pseudo–SmartyPants for Blogger
All my Userscripts


2 comments

Anonymous said...

Looks cool, I think I got to see a preview version of it. :-)

Although I must admit, I didn't even realize there was such a thing as an em-dash. Nice work.

Deepak said...

em-dash might be LaTeX nomenclature :P