No activity today, make something!
cdent-mt Purple Number Identity

20161127112035 cdent  

I sat down tonight to write something about PurpleNumbers, as I have several things I need to write for the 0.2 release of PurpleWiki. This is what came out. It fills a different, but similar, purpose to the coolness draft.

What is a purple number?

A purple number is an identifier unique to a document or set of documents used to indicate and provide direct access to segments of content in a document.

In practice a purple number identifies structural elements in a document such as headers, list items and paragraphs. When a new document is created or content is added to an existing document, the document is parsed to add identifiers where they are not already present. When a document is processed for presentation (usually, but not always, to HTML) these identifiers are used to create anchors and links in the document that can be used for later reference.

Purple number identifiers are known, for reasons of history, as node identifiers, or 'NIDs' for short.

In simple implementations NIDs are unique per document and may be generated per page, perhaps as a series of integers. More complex implementations create NIDs that are unique across a domain of documents. These NIDs are generated from a central sequencing source or service that provides the next available NID. If NIDs are paired with document identifiers (usually URLs) to create an index, references may be made by NID alone (some uses for this are described below).

When a document that has been processed to add NIDs is presented as HTML, the NIDs are shown as links (<a href>) to named anchors (<a name>) within a stable URL for the current document. In some current implementations these links are shown in a purple color (thus the name).

If the identifiers used are human readable (short, sensible), there are benefits to displaying the identifier as the text of the link: reference can be made to the identified segment of content in speech. When the identifiers are more complex a single character, such as the '#' popularized as a permanent link in some weblogs, has proven to work well.

Current purple number implementations process text, wiki formatted text, or HTML to either specially formatted wiki text or HTML. The resulting wiki text or HTML embeds text containing the NIDs for each segment of the document. When HTML or wiki text that contains NIDs is reprocessed that text which has already been assigned a NID keeps it's existing NID and that text which is new gets the next NIDs provided by the sequencing service. If content is deleted, NIDs must not be reused as references to NIDs must be allowed to go stale when content is removed.

HTML presentations of content with purple numbers adjusts the content in two ways to provide two different functions: the href provides the text of the URL that can be copied to make reference from other environments; the named anchor provides the location to which that reference points. The value of the name attribute of the anchor is the NID.

When NIDs for a set of documents are created from the same central source and the NIDs are paired with the URLs of the document in which they are to be presented the resulting index can be used to remotely make reference to content by NID alone. This has several benefits:

  • Simplified URLs can be used to refer to content.

  • By updating the index, content addressed by NID can remain addressable even when moved to a new URL.

  • Content can be referenced and retrieved by NID and then easily parsed out of its context by NID. This allows for transclusion (include by reference rather than copy) of content from one document in another.

There are several existing implementations of purple numbers. Some examples are:

PurpleWiki
A descendant of UseModWiki that supports purple numbers. Version 0.1 with support for document based NIDs has been released. Version 0.2 with multi-document NIDs, document authoring features (metadata management), more modular code and transclusion support is being developed. Update 2003/06/02: PurpleWiki 0.9.2, faster, better stronger, has been released to CPAN.
PurplePlugin
A MovableType plugin that uses PurpleWiki 0.2 to format entries with purple numbers, to support transclusions and to provide WikiBlog functionality to MovableType.
Mhonarc purple plugin
An addition to the mhonarc mail archiving system that provides purple numbers on mail messages. source, demo.
Purple ZWiki
Modifications to ZWiki to support purple numbers. demo.
PurpleSlurple
A proxy system that adds purple numbers to existing HTML documents anywhere on the net.
Purple
A processing system for creating documents with purple numbers.

See also: PurpleNumbers, PurpleWiki, PurplePlugin, TransClusion and the rest of the geek-glaxon category.