[pmwiki-users] [PATCH] create links to individual changes on history page

Johannes Winkelmann jw at smts.ch
Tue Aug 15 05:38:38 CDT 2006


On Mon, Aug 14, 2006 at 08:45:34 -0500, Patrick R. Michaud wrote:
> On Mon, Aug 14, 2006 at 01:10:25PM +0000, Johannes Winkelmann wrote:
> > Hi,
> > 
> > For a setup of ours, we wanted to link directly to particular wiki
> > changes from the history. To achieve this, I've introduced a link anchor
> > using the timestamp of a change, allowing to link via
> >   ?action=diff#<timestamp>
> Nice!  This is a good idea for the core.
Cool :-)

> Thinking a bit larger for a second, I've been working on improving
> date/time handling throughout PmWiki, primarily to be able to also 
> address the issue of viewing a page as of some point in its history.
> So, if we have such date/time routines available, should we generate
> anchors something like "#20060807071547" instead?  (And, if we
> do, do we use a local timezone or a UTC timezone...?)
I personally would stay with the timestamps, to ensure we can have
persistent links without confusing the user: 
- if we'd use the local timezone setting, a static, previously generated
  link (e.g. on Recent Changes page) could become invalid after a
  timezone change
- If we use generate a UTC time string (which would guarantee
  consistent links) it'll differ from the date shown on the page for
  setups where the local timezone is not UTC, which could be confusing 
  for the user ("why does it say 12:24 in the url, but 10:24 on the

Using the "seconds since epoch" timestamp is obscure enough to avoid the
later :-), while also giving us persistent links.

That said, I don't really mind either way, assuming that the links stay

> Lastly, note that HTML requires that all "id" and "name" values
> begin with a letter ([A-Za-z]), so technically "#1154934947" and
> "#20060807071547" aren't valid anchor names [1].  It might not
> matter for something as esoteric as ?action=diff, but since it
> is being generated by $CurrentTimestamp some validators might notice
> and complain.
Ah okay, I wasn't aware of that, thanks. I guess prepending an 'id'
string would not only solve the standard incompatibility, but also make
it clear that's it's meant as a change identifier rather than a date

I've created an updated patch with a configurable but internal prefix
for the anchor to avoid configuration errors:

I assume the variable names should be shortened a bit, but figured for
now it would make discussion easier.

> Thanks again!
Thanks for your comments, and the work on pmwiki in general!

Regards, Johannes
Johannes Winkelmann              mailto:jw at smts.ch
Zurich, Switzerland              http://jw.smts.ch

More information about the pmwiki-users mailing list