Glacial Erratics

Purple Spreading

May 29, 2004

Jonas M Luster has once again suggested PurpleNumbers as a good aid for doing proper blog sourcing. His posting prompts me to put down some thoughts I've apparently forgotten to record in the past.    (7NP)

Jonas mentions some methods for purpling blog postings:    (7NQ)

There's also EugeneEricKim's plugin for Blosxom.    (7NW)

One large difference between the plugins that Eugene and I use and other systems is that ours use the PurpleWiki libraries to create unique identifiers for each chunk of content. This allows TransClusion of content among blog entries and with associated Wiki pages. Follow the TransClusion link to see this in action or visit PlaNetwork:InternetRelayChat to learn how it is being used with an IRC channel associated with next week's Planetwork conference. In that setup purple numbered content from the wiki and irc logs can be transcluded back into the live IRC chat. That system is using another PurpleWiki related tool: Perplog.    (7NX)

The long term goal of TransClusion in PurpleWiki is to enable to direct granular quotation of content anywhere on the web, making citation sort of automatic. I have a working prototype of TransClusion amongst geographically disperse servers, but the current solution doesn't scale so there's more work to be done.    (7NY)

Another way to purple HTML content is with some Javascript to process the Dom of a page when it is loaded. There's probably a way to automate this, but if you have a page that you would like to quickly purple make these changes to the header:    (7NZ)

   <head>
    <script language='javascript' src='ator.js'></script>
  </head>
  <body onLoad="purp(window.document.getElementsByTagName?('body')[0])">    (7O0)

and in a nearby file (that I've called ator.js) put this:    (7O1)

  var tagsRE=/\bh|p|li|dt|dd|pre\b/i; 
  var nid = 0;
  var purpleStyle = "font-family:sans-serif;font-weight:bold;font-size:x-small;text-decoration:none;color:#C8A8FF"
  function purp(node){
      if (node.hasChildNodes?) {
        var hi_cn;
        for(hi_cn=0; hi_cn<node.childNodes.length; hi_cn++) {
            purp(node.childNodes[hi_cn]);
        }
      }
    if(node.nodeType == 1) {
        if (tagsRE.test(node.nodeName)) {
            var nidValue = "nid" + nid;
            node.setAttribute('id', nidValue);
            newNode = document.createElement('a');
            newNode.setAttribute('href', "#" + nidValue);
            newNode.setAttribute('style', purpleStyle);
            newNode.innerHTML = " " + nid;
            node.appendChild(newNode);
            nid = nid + 1;
        }
      }
    }    (7O2)

I originally posted this in a message to the BlueOxenCollaboratory. The code is adapted from PaulFord?'s The Passivator which itself is adapted from something else. Such is the way of the Internet and it is good.    (7O3)

Comments

1/3
On May 29, 2004 11:13 PM Jonas M Luster said:

I have an early prototype up on jluster.org - the numbers are not yet conformant to standards, and lack resilience against paragraph movements (insertions should be covered, but moving P2 below P4 and P3 above P1 breaks it..), but it's a start.    (7ON)

2/3
On May 30, 2004 10:38 AM Michael Day said:

Using actual *numbers* for purple numbers is quite distracting in the text, I think that Tim Bray's idea of using purple hashes instead is easier on the eyes.    (82Q)

But why add them by hand at all? Why not let the browser create granular links automatically when the user selects text? (I've posted more on this on my blog, which I cannot seem to link to from this comment :)    (82R)

3/3
On May 30, 2004 10:55 AM Chris Dent said:

Using actual *numbers* for purple numbers is quite distracting in the text, I think that Tim Bray's idea of using purple hashes instead is easier on the eyes.  T    (82S)

See my more recent posting that explains why I show the numbers. My reasons won't be relevant for everyone, but they are important for me.    (82T)

But why add them by hand at all? Why not let the browser create granular links automatically when the user selects text? (I've posted more on this on my blog, which I cannot seem to link to from this comment :)  T    (82U)

Who said anything about adding them by hand? All the systems I've mentioned have the computer do it as the document is saved or displayed.    (82V)

Your idea or using the browser to create links when the user selects text is great, but as far as I know that's only available in some versions of Mozilla, and does not offer the same affordances as some of the purple options, some of which are explained in the other posting.    (82W)

I'm very well aware that PurpleNumbers are not an elegant solution, but they are a solution that is here today. That gets us at least two things: something to use, now and something from which we can learn.    (82Y)

To leave a URL, simply enter the URL, it will be turned into a link when the page is presented. If you want a label do something like this Mike's Blog.    (82X)

Sending...