[pmwiki-users] [PATCH] create links to individual changes on history page
Johannes Winkelmann
jw at smts.ch
Mon Aug 14 08:10:25 CDT 2006
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>
I also added a small link (using a hashmark as link text) to allow
copying a link to a particular change on the history view, i.e. for
e-mail exchange/discussion. An example of how this looks like can be
found here:
http://www.ife.ee.ethz.ch/qbic/wiki/Main/QBICBuildroot?action=diff
direct link to a change:
http://www.ife.ee.ethz.ch/qbic/wiki/Main/QBICBuildroot?action=diff#1154934947
I also exported a new variable $CurrentTimestamp similar to
$CurrentTime, allowing to change the formatting on the RecentChanges
pages to something like:
$RecentChangesFmt['$Group.RecentChanges'] =
'* [[$Group/$Name]] ([[$FullName?action=diff#$CurrentTimeTimestamp|diff]]) . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
which will display a '(diff)' link next to each change, linking directly
to a particular change. Again you can find an example here:
http://www.ife.ee.ethz.ch/qbic/wiki/Main/RecentChanges
Finally, the patch is at
http://jw.tks6.net/files/pmwiki-history-anchors-and-links.diff
with an alternate version omitting the anchor link text at
http://jw.tks6.net/files/pmwiki-history-anchors.diff
Note that the patches include a description text, so the real changes
affect three lines of code only :-).
I'm not sure if this is interesting for others or even inclusion into
pmwiki, but it's been quite helpful for us and I'd appreciate to get
some feedback here.
Regards, Johannes
--
Johannes Winkelmann mailto:jw at smts.ch
Zurich, Switzerland http://jw.smts.ch
More information about the pmwiki-users
mailing list