Wiki musings: one living document

Thursday, 9 Dec 2004

In pondering how to best implement in-page anchors in wikis, I thought of how MediaWiki lets one edit parts of a page separated by headers as separate pages. It occurred to me that if it is worth linking to, it is worth having its own page. In other words, rather than linking LoremIpsum#DolorSitAmet it would be LoremIpsum/DolorSitAmet, resulting in the DolorSitAmet section of the LoremIpsum page displayed as a separate page.

It’s hardly a leap to imagine that you could edit these pages independently of their neighbouring content, but things really get interesting once you start extrapolating the idea along the lines of actually having these subpage sections treated as first-class pages, versioning them separately, listing them on RecentChanges in some form, etc.. Taken further yet, references to the DolorSitAmet section could be allowed to omit any mention of its LoremIpsum superpage so long as the section name alone is unambiguous within the wiki (and if it is, you could present a reader who follows the link with a page offering a choice of pages and sections in pages which have that name). Effectively, the distinction between the wiki as a whole and the individual pages inside it disappears – the entire wiki becomes a single document, and every individual document becomes a wiki.

The challenge is how to properly infer changes to subpages from modifications to the superpage in complex scenarios such as when section titles are edited at the same time as new sections are added.

A related problem (associated more with the use of this feature rather than intrinsic to it) is that this approach makes referrential integrity in the wiki particularly easy to break. As it is not intrinsic, that problem is probably best solved on the user interface side: when the wiki detects that an edit would break links on other pages, the user must be alerted and, ideally, assisted in preserving correctness. One possible approach is for the wiki to interject once the user tries to commit, offering textareas for all of the the pages with links that would break. These textareas should contain only a sentence or two of context for the link, and should probably have the likely changes already applied to them and highlighted in some fashion. Thus, the user can simply rubber-stamp all changes where the automatic suggestion is satisfactory. Submitting this intermittent form would commit all changes atomically, ensuring that the wiki never is in an inconsistent state. RecentChanges should also be educated to display should changes in aggregate, rather than separately.