Vincent Massol wrote:
Hi devs,
Someone on the list asked how create a link and an image pointing to a
relative reference (that he got using one of XWiki's API since they
all return relative URL). We currently don't have a good solution for
this and I'd like to propose a solution.
For links
=======
Make the usage of a prefix that specifies what comes next a generic
feature. We have the following needs:
* link to a URL
* link to a relative path
* link to a document
* link to a mailto
* link to an attachment
I propose the following syntax:
[[label>>prefix:value]]
where prefix = one of http:, path:, doc:, mailto:, attach:
In addition I propose that when there's no prefix or if the prefix is
an unknown prefix then to consider that the reference is a reference
to a document (equivalent to doc:).
Pros:
* Generic
* Ability to add more prefixes later on (for ex ftp:)
* Ability to have virtual wikis which have "reserved" names such as
"doc", "http", "ftp", "mailto", etc since you can
write
[[doc:doc:Space.Page]]
* Ability to write shorthand for documents in the text, such as: "This
is a link doc:Space.Page"
* Ability to reference relative paths and write stuff such as
{{velocity}}[[label>>path:$xwiki.getURL(something)]]{{/velocity}}
For images
=========
* Similar to links add the ability to add prefixes in a generic way.
We have the following needs:
* image where the source is at a URL
* image where the source is at a relative path
* image where the source is in a document
I propose the following syntax:
image:prefix:value
where prefix = one of http:, path:, attach:
Note that we already support image:http://... so the proposal here is
simply to make it generic.
In addition I propose that when there's no prefix or if the prefix is
unknown then to consider that the image is to be found in a document
(equivalent to attach:).
Same pros as above.
Here's my +1
+1
What's the cost of changing the wiki separator to ::, as in
doc:mywiki::Space.Document?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/