My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

Ariah: Re-imagine the Web

Ariah is a JavaScript through which Web designers can deploy custom hyperlink relationships and client-side data format converters, in a way that remains accessible for unscripted browsers. For example,

    <a href="readme.text" rel="include" type="text/x-markdown">
      Release Notes</a>

Ariah detects that the author wants the linked resource included as inline XHTML, and that it requires conversion from Markdown format. So, Ariah downloads the file, converts it, and replaces the link with the results. If the browser cannot run Ariah, then the file remains accessible through a normal hyperlink.

Although Ariah implements several built-in hyperlink relationships like "include", "source", and "template", Ariah also exposes a simple JavaScript API so Web programmers can more easily define their own custom relationships among Web pages, as well as their own client-side file format converters (called "hyperformats" in Ariah parlance). Ariah is the class name for the acronym of "Accessible Related Includes and Ajax Hyperformats".

Ariah can use combinations of multiple relationships to help discern what to do with hyperlinks. For example,

    <a href="hf.js" rel="include source" type="application/ecmascript">
      View the <code>hf.js</code> source code.</a>

By adding the term source to the include relationship, the author is telling Ariah not to parse the file normally, but to show the original source text of the file. In this case, if Ariah can find a source formatter for files of type application/ecmascript, then the displayed result will use code-coloring; otherwise, Ariah will insert the source code of the script as plain text.

Ariah also works on head links. For example,

    <link rel="template" type="text/html" href="template.html" />

When placed before Ariah's script element, Ariah will automatically load the "client-side" template file and apply it to the current Web page. Because the head section of the template will run, most recurring scripts, stylesheets, and repetitious design elements can be pruned out of each Web page and into a client-side template. Such a workflow simplifies Web design, streamlines a site's bandwidth, and usually improves accessibility. For example, the template file linked above can be an XHTML file with an empty body, but with a list of primary and alternate template links in its head section:

    <link href="screen.tmpl.htm" media="screen" rel="primary template"
          type="text/html" title="media/screen" />
    <link href="print.tmpl.htm" media="print" rel="alternate template" 
          type="text/html" title="media/print" />
    <link href="hh.tmpl.htm" media="handheld" rel="alternate template" 
          type="text/html" title="media/handheld" />
    <link href="aural.tmpl.htm" media="aural" rel="alternate template" 
          type="text/html" title="media/aural" />
          
    <link href="browse.tmpl.htm" media="all" rel="primary interface"
          type="text/html" title="user/browse" />
    <link href="comment.tmpl.htm" media="all" rel="alternate interface"
          type="text/html" title="user/comment" />
    <link href="edit.tmpl.htm" media="all" rel="alternate interface"
          type="text/html" title="user/edit" />

In such an arrangement, a Web browser can select a template file most appropriate to the medium and a user interface most appropriate to the user's preferred mode. Each chosen template, in turn, can link to its own primary and alternate stylesheets.

Sites using Ariah

Ariah is the next generation of some of my earlier work on client-side includes (c. 1996) and hyperformats (c. 2000) which were stable, but in its current form, Ariah is not. However, interested Web developers can see one of Ariah's ancestors, hf.js "in the wild" on the inner pages of http://grayschoolofmusic.com . The script itself is at http://grayschoolofmusic.com/Scripts/js2/hf.js . The Gray site demonstrates many of the features discussed about Ariah, so feel free to view the source code of its pages.

Future Plans

Because Ariah uses a "markup interface", the Ariah project is planning to help implement native modules for Open-Source Web browsers to accelerate performance of Web pages designed for Ariah. The native modules should be able to activate automatically whenever they detect a link to Ariah script, so acceleration can happen transparently. As a side effect, native Ariah modules may make it possible for Web browsers to cache many popular script libraries in an optimized state to be transparently reused from many Web sites. For example,

    <link href="techst.js" rel="include" type="application/javascript"
          title="http://techst.org/2007/v0-1a/techst.md5.xml" />

A native Ariah module might detect that the techst.js script can be loaded from a cached version with a matching title URI loaded from another site, so long as the digital fingerprint of the cached version matches the hash encoded at the URL in the title field. Otherwise, the file will be downloaded normally from the current host.

Status

Ariah is still in a mid-alpha state under heavy development, so it should not be used in production work. This alpha release has only been tested under Firefox 2.0 and Safari 1.3 on Mac OS X, so it is likely to break other browsers until it goes through the crucible.

Ariah is a symbiotic rewrite of some of my earlier code that was stable under the two latest versions of Internet Explorer, Firefox, Safari, and Opera, each on Windows, Mac OS X, and Linux, where available. I won't promote Ariah to beta status until it passes tests under each of those clients and platforms.

Ariah's alpha download bundles several test scripts that help demonstrate the features described here, with the exception of those described under the "future plans" heading. Several of these scripts are more interesting than Ariah itself, but available nowhere else. See the download's readme and script documentation for more details.

Author

Rich Hall

Powered by Google Project Hosting