[pmwiki-users] Link markup for external links that pulls in the title

J. Meijer commentgg at hotmail.com
Mon Apr 16 08:56:18 CDT 2007


On 4/14/07,  christian.ridderstrom at gmail.com  wrote:
The markup
        [[Some page|+]]

creates a link to SomePage and replaces the link text with the titile of
that page. I'd like to be able to do the same when using intermap
prefixes, i.e. if I've defined a prefix such as:

        LyXBug:         http://bugzilla.lyx.org/show_bug.cgi?id=$1

I would like to be able to do

        [[LyXBug:3232|+]]

and have the link text be replaced of the title of that _external_ web
page.

I am aware that this requires reading the external web page and parsing it
for the title.

> Has anyone done anything like this?




I haven't. 

But it would be a nice application for a ROSPattern. On second thought I don't think it would be desirable to have the page check remote pages every time it is saved. 

So, maybe it is better to add the title when rendering. It would come from a Site.TitleCache page, containing a table of the external pages referenced and their title. If no title can be extracted automatically, such a title could be added manually, on this page. 

For unknown titles a rewrite mechanism could render the cryptic link into something more legible. This may have other good uses :) 

The same mechanism could probably be reused to auto-associate alt-text with uploaded images. And be done with that. 

/jm




As a side-note, this is also an example of an all numeric pagename. I think in such cases it would be desirable to have pmwiki render pagelists with the title, *regardless* of the link format (titled or not). 
So [[123456 | ++]] would render with the title of the page 123456, if it exists. (as [[123456|+]] already does). 
[[MyPage | ++]] would render by default AsSpaced, so as 'My Page'. 









_________________________________________________________________
Live Search Maps – find all the local information you need, right when you need it.
http://maps.live.com/?icid=wlmtag2&FORM=MGAC01


More information about the pmwiki-users mailing list