[pmwiki-users] Markup for linking to page with a "unique" identifier

Frank Graffagnino frankie at graffagnino.net
Sun Aug 12 09:11:11 CDT 2007


> Date: Sat, 11 Aug 2007 23:27:16 +0200
> From: christian.ridderstrom at gmail.com
> Subject: [pmwiki-users] Markup for linking to page with a "unique"
>         identifier
> To: pmwiki-users at pmichaud.com
> Message-ID: <Pine.LNX.4.64.0708112320420.6276 at ssh-01.md.kth.se>
> Content-Type: text/plain; charset="iso-8859-1"
>
> A user (actually Jose', a LyX developer) asked me about renaming pages and
> automatically having links to the renamed page working. He suggested that
> pages should have some ID (or label) that you could refer to rather than
> linking to the name of the page.
>
> I replied that this is already possible by using (:pagelist ...:). It can
> be done as follows:
>
> * Insert a marker/label/tag on the destination page. It could e.g. be as
>    follows:
>         (:comment tag_some-id :)
>
> * To link to that page, use something like:
>         (:pagelist "tag_some-id" fmt=#... :)
>
> As long as the "tag" stays on the page, the pagelist markup will find it
> even if the page is renamed. In theory this seems nice, but are there some
> drawbacks here?
>
> * Perfomance?  What happens if something like is used extensively?
>
> * Uniqueness of id:s?   Maybe a mechanism is needed to help keep the id:s
>    unique?
>
> * Maybe a simpler/clearer markup would be useful?
>
> Thoughts?
>
> Best regards,
> Chrstian
>
> --
> Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr
>

I have a couple of suggestions.  One would be to use a unique pagetext
variable to store the unique id.  Then the pagelist would become:

 (:pagelist $:pagetagid="tag_some-id" fmt=#... :)

the ensures that a pagetext variable called "pageid" is defined as well.

For uniqueness, if you were going to automate it... perhaps the ctime
of the page would be sufficient?

FG



More information about the pmwiki-users mailing list