This set of changes cleans up the inconsistencies between different types of links, and adds some necessary new functionality.
We have two kinds of links (to pages, ignoring other kinds of URI link such as
Link grammar:
link = wiki-link | href-link
wiki-link = "[[[" [ "*" ] explicit-target | implicit-target [ "|" ] [ link-text ] "]]]"
href-link = "[" [ "*" ] explicit-target [ "|" ] [ link-text ] "]"
implicit-target = [ category ":" ] page-name
page-name = string # With no category name
explicit-target = anchor
| absolute-uri
| relative-uri
| page-fullname
| email-link
| wikidot-link
| interwiki-link
anchor = "#" [ text-string ]
absolute-uri = scheme domain "/" implicit-target [ page-args ] [ anchor ]
scheme = "http://" | "https://" | "ftp://" | "gopher://" | "news://" | "mailto:" | "mms://"
relative-uri = "/" page-fullname [ page-args ] [ anchor ]
page-fullname = category ":" page-name
email-link = recipient "@" email-domain
wikidot-link = ":" site-name [ ":" implicit-target [ page-args ] [ anchor ] ]
interwiki-link = ( "wikipedia:" | "google:" | "dictionary:" ) name
page-args = ( "/" name "/" value ) ...
Notes:
Also, could we make extended links within the internal links? For example:
Currently, the above links to the page /contact-edit-true. This would help, because it means we'll be able to track backlinks of pages and still providing extra functionality. Another good example would be this:
With the above design, this is how it works. Addresses are totally consistent, so /page/var/value means the same whether it's in a wiki link or an href link. In fact part of what prompted me to write the design was when I tried to make a link [[[/system:page-manager/created-by/%%created-by%% | %%created_by%%]] and realized it was turning that into /system:page-manager-created-by-whomever.
Consistency is more valuable than gold.
Portfolio
I don't understand how the interwiki link works.
So that will make a link to http://blog.wikidot.com with the link text being "design:14". But how do we link to the page design:14 on the other wiki? Is it like this:
Which would link to http://blog.wikidot.com/design:14 with the link text being "See the design". Is this correct?
Good question. I'd not foreseen a page name in the wikidot: link but it should be there. I've fixed that, so now [:blog/design:14 this page] would be valid. It becomes fully consistent, all these are valid:
Post updated to show new syntax for Wikidot links
Portfolio
Shouldn't [[[wikidot:blog/design:14]]] mean page blog in category wikidot on current site with /design:14 appended to args or do we strict-count slashes and count on this heavily?
Also I don't see the explanation of why this is an interlink in the design, instead it says :blog:design:14 is the proper link.
Using idea from hartnell, interwiki syntax could be sitename::[page_fullname]. But if current proposal for interwiki links is :site:page_fullname it seems equally good.
Also there is a problem with using square brackets in normal text like this [see below], or click [edit] (to mimic button appearance). With this link design, they will become links.
Piotr Gabryjeluk
visit my blog
Sorry, the comment was out of date: I'd already updated the syntax to work unambiguously:
For using square brackets in normal text… good point. However, note that the new syntax insists on a fullname, with category:pagename. So it would be [_default:start] and not [start]. I need to add support for a page shortname for internal links only. It's not needed for href links.
Portfolio
Nope.
Design says:
href-link = "[" [ "*" ] link-target [ "|" ] [ link-text ] "]"
link-target can be page-fullname
and
page-fullname = [ category ":" ] page-name
which means:
"[edit]" is a valid link in current grammar.
Piotr Gabryjeluk
visit my blog
You're right! My eyes were deceiving me. Amazing how the mind works sometimes.
OK, what do you think about the solution I proposed; that a full link needs a full page name, so [_default:start] is a link but [start] is not, and [[[start]]] is a link…?
Portfolio
And, obviously, [http://mywiki.wikidot.com/start] is a link, then.
Portfolio
It seems not to break too much, but still, all of this increases number of ways you can make a simple link. This scares me a bit.
And if we actually have now different syntax inside of two link types (so it doesn't make them consistent) I would suggest again, to improve only one of syntaxes, allowing both kind of links in it and then deprecate the worse one. I would like to discuss this, but if you can for a minute forget how much you have the "[[[" links :-P (if this would make you hate them less, I would suggest typing "[[[" should automatically insert "]]]" after your cursor).
Piotr Gabryjeluk
visit my blog
I don't mind a lot of functionality if it gives us consistency, which this does, except for the shorthand for pages in the default category. It's a consistent design with one optimization for very common cases. Easy to understand, easy to learn and use. Fine.
The reason for keeping both types of link is that one does backlinks and the other does linkbacks, orthogonally to the link itself. If we treat backlinks and linkbacks seriously, we need to be able to switch between link styles without changing the insides.
So this design separates different aspects that are co-mingled in an unpleasant way today.
Automatically adding ]]] is a smart idea, I suggest you create an issue for that. Also a shortcut like Ctrl-L to insert a link.
Portfolio
In my opinion sending Pingbacks and making Backlinks should only depend on what you link to and not on the link format you use, (so each time you make a link to some Wikidot page, that page should get a backlink (or if different wiki, this can be a pingback if we eventually capture them). And each time you make a http:// link, that external page gets a pingback.)
Piotr Gabryjeluk
visit my blog
That makes sense. In which case we can simplify the whole thing right down to:
- [[[ ]]] is for internal simple wiki style links
- [ ] is for all other links
and the changes here apply only to the full link format. Then the only reason for allowing the wiki style link is to do classic wiki-style mangling to turn words into page names.
Portfolio
Yes, this makes sense.
But, in fact, "classic wiki-style mangling" is the most common way to insert links. And this is why people use this link syntax more, and make mistakes like this:
People only use the "[url text]" format when they discover, the "[[[url | text]]]" does not work with URLs. And then once they are gurus and create Wikidot-based applications, to do stuff like "[/%%fullname%%/edit edit]".
So this change would help 5% users, and still leave 50% of them with the old link problems.
Piotr Gabryjeluk
visit my blog
Exactly. This is why I don't like two separate link formats. OK, we have them historically but they just create pain. So the fully general design (plus single optimization) works for everyone.
Portfolio
OK so let's start from the beginning.
What's the problem? The problem is people use the syntax they are used to ([[[this | syntax]]]) to create URL links, which does not work.
Possible solutions:
What's wrong with #1? To create a simple link to page, you need to:
And the problem with this is that you need to use "|" for some links, and for other ones you don't.
What's wrong with #2?
but, it makes links really visible in the source and unlikely to be there by accident and enables link having "[button like]" descriptions. As I suggested, the "]]]" part may be added automatically, so it's not that much more typing from [this syntax].
Piotr Gabryjeluk
visit my blog
I think [ and ] is good as it is.
Extend [[[ and ]]] to allow external links — problem solved, right?
To have ]]] to appear automatically after typing [[[ would also be a great addition (suggested by Gabrys I think)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
[ anchor ] [ page-args ] should rather be [ page-args ] [ anchor ]
All currently supported (and maybe more) schemes should be taken into account: "http://" | "https://" | "ftp://" | "gopher://" | "news://" | "mailto:" | "mms://"
We might consider page-args follow the W3C recommendations (see Wikipedia Query string):
page-args = "?" name1 "=" value1 [ ( "&" name2 "=" value2 ) … ]
page-args = "?" name1 "=" value1 [ ( ";" name2 "=" value2 ) … ]
and — for backwards compatibility only — also to support the existing syntax.
@Erich, thanks for these fixes and improvements. The page arguments must be encoded into the URL address part so that they reflect different cached pages. Using the ?var=value syntax would not work with caching. (This is what I understand but I'll double check with Michal.)
Portfolio
relative-uri still shows wrong sequence [ anchor ] [ page-args ]
Fixed it, thanks.
Portfolio
For the newbies, in the link grammar above,
"|" means or
"[ …]" means optional
External links are not described, yet.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
And three dots indicates repetition.
What do you mean by this? The href-link describes external links.
Portfolio
No.
Currently absolute-uri only refers to wikidot-domain …
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Ah, my error! Fixed it, thanks.
Portfolio