Wvn2: A Browser for Code Repositories

Tim Menzies, 2009

I've always been bothered by content management systems- pretty GUIs, hard to do bulk edits of many pages, overly-complex installation.

Wvn2 is Less, But Better experiment to see if I can do better than that.

But best of all, the task of maintaining the system can be shared by all developers with access to that repository.

Wvn2 stores all its configuration details as data files in the repository. For example:

To configure the system, edit the first line of Wvn2's index.php to include a reference to the right config.xml. For example, this line tells Wvn2 to use a "config.xml" file one of of my code repositories.

$slurping="http://unbox.org/wisp/var/timm/09/ai/etc/config.xml";

This means Wvn2 can generate brows-able source code if the developer includes html tags within their comments. "Config.xml" knows about a set of magic file name extensions. If Wvn2 reads those files, it strips off any single comment characters found at front of line, then renders the file as html. For example, here is a browse-able display of the file utils.lisp:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This file is part of AIslash.
;
; AIslash is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; AIslash is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with AIslash.  If not, see .
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;<h1><join>I love traffic lights</join></h1>
;<P>Especially when they are green.
;<<pre>
(defun aa (x) 
  (+ x 1)
)
;</pre>

Note that Wvn2 skipped over the first paragraph of utils.lisp when it rendered it. This means developers can control the details shown on the web. Tedious details such as change control information or copyright notices can still be added to the raw file and these will not be displayed.

The "config.xml" file can (optionally) be used to store meta-information about the file. For example, Wvn2 supports a category system and these categories care defined in "config.xml". For example, the file "doc/proj3a.html" is one of the "Cs472" and "Projects" pages. It was written by "Timm" in "Jan" of "2009".

<?xml version="1.0"?>
<things>
  <strings>
    ...
  </strings>
  <files>
    <file where="doc/proj3a.html">
      <title>Project 3a</title>
      <what>Cs472</what><what>Projects</what> 
      <what>Timm</what><what>Jan</what><what>2009</what>
    </file>
    ....
  </files>
</things>

Wvn2 allows for queries to the category system. For example, the URL http://menzies.us/ai?Timm&Jan&2009 will find all pages categorized as written by me in Jan'09.

The category query system imposes some constraints on the system: file names have to start with lower case and categories have to be all upper case.

That's it. The current code base is 107 lines long which is close enough to 100 to allow me to retain the name Wvn2. I'm not sure how well it will scale and I don't know if having a whole community writing to a single "config.xml" file is a good idea. Also, there is no syntax highlighting of source code and the code base is about a week old so it will contain bugs. But, the code for Wvn2 is available index.php on-line so you can (maybe) find and fix some bugs for me.

Share and enjoy.