chris blogs

June 2005

25jun2005 · Introducing Linko

This is just a small Saturday morning hack, but a rather useful one, I think.

Often, when you are blogging about something, you want to link to certain sites about topics that appear often, but you don’t always want to play around with URLs and stuff, and thus you are likely to insert no link at all, just because it is too much work.

Not so anymore with Linko, a Ruby1 link inserter I just wrote. Linko2 makes inserting links as easy as pie! For example, I just typed:

Not so anymore with *Linko__*, a Ruby_ link inserter I just wrote.
Linko_ makes inserting links as easy as pie!

And that’s all you need to do, provided that you have links for Linko and Ruby in your Linko mapping already.

Further, Linko2 also makes your life a lot easier if the commonly-linked page suddenly moves, you just fix the replacement and rerun Linko on your site.

Linko is currently written as a Ruby1 library following the *Cloth API, so you just can run it like this (or use a chaining mechanism like my ClothesLine):

Linko.new("Ruby_ is fun!").to_html
=> "Ruby<a href=\"http://www.ruby-lang.org/\"><sup>1</sup></a> is fun!"

Happy linking! Linko2 is available from my Darcs3 archive at http://chneukirchen.org/repos/linko

NP: Jimi Hendrix—Gypsy Eyes

Copyright © 2004–2016