00106: Add cookbook entry describing relative image URLs

Summary: Add cookbook entry describing relative image URLs
Created: 2004-10-19 15:14
Status: Closed - added as Cookbook:RelativeLinks
Category: Cookbook
From: Pm
Assigned:
Priority: 55553
Version: all
OS:

Description

There needs to be a cookbook entry that describes how a wiki administrator can enable relative image urls.

I'd like to see [[/dir/file.name]] work in the same way as a webmaster would expect <a href="/dir/file.name"> or <img src="/dir/file.name">
For images that were http://foo.bar.com/img/x.gif I suggest [[|/img/x.gif]]
-Simon

Comments by Christian

  • Such a markup should not be restricted only to referring to local files, it should work just as well referring to a local file.
  • I'm worried that simply using [[/Dir/SomeFile]] might interfere with a page reference - primarily if we are referring to a file without an extension.
    • If we ever go for page hierarchies, the syntax given above would probably interfere with this.
  • Plain [[/Dir/SomeFile]] is a bit too similar to page links IMO.
  • Here are some suggestions for alternate ways:
 
	[[local:/dir/some/file]]	-> /dir/some/file
	[[dir:/dir/some/file]]		-> /dir/some/file
	[[file:/dir/some/file]]		-> /dir/some/file
	[[//dir/some/file]]		-> /dir/some/file
	[[cwd:/dir/some/file]]		-> /dir/some/file
	[[cwd:some/file]]		-> ./some/file

In a wild revelation of ignorance - John Morris offers:

Doesn't Intermap already serve this function in an acceptable manner?

maplink:imagename.ext seems pretty simple.

Would it not also suffice for the other requirements?