|
1
|
# Interwiki Links |
|
2
|
|
|
3
|
Interwiki links are a short-hand notation for links that target |
|
4
|
external wikis or websites. For example, the following two |
|
5
|
hyperlinks mean the same thing (assuming an appropriate [intermap](#intermap) |
|
6
|
configuration): |
|
7
|
|
|
8
|
* [](wikipedia:MediaWiki#Interwiki_links) |
|
9
|
* [](https://en.wikipedia.org/wiki/MediaWiki#Interwiki_links) |
|
10
|
|
|
11
|
Another example: The Fossil Forum is hosted in a separate repository |
|
12
|
from the Fossil source code. This page is part of the |
|
13
|
source code repository. Interwiki links can be used to more easily |
|
14
|
refer to the forum repository: |
|
15
|
|
|
16
|
* [](forum:d5508c3bf44c6393df09c) |
|
17
|
* [](https://fossil-scm.org/forum/info/d5508c3bf44c6393df09c) |
|
18
|
|
|
19
|
## Advantages Over Full URL Targets |
|
20
|
|
|
21
|
* Interwiki links are easier to write. There is less typing, |
|
22
|
and fewer opportunities to make mistakes. |
|
23
|
|
|
24
|
* Interwiki links are easier to read. With well-chosen |
|
25
|
intermap tags, the links are easier to understand. |
|
26
|
|
|
27
|
* Interwiki links continue to work after a domain change on the |
|
28
|
target. If the target of a link moves to a different domain, |
|
29
|
an interwiki link will continue to work, if the intermap is adjusted, |
|
30
|
but a hard-coded link will be permanently broken. |
|
31
|
|
|
32
|
* Interwiki links allow clones to use a different target domain from the |
|
33
|
original repository. |
|
34
|
|
|
35
|
## Details |
|
36
|
|
|
37
|
Fossil supports interwiki links in both the |
|
38
|
[Fossil Wiki](/wiki_rules) and [Markdown](/md_rules) markup |
|
39
|
styles. An interwiki link consists of a tag followed by a colon |
|
40
|
and the link target: |
|
41
|
|
|
42
|
> <i>Tag</i><b>:</b><i>PageName</i> |
|
43
|
|
|
44
|
The Tag must consist of ASCII alphanumeric characters only - no |
|
45
|
punctuation or whitespace or characters greater than U+007A. |
|
46
|
The PageName is the link notation on the target wiki. |
|
47
|
Three different classes of PageNames are recognized by Fossil: |
|
48
|
|
|
49
|
1. <b>Path Links</b> → the PageName begins with the "/" character |
|
50
|
or is an empty string. |
|
51
|
|
|
52
|
2. <b>Hash Links</b> → the PageName is a hexadecimal number with |
|
53
|
at least four digits. |
|
54
|
|
|
55
|
3. <b>Wiki Links</b> → A PageName that is not a Path or Hash. |
|
56
|
|
|
57
|
The Intermap defines a base URL for each Tag. Path links are appended |
|
58
|
directly to the URL contained in the Intermap. The Intermap can define |
|
59
|
additional text to put in between the base URL and the PageName for |
|
60
|
Hash and Wiki links, respectively. |
|
61
|
|
|
62
|
<a id="intermap"></a> |
|
63
|
## Intermap |
|
64
|
|
|
65
|
The intermap defines a mapping from interwiki Tags to full URLs. The |
|
66
|
Intermap can be viewed and managed using the [fossil interwiki][iwiki] |
|
67
|
command or the [/intermap][imap] webpage. |
|
68
|
|
|
69
|
[iwiki]: /help/interwiki |
|
70
|
[imap]: /intermap |
|
71
|
|
|
72
|
The current intermap for a server is seen on the [/intermap][imap] page |
|
73
|
(which is read-only for non-Setup users) and at the bottom of the built-in |
|
74
|
[Fossil Wiki rules](/wiki_rules) and [Markdown rules](/md_rules) |
|
75
|
documentation pages. |
|
76
|
|
|
77
|
Each intermap entry stores, at a minimum, the base URL for the remote |
|
78
|
wiki. The intermap entry might also store additional path text that |
|
79
|
is used for Hash and Wiki links. If only the base URL is provided, |
|
80
|
then the intermap will only allow Path style interwiki links. The |
|
81
|
Hash and Wiki style interwiki links are only allowed if the necessary |
|
82
|
extensions are provided in the intermap. |
|
83
|
|
|
84
|
|
|
85
|
## Disadvantages and Limitations |
|
86
|
|
|
87
|
* Configuration is required. The intermap must be set up correctly |
|
88
|
before interwiki links will work. This contrasts with ordinary |
|
89
|
links that just work without any configuration. Cloning a repository |
|
90
|
copies the intermap, but normal syncs do not keep the intermap in |
|
91
|
sync. Use the "[fossil config pull interwiki][fcfg]" command to |
|
92
|
synchronize the intermap. |
|
93
|
|
|
94
|
* The is no backlink tracking. For ordinary intrawiki links, Fossil keeps |
|
95
|
track of both the source and target, and when displaying targets it |
|
96
|
commonly shows links to that target. For example, if you mention a |
|
97
|
check-in as part of a comment of another check-in, that new check-in |
|
98
|
shows up in the "References" section of the target check-in. |
|
99
|
([example](31af805348690958). In other words, Fossil tracks not just |
|
100
|
"_source→target_", but it also tracks "_target→source_". |
|
101
|
But backtracking does not work for interwiki links, since the Fossil |
|
102
|
running on the target has no way of scanning the source text and |
|
103
|
hence has no way of knowing that it is a target of a link from the source. |
|
104
|
|
|
105
|
[fcfg]: /help/config |
|
106
|
|
|
107
|
## Intermap Storage Details |
|
108
|
|
|
109
|
The intermap is stored in the CONFIG table of the repository database, |
|
110
|
in entries with names of the form "<tt>interwiki:</tt><i>Tag</i>". The |
|
111
|
value for each such entry is a JSON string that defines the base URL |
|
112
|
and extensions for Hash and Wiki links. |
|
113
|
|
|
114
|
## See Also |
|
115
|
|
|
116
|
1. [](https://www.mediawiki.org/wiki/Manual:Interwiki) |
|
117
|
2. [](https://duckduckgo.com/?q=interwiki+links&ia=web) |
|
118
|
|