Contents tagged with Wikis
I finally figured out what everyone has known for awhile - Writely rules. I've setup an account and have been messing around with it in between taping my sports show this afternoon. I've previously used the roaming collaborative environments Basecamp and WriteBoard from 37Signals before with the Podcast Specification Working Group, and those were really fun.
One thing I'm playing with at the moment is a test module that will work with the ASP.NET page model's OnTextCnanged event, to displayed changed content in subsequent versions of a wiki web page. So for instance, in a document I wrote yesterday, I edit the content and post the update to the server.
Upon looking at the changed content, a small Label control (or other visual device) shows the precise area(s) that were changed between versions, and highlights them as such.
One of the things that bugs me about wikis these days isn't that the majority of them rely on some sort of standard string pattern (often CamelCasing) to identify internal links that point to destinations within the wiki containing content on that subject - it's that the links are quite often presented as CamelCasedLinkTextWhichCanGetHardToReadAndIsUgly. Get it?
Providing normal-looking links in a large wiki application is something WikiPedia does extremely well. Considering the literal millions of content areas it features, it renders links as real words, not garbled text. In my opinion, this is a user experience towards which we should all aspire.
I believe in form as well as function, so below is code I developed for a wiki parser component that allows text entered into a TextBox to accept camel-cased syntax for automatic link assignment, but then displays the link-worthy hypertext as normal dialogue, without words bunched together.
<%@ Page Language="C#" %>Thanks to Dave Wanta from 123ASPX.com and AspNetEmail for his contributions.
<%@ import Namespace="System.Text.RegularExpressions" %>
private string camelCase = @"[A-Z]\w*[a-z]\w*[A-Z]\w*(?=\b)";
private RegexOptions options = RegexOptions.Compiled;
private void btnSubmit_Click(Object sender, EventArgs e)
// parses the text and return custom-formatted HTML
lblParsed.Text = Regex.Replace(txtFirst.Text.Trim(),camelCase,new MatchEvaluator(this.FormatWikiText),options);
lblParsed.Text = lblParsed.Text.Replace(System.Environment.NewLine,"\n\t<br/>");
private string FormatWikiText(Match m)
return "<a onmouseover=\"this.style.backgroundColor='#6699CC';\"
onmouseout=\"this.style.backgroundColor='#ffffff';\" href=\"/content/" + m.Value + ".aspx\">"
+ BreakCamelCasing(m) + "</a>";
private string BreakCamelCasing(Match m)
// add a blank space in between each uppercase letter within the camel-cased word
string s = m.Value;
if((s == null) || (s.Length == 0))
StringBuilder sb = new StringBuilder();
sb.Append(s); // ignore the first character in the word
for(int i=1;i<s.Length;i++) // count from the second character on
char c = s[i];
<h3>Sample Wiki text parser
<asp:TextBox id="txtFirst" runat="server" Width="693px" Height="237px" TextMode="MultiLine"/>
<asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Parse this text for the wiki"/>
<asp:Label id="lblParsed" runat="server"/>