« »
August 13, 2003 » 4:56 pm

Purple Metadata in Blosxom

PurpleWiki supports document metadata. The metadata is stored at the beginning of the document using the following syntax:    (6Y)

  {name value}    (6Z)

Currently, PurpleWiki supports the following metadata:    (70)

All of this metadata is available to blosxom via the purple plugin under the $purple namespace. However, I’d also like to override blosxom’s mechanism for determining an entry’s title and date.    (77)

Sadly, overriding the title mechanism is not possible via plugins, and overriding the date would be extremely inefficient. Blosxom assumes that the first line of a file is the title and the rest is the body. This parsing happens before story() is called. This works fine, but it means that the raw file itself can’t be a pure PurpleWiki document. If blosxom instead passed the raw file and delegated the responsibility for parsing title and body to story(), then anyone would be able to customize this behavior via plugins.    (78)

I also wanted to duplicate the behavior of the entries_index_tagged plugin using PurpleWiki‘s metadata. The way entries_index_tagged works is to compare the current directory tree with a cached tree. If there are discrepancies, entries_index_tagged scans the file for a meta-creation tag. If the tag exists, it uses that information; otherwise, it stats the file for its creation date.    (79)

I could easily pass the file to the PurpleWiki parser to scan for the creation date, but the PurpleWiki parser is expensive, and the parsed file would not be cached. If I opted to use an entries_cache approach instead, where the comparison only happens once an hour, then maybe it wouldn’t be too much of an issue. However, I don’t want this feature badly enough to do this, and frankly, the inefficiency of doing it this way gnaws at me.    (7A)

Tags:

« »

Leave a Reply