]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/wikilink.mdwn
debbe7305a8b109e37f6c3a57c7f024b7657b765
[ikiwiki.git] / doc / ikiwiki / wikilink.mdwn
1 WikiLinks provide easy linking between pages of the wiki. To create a
2 [[WikiLink]], just put the name of the page to link to in double brackets.
3 For example `\[[WikiLink]]`.
4
5 If you ever need to write something like `\[[WikiLink]]` without creating a
6 wikilink, just prefix it with a `\`, like `\\[[WikiLink]]`.
7
8 There are some special [[SubPage/LinkingRules]] that come into play when
9 linking between [[SubPages|SubPage]].
10
11 Also, if the file linked to by a WikiLink looks like an image, it will
12 be displayed inline on the page.
13
14 WikiLinks are matched with page names in a case-insensitive manner, so you
15 don't need to worry about getting the case the same, and can capitalise
16 links at the start of a sentence, and so on.
17
18 It's also possible to write a WikiLink that uses something other than the page
19 name as the link text. For example `\[[foo_bar|SandBox]]` links to the SandBox
20 page, but the link will appear like this: [[foo_bar|SandBox]].
21
22 To link to an anchor inside a page, you can use something like
23 `\[[WikiLink#foo]]`
24
25 ## Preprocessor directives and wikilinks
26
27 ikiwiki has two syntaxes for
28 [[preprocessor_directives|PreprocessorDirective]].  The older syntax
29 used spaces to distinguish between preprocessor directives and
30 wikilinks; as a result, with that syntax in use, you cannot use spaces
31 in WikiLinks, and must replace spaces with underscores.  The newer
32 syntax, enabled with the `prefix_directives` option in an ikiwiki
33 setup file, prefixes directives with `!`, and thus does not prevent
34 links with spaces.  Future versions of ikiwiki will turn this option
35 on by default.