This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

Friday, December 28, 2007

Community Checklist

Alright, I'm going to give this new Purple Include quote stuff a try.

I promise this is not "Let's blog about Robert Scoble day," but, I guess it is :)

I just saw a great post by Scoble about how the Google Reader team could have prepped the community better before releasing a controversial new feature. Using some great advice from Read/Write Web, he asks:



(The stuff above was grabbed using Purple Include; now if I could have just hidden this parenthetical aside using Stretch Text.... future project... BTW, if you are reading this in an RSS reader Purple Includes don't work in my feeds yet -- see Scoble's original post to view the list)

I really like the list that Scoble & Read/Write Web provide. In fact, I've turned it into a checklist of things I should make sure to try to do when working with the community around Gears when there is a significant new feature:
I'm printing this list out and putting it up on my wall here at Google.

Disclaimer: As always, I speak for myself and not my employer, Google.

Labels: , , , ,


Bravery

Now that I've joined Google as a Developer Advocate for Google Gears, blogging is one of my jobs on the Google Gears and Google Code blogs. I'm realizing how different it is to blog on this blog versus the Google ones. Its also causing me to gain much more respect for Robert Scoble. Robert Scoble was an evangelist at Microsoft, a role not unlike the Developer Advocate one I have at Google. I'm now realizing what a tremendous amount of personal integrity and bravery he must have had to blog about many of the things he did, as a change agent at Microsoft. Its a different view blogging from the inside versus blogging from the outside. I know Robert might have been controversial sometimes, but he always put his neck out with honesty and integrity. A tip of the hit to a fellow blogger and evangelist.

Labels: , ,


New Purple Include Release

I've put up a new release of Purple Include, iteration 3. Purple Include is a client-side JavaScript library that allows you to do client-side transclusions.

What the heck does that mean?

It means that you can include and display fragments of one HTML page in another without copying and pasting any content.

To use Purple Include, just add the following SCRIPT tag to the following of your HTML page:

<script src="http://codinginparadise.org/projects/purple-include/purple-include.js"></script>

The big new feature of this release is a new addressing scheme that is much easier to use, named 'quote'. Here's an example:

<div href="http://docs.google.com/View?docid=dhkhksk4_8gdp9gr&pli=1#quote(In the background Dojo Offline is checking...when they are on- or off-line so you don't have to)"></div>

Notice the 'href' attribute; this will cause Purple Include to fetch the given page and inline it into that DIV (you can add the href attribute to DIVs, SPANs, BLOCKQUOTEs, Ps, and more). Also notice the #quote() at the end. This is the new addressing scheme in this release; you can now quote and grab a range of any remote page by just having a few words from the page, followed by three dots, followed by the end of the text to grab. In the example above we have:

#quote(In the background Dojo Offline is checking...when they are on- or off-line so you don't have to)

This goes to the Dojo Offline tutorial, starts grabbing HTML and text from the beginning of 'In the background Dojo Offline is checking' and continues doing so until it encounters 'when they are on- or off-line so you don't have to'. Purple Include has proper HTML range support, which means that nested tags are correctly setup when they are returned and inlined into your page.

Here is the example actually running; after a few seconds you should see the content in-line (if you are reading this in an RSS feed click here to see the example):



The older XPath addressing scheme is still there for advanced usage; the quote syntax is just much simpler and has true range support. Details on the XPath scheme here.

The other big change in this release is that I have refactored the server-side addressing system to be truly generic, so that it is much easier to drop in new addressing schemes. For example, we could create a line() scheme to grab ranges of lines from source code files.

Please note that this software is still in development. In particular, the quote() scheme needs to be tested more, and I haven't done performance work on large documents yet. I wanted to 'release early release often' on this before getting it perfect.

You don't need to host anything to use this. If you want to run your own server, however, here is the ZIP file for you to download. In your HTML you will need to point Purple Include at your custom server using a META tag. See tests/example.html for details on how to do this at the top. The client-side is BSD licensed, the server-side is GPL.

Labels: , , , , , ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]