New jQuery Plugin: Taggable

Summary for the busy

Motivation

I've really enjoyed using jQuery over the last few years. It's been quite wonderful really. Outside of the core being easy to use and very solid, the plugins available really make jQuery sizzle.

So I thought I'd take a crack at writing my very own plugin. My main goal was to imitate the tagging interface you've seen in some desktop UIs, with Evernote being my main inspiration.

Lessons Learned

A few things I learned while writing the plugin:

  1. Writing a jQuery plugin is not that hard
  2. Developing jQuery plugins is  really really fun (no really, it is)

Details

The plugin requires jQuery and jQuery UI. Once you have the jQuery requirements and the plugin file, using the plugin is simple. Just call .taggable() on the element that you want to have tags attached to. There are various ways to customize it beyond this of course. For those details, check out the README.

Other Tag-ish Plugins Out There

I fought the urge to look at existing work, mainly so that I could learn as much from tripping over my own two feet as possible. Upon writing this post, I decided 'why not' and Googled around for "jquery plugins tag" and other permutations. I was thrilled to see that it doesn't look like there are any other plugins that do quite this. All of the other options turn input into tags or create tag clouds.

Posted in Code | Tagged , , , | 3 Comments

WikiText & Eclipse: Making Documentation Easier

Writing documentation can be a serious pain. So the oft taken path is to not write anything. Recently, I was exploring menu options in Eclipse and noticed the WikiText option. I must have been hiding under a rock because I haven't noticed how nice WikiText is nor where it is applicable.

About WikiText

WikText is a structured language that is easily readable by humans and is pretty easy to parse. As an example this is how you write a h1:

h1. Main heading

Examples

It really couldn't be any more simple than that. Similar markup exists for a larger part of HTML as well. Here are a few more examples:

*this creates bold text*
__italic text__
#Numbered list item 1
#Numbered list item 2
*Bulleted list item
bc. Block Code in here

An easy to use markup language isn't that interesting on it's own IMO, but when it's natively supported by your tooling things get a lot more useful.

So typing something like this in Eclipse:

Generates something like this:

Eclipse is very happy to convert your WikiText to HTML, DocBook and Eclipse help files.

Even outside of Eclipse, I find this useful as many sites will parse your .textile files. Outside of wiki sites, I think the most notable would be git hub. If you have a README.textile they will parse it and generate the HTML for your project page based off of it.

The Eclipse documentation here talks more about the capabilities but I think the above are the most important (especially if your like me and didn't know about it).

Posted in Code | Tagged , , , | 3 Comments