aboutsummaryrefslogtreecommitdiff
path: root/doc/ikiwiki/wikilink.mdwn
blob: debbe7305a8b109e37f6c3a57c7f024b7657b765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
WikiLinks provide easy linking between pages of the wiki. To create a
[[WikiLink]], just put the name of the page to link to in double brackets.
For example `\[[WikiLink]]`.

If you ever need to write something like `\[[WikiLink]]` without creating a
wikilink, just prefix it with a `\`, like `\\[[WikiLink]]`.

There are some special [[SubPage/LinkingRules]] that come into play when
linking between [[SubPages|SubPage]].

Also, if the file linked to by a WikiLink looks like an image, it will
be displayed inline on the page.

WikiLinks are matched with page names in a case-insensitive manner, so you
don't need to worry about getting the case the same, and can capitalise
links at the start of a sentence, and so on.

It's also possible to write a WikiLink that uses something other than the page
name as the link text. For example `\[[foo_bar|SandBox]]` links to the SandBox
page, but the link will appear like this: [[foo_bar|SandBox]].

To link to an anchor inside a page, you can use something like
`\[[WikiLink#foo]]`

## Preprocessor directives and wikilinks

ikiwiki has two syntaxes for
[[preprocessor_directives|PreprocessorDirective]].  The older syntax
used spaces to distinguish between preprocessor directives and
wikilinks; as a result, with that syntax in use, you cannot use spaces
in WikiLinks, and must replace spaces with underscores.  The newer
syntax, enabled with the `prefix_directives` option in an ikiwiki
setup file, prefixes directives with `!`, and thus does not prevent
links with spaces.  Future versions of ikiwiki will turn this option
on by default.