14 - Consistent link grammar
nav_first.pngFirst: design:1
1 - Rate Module
Edited: 29 Apr 2012 00:01 by: GoVegan
Comments: 21
Tags:
nav_prev.pngPrevious: design:13
13 - Private Module
Edited: 11 Nov 2009 21:58 by: Steven Heynderickx
Comments: 1
Tags:
Last: design:32
32 - Parenthood Module
Edited: 11 Nov 2009 21:47 by: Steven Heynderickx
Comments: 7
Tags:
nav_last.png
Next: design:15
15 - Clone Module
Edited: 11 Nov 2009 15:34 by: Steven Heynderickx
Comments: 9
Tags:
nav_next.png

14 - Consistent link grammar
Created on 24 Sep 2009 13:08
By pieterh

rating: +2+x
This is the Redirect module that redirects the browser directly to the "http://projects.wikidot.com/thread:122" page.

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

  • [[[...]]] is principally used for wiki references
  • [...] is used for general-purpose links

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:

  • If the implicit-target or explicit-target contains spaces, the separator "|" is mandatory.
  • Spaces in a URI are encoded as %20 in the actual HTML.
  • The wiki-link syntax creates backlinks, while the href-link syntax creates linkbacks (yes, confusing!)
  • The default link-text for the wiki-link syntax is the page title.
  • The default link-text for the href-link syntax is the name.
  • The wikidot link with no page fullname generates name.wikidot.com or a custom domain name.

Comments: 25

Add a New Comment