Version 10 of Wikit Reference Formatting

Updated 2003-09-09 16:37:37

This page started out as a modification to format.tcl to allow labels to be specified in references. It has since grown to change the way paragraphs are interpreted, unfortunately it isn't easy to split the changes out into two patches.

The new formatting rules are:

  1. You can refer to another page by putting its name in square brackets like this: [TITLE]. To specify a label use: [TITLE | LABEL]. Note that the separator is " | " (space, vertical bar, space).
  2. URLs will automatically be recognized and converted into a hyperlink: http://your.site/contents.html . To specify a label use [http://your.site/contents.html | LABEL]. Once again, the separator is " | " (space, vertical bar, space). The label will be displayed within square brackets.
  3. Paragraphs are ended by a blank line. A carriage return in the source indicates that a new line should be started in the current paragraph, i.e. a soft return. This affects standard text and list items (bullets, numbered lists and tagged lists).

My personal belief is that the change to the paragraph interpretation is still fairly intuitive, but provide much more flexibility control over the final appearance. I expect that not everyone will agree with the changes.

As you can see, this will implement the changes suggested by jcw below (thanks for the suggestions).

The patch is against Wikit version: 2003/08/20 19:06:22 68261-69214


patch to be supplied


03sep03 jcw - I have two comments on this. Main one is that of the three ways in which linking is supported in this wiki, I suggest only adding the "| text" label trick on urls of the form:

  ... [http://blah | blurb] ...

The reason for this is that right now, one always knows what clicking on a link does:

  1. if it looks like an url, that's where it goes
  2. if it has no brackets, hyperlinks are always within this wiki
  3. if it shows in brackets, then you cannot assume the link is local

The label rules you're introducing break this model. I'd rather not introduce the ability to have a link show as a page title which turns out not to be one, nor for example to click on what looks like an url, but ends up being a completely different one. Hence my suggestion to only allow labeling bracketed external urls.

My other comment is about the use of pipe as separator. Souns like a good choice, but to break fewer cases of current url's having "|" in them, I suggest splitting on "<space> | <space>", and on taking the very last such occurrence. Code to do this could be:

    # Split "url | tag" into two parts, if they exist.
    # Based on code written by AKG, see http://mini.net/tcl/9733

    proc SplitTitle {text} {
      if {[regexp {(.*)\s\|\s(.*)} $text - a b]} {
        set a [string trim a]
        set b [string trim b]
        if {$a ne "" && $b ne ""} {
          return [list $a $b]
        }
      }
      return [list $text $text]
    }

If someone wants to pursue this and figure out how to make the changes in format.tcl, please do... I'll be happy to integrate such a patch.

09sep03 CM - I have a patch to offer but it is not implemeting the same spec :-). I have added the functionality of labels only for "http:// " type of URL (i.e., unbracketed) but I fully agree with your remark that it should be possible to distinguish between a wiki page and an external link. I have added some CSS style to perform this distinction (different colors and a small icon for labelled external links) but the idea of surrounding with brackets like the numbered pages is actually quite nice too (my code would need to be fixed for this though). I also prefers the label@http-url syntax because on other wikis we see a mix of "url | label" and "label | url" conventions and people tends to get confused on which order to use. We've been using the "@" convention internally for quite some times now and people get easily accustomed with it. Also if the functionality labels for urls seems "nice to have" I do not see the needs of having labels for wiki pages, that would mean the page name is broken, and seems quite un-wiki to me.. :-)

JC, let me know if you are interested in some of the features I have been porting from my very old modified wikit-impl (from 2001) to the newest code. I detailed the list of ports in Ideas for Wikit enhancements early August. I am sorry not to have patches available feature by feature.. as I basically dedicated some time this summer to get the max I could in the current code. Also I do not intend to get all my experiments accepted in the official wikit but tell me if some features appeal to you.


Category Wikit