This post originated from an RSS feed registered with Ruby Buzz
by Christian Neukirchen.
Original Post: Introducing Linko
Feed Title: chris blogs: Ruby stuff
Feed URL: http://chneukirchen.org/blog/category/ruby.atom
Feed Description: a weblog by christian neukirchen - Ruby stuff
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!"