XMLTagsEditHistoryDiscussion (4)

Introduction

Ok, Arhuaco and I managed to get a pretty decent svnwiki extension to generate archives for our weblogs.

You can see it enabled here in my weblog, just look for the "Archive" headline in the list of links. I also enabled it in the list of donated books for the Librería de los Freaks Unidos, look for "Libros donados" on the list of links of any of its pages. As you see, it is entirely separate from the weblogs extension.

Right now it does have an issue with users without JavaScript support, but it should be easy to solve.

Using it

I have already enabled it in most of the weblogs in fuwiki, except in those where the CSS and/or menu files indicate that the owner might not expect it. In order to enable it, you need to do three things:

  1. Set the svnarchive:ignore property to yes in all files or directories that you want to exclude from your archives. For weblogs, this probably includes the CSS and the menu (you don't have to do this on xsvnwiki-discuss).
  2. Include the word archive in the value for the svnwiki:handler property for the directory of the weblog. Note that this property very likely already has other words (such as weblog). This enables the code that generates the svnwiki-archives directory with the archive files and the XML and updates it when a new files is made.
  3. Include the tag wherever you want to include the archive. Usually that means the file referenced by the svnwiki:toc property.

Pre-rendered model

Since Svnwiki uses the pre-rendered model, it would normally mean that if a new file is added to or removed from an archive, all the files displaying the archive would need to be regenerated (to update the counter of files for the month affected). Actually, even if Svnwiki didn't use pre-rendered, this would still be true, except that the rendering of files would be delayed to whenever they are requested.

To avoid that problem, we are generating an XML file (example) and inserting JavaScript code that loads it and renders it as HTML inside the pages including the archive. The pre-rendered model, JavaScript and (pre-rendered) XML files play very well together.

Next extensions

What, other than a good RSS generator, do you think would make a very cool svnwiki extension now?

I may rewrite my DIG draft as a svnwiki extension. With this in place, to generate a gallery you'd just commit the image files to a directory, set a few Subversion properties and the extension would pre-render XML, JS and JPEG files so when users visit the directory, they get an interface similar to DIG's.

Discussion (4) Loading... Vote up! Vote down! Save to del.icio.usSubmit Story to Digg

Last update: 2007-03-31 (Rev 10984)

svnwiki $Rev: 12966 $