• Home
  • About Jon Dowdle
  • Lifestream
KEEP IN TOUCH

Posts in category Code

WikiText & Eclipse: Making Documentation Easier

Apr12
2010
Written by Jon Dowdle

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).

Tagged html, Markup languages, Wiki, Wikitext

cfCalais – A Coldfusion tag to easily create semantic data

Feb16
2010
Written by Jon Dowdle

Something that I've been interested in for a while now is the semantic web. I don't claim to be any kind of expert on it and have barely scratched the surface.

After finding about the Open Calais service from Thompson Reuters I was pretty excited. I've created a custom tag that sends data to the service which in turn returns the resulting semantic data.

The tag is pretty easy to use. Just surround the text you want to parse with the <cf_calais>  tags and off you go. The default variable returned is cfcalais. You can override this by setting the "name" attribute.

Introduction to OpenCalais

Home
If you are unfamiliar with the OpenCalais service, here is a short description:

We want to make all the world's content more accessible, interoperable and valuable. Some call it Web 2.0, Web 3.0, the Semantic Web or the Giant Global Graph - we call our piece of it Calais.

Calais is a rapidly growing toolkit of capabilities that allow you to readily incorporate state-of-the-art semantic functionality within your blog, content management system, website or application.

Taken from OpenCalais website

Tag Use

  1. Obtain a license key at http://www.opencalais.com/
  2. Place in a directory where your CFML engine can find it
  3. Wrap your content like this:
    <cf_calais name="myLittlePony" license='#myLicenseKey#'>
    Some content here
    </cf_calais>
    
  4. Use the returned data

Return Variable

A structure is returned which contains various keys depending on the content that was parsed. A full list of returned metadata returned can be found here: http://www.opencalais.com/documentation/calais-web-service-api/api-metadata/entity-index-and-definitions

For the example content (taken from tagTest.cfm):

Amazon's Kindle e-book reader is going on sale in more than 100 countries around the world, including the UK. The reader has been confined to the US since its launch in November 2007; Amazon expects to have sold a million of the devices by the end of the year. The global version will run on the 3G network, although Amazon has not specified the networks that will provide connectivity for the devices. The Kindle store will offer over 200,000 English-language titles. Hundreds of publishers are signed up including Penguin, Faber and Faber, and HarperCollins. It will also carry more than 85 US and international newspapers and magazines. "We have millions of customers in countries all over the world who read English-language books. Kindle enables these customers to think of a book and download it in less than 60 seconds," said Amazon founder Jeff Bezos. Penguin chief executive John Makinson hopes it will kickstart digital book sales in Europe. "The publishing industry is experiencing explosive growth in digital book sales in the US," he said. KINDLE IN EUROPE Amazon Kindle 0.36 inches thick with 6in e-ink display 2GB of internal memory QWERTY keyboard to add notes to text Battery life "weeks on a single charge" USB synching for people out of coverage area The look and feel of the device will be the same as the US version with the exception of network access. Following difficulties making the Kindle's Whispernet wireless download system work in the Europe, Amazon has decided to make downloads available via the 3G network. This means that people wishing to download a book outside of a 3G coverage area will have to transfer content over USB. In May of this year, Amazon unveiled a new version of its e-reader aimed at reading magazines, newspapers and documents. The Kindle DX is currently available only in the US. The European version of the Kindle will begin shipping on October 19 with a $279 (£175) price tag.

Returns a structure that would have the following keys and values:

  • Technology : 3G
  • socialTag : Technology_Internet,Printing,Ur,Mass media,E-book,Amazon Kindle,Amazon.com,Media technology,Publishing,Linux based devices,Electronic publishing,E Ink,3G
  • Country : United Kingdom,United States
  • Person : John Makinson,Jeff Bezos
  • Position : chief executive
  • Company : Amazon,Penguin
  • Facility : Kindle store
  • Currency : GBP,USD
  • Product : Kindle
  • Continent : Europe
  • IndustryTerm : e-reader,e-ink,e-book,wireless download system work,3G network

Download the tag and code here: http://github.com/jonDowdle/cfCalais

I hope you find this tag useful and let's make Coldfusion an integral part of building Web 3.0!

Posted in coldfusion - Tagged calais, coldfusion, Semantic Web
« Older Entries Newer Entries »

Recent Posts

  • Code from TDD Demystified through Katas
  • Awesome Web Development Links Found This Week
  • Taggable Demo Video (now with more code)
  • Taggable Demo Video
  • New jQuery Plugin: Taggable

Categories

  • Code
    • MySQL
    • Programming
    • Web Design
  • coldfusion
  • Life
    • Events
  • Reviews
  • Uncategorized
  • Work

Tags

adobe barcamp barcamporlando coldfusion ComplexByteArrayException concat conferences decorator design pattern Events firebug Form fowa html IE ignite infection control iterator javascript job jQuery movies MySql orlando Photos pirate booty pirates plugins poll project python railo software development sql stackoverflow stax.net style taggable tags talk like a pirate tips & tricks tools twitter washington dc Web Design

RSS Syndication

  • All posts
  • All comments

EvoLve theme by Theme4Press  •  Powered by WordPress jDowdle.com