Links
 Home 

Links in MemoWiki documents are written using square brackets as markup. The most common are links to other MemoWiki pages.

General format

[ name | content | options ]

All except name are optional. The three parts between the bars are as follows.

  1. name: the name of a page which will be viewed if this link is clicked. Any characters are allowed in page names. However, some characters (], |, @, #, *) are reserved in the above notation, so are best avoided.
  2. content: (optional) text that will appear on the page for this link. All MemoWiki substitution (inline) shorthands may be used. If content is not given then the name is generally used as the content.
  3. options: optional plain-text keywords and parameters. These are used for images and embedded text files, as described below; the first word of options must be either image or text. Words in options are not case-sensitive.
Vertical bars need only be used when there is content and/or options.

Examples:

[Sample page]

[Markup|general markup]

[cowlis2003]

[cowlis2003-DFP-algorism.pdf]

[canyon.jpg | Grand Canyon | image right]

[subdir/an-image.jpg]

[speleo.rex||text code]

[*||gps N43:14:10 W4:43:22 a1277]

HTML and relative links

For compatibility with other Wikis, if a name does not refer to an existing page, reference, or file, and if the first word of the name contains a ‘:’ or a ‘/’, then the first word is assumed to be an HTML reference and is linked accordingly. Any remaining words in the name then form the content (or are prefixed to the content if there is a | present).

Examples:

[http://www.speleogroup.org]

[http://www.speleogroup.org Speleogroup’s home page]

These appear on the page as http://www.speleogroup.org » and Speleogroup’s home page ».

A relative URL can similarly be used to refer to pages explicitly in the same or other MemoWiki projects, for example, [/MemoWiki/Markup].

Within-page links

A position within a page can be identified using a mark link, in which the name starts with ‘@’, for example:

[@tables | tables list]

This generates an HTML anchor with the name ‘tables’, which can be referred to by a local reference link of the same form but with the name beginning with ‘#’, for example:

[#tables | see tables list]

If content is not given, then the name (without the ‘@’ or ‘#’) is used as the content. There may optionally be one or more blanks after the ‘@’ or ‘#’. The name must not include an ‘@’.

A within-page mark can be referred to from another page simply by putting the mark name after the page name, separated by a hash (pound) character, for example: [my page#mark1].

Flagged links

If a name does not refer to an existing page, reference, or file, and if the first word of the name does not contain a ‘/’ or a ‘:’, then the link is assumed to be a reference to an as-yet un-edited page in the current project and is shown with a following red question-mark (?).

Wikipedia links

Simple links to Wikipedia articles may be made directly using the same double-bracket notation as in Wikipedia: [[link | content]]. (This notational support also allows the Wiki2HTML program to be used for rendering Wikipedia articles off-line.)

Images

Minas Crags

Minas Crags

Image files can be included on a page by indicating that a name (which must be a file in the files directory or a fully-specified URL) is an image. To do this, the link must have an options field whose first word is image, and the image file is then included in the rendered page with content being used as a caption.

Additional options may be added as follows:

right float the the image to the right of the page (default)
left float the the image to the left of the page
centre

center

centre the image on the page
width=n set the width of the image to n pixels (default 200)
height=n set the height of the image to n pixels (the default is to preserve aspect ratio for given or default width)
nolink do not make the image an active link (the default is to allow the image to be opened in a new window at its original size)
nocaption do not add a caption; the content will be used only for the ‘alt’ text and pop-up title.

Conflicts are resolved as ‘last option wins’.

The image above and to the right was included using the markup:
  [http://www.speleogroup.org/files/MinasCrags.jpg|Minas Crags|image right width=180]

Geographic locations (GPS links)

A link to a geographic location using GPS coordinates is made by using a placeholder (‘*’) as the name and then specifying an options field whose first word is gps. Additional options may be added as follows:

coordinate A GPS coordinate starting with one of the letters ‘N’, ‘S’, ‘E’, or ‘W’ followed by up to two digits of degrees then optionally a colon and one or two digits of minutes and then optionally a colon and one or two digits of seconds and finally an optional period and fractional seconds. For example: N43:14:10.6
height The letter ‘A’ followed by a decimal height in meters (optional)
show An optional keyword that indicates that (if no content is given) the content will include the GPS coordinates given (for example, N43°14′10″ W4°43′22″).
utm An optional keyword that indicates that (if no content is given) the content will include the UTM coordinates calculated from the GPS coordinates (for example, 30T 360.11 4788.56).
break An optional keyword; if present then a break (<br>) is added after the coordinates generated by show or utm.

Two GPS coordinates must always be given, one starting with N or S and the other with E or W.

If no content is given and neither show nor utm is specified then a Delta symbol is used as the content. For example, [*||gps N43:14:10 W4:43:22 a1277] appears as: Δ. If both show and utm are used, the parts will appear in the same order as the keywords.

Note that all GPS coordinate links in a given project are assumed to use a common GPS datum; this may be changed using the Change Project settings page.

Embedded text files

The content of text files can be included within a page by indicating that a name (which must be a file in the files directory) is to be embedded as text. To do this, the link must have an options field whose first word is text. Additional option keywords may be added as follows:

asis include the text as-is, without rendering MemoWiki markup (the default is to treat the embedded file as though it were part of the originial .wiki page)
code treat the text as program code, displayed in a box (implies asis); for example, [tryme.rex||text code] shows:

/* A very simple Rexx program */
numeric digits 250
say 1/7

Note that when neither option is specified all MemoWiki (and HTML) markup is allowed, including structural markup. Any content field is ignored.


Links was last edited on 2007-12-25  
Project: MemoWiki