Consistent link grammar
nav_first.pngFirst: thread:131
HTML Block
Edited: 11 Oct 2012 12:06 by: GoVegan
Comments: 0
Tags:
nav_prev.pngPrevious: thread:121
Private Module
Edited: 12 Nov 2009 12:27 by: pieterh
Comments: 0
Tags:
Last: thread:112
Image Module
Edited: 12 Nov 2009 12:22 by: pieterh
Comments: 0
Tags:
nav_last.png
Next: thread:138
Permissions Module
Edited: 12 Nov 2009 12:26 by: pieterh
Comments: 0
Tags:
nav_next.png

Steven HeynderickxSteven Heynderickx wrote on 10 Nov 2009 15:47

Originally suggested by pieterhpieterh on 24 September 2009.

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.

Start a new sub-thread

We discourage direct comments on this thread: to discuss it, please start a sub-thread.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License