Fossil SCM

Add preliminary documentation for interwiki links. List the intermap on the /md_rules and /wiki_rules pages.

drh 2020-08-23 14:04 interwiki
Commit 1a4158ea86747320c337438168e242bead4c0ec733ecf74c49b6430c42f9bd7d
+38 -6
--- src/interwiki.c
+++ src/interwiki.c
@@ -131,21 +131,22 @@
131131
/*
132132
** COMMAND: interwiki*
133133
**
134134
** Usage: %fossil interwiki COMMAND ...
135135
**
136
-** Manage interwiki labels using the following commands:
136
+** Manage the "intermap" that defines the mapping from interwiki tags
137
+** to complete URLs for interwiki links.
137138
**
138
-** > fossil interwiki delete NAME ...
139
+** > fossil interwiki delete TAG ...
139140
**
140141
** Delete one or more interwiki maps.
141142
**
142
-** > fossil interwiki edit NAME --base URL --hash PATH --wiki PATH
143
+** > fossil interwiki edit TAG --base URL --hash PATH --wiki PATH
143144
**
144
-** Create a interwiki referenced call NAME. The base URL is
145
+** Create a interwiki referenced call TAG. The base URL is
145146
** the --base option, which is required. The --hash and --wiki
146
-** paths are optional. The NAME must be lower-case alphanumeric
147
+** paths are optional. The TAG must be lower-case alphanumeric
147148
** and must be unique. A new entry is created if it does not
148149
** already exit.
149150
**
150151
** > fossil interwiki list
151152
**
@@ -164,11 +165,11 @@
164165
const char *zName;
165166
const char *zBase = find_option("base",0,1);
166167
const char *zHash = find_option("hash",0,1);
167168
const char *zWiki = find_option("wiki",0,1);
168169
verify_all_options();
169
- if( g.argc!=4 ) usage("add NAME ?OPTIONS?");
170
+ if( g.argc!=4 ) usage("add TAG ?OPTIONS?");
170171
zName = g.argv[3];
171172
if( zBase){
172173
fossil_fatal("the --base option is required");
173174
}
174175
if( !interwiki_valid_name(zName) ){
@@ -231,5 +232,36 @@
231232
{
232233
fossil_fatal("unknown command \"%s\" - should be one of: "
233234
"delete edit list", zCmd);
234235
}
235236
}
237
+
238
+
239
+/*
240
+** Append text to the "Markdown" or "Wiki" rules pages that shows
241
+** a table of all interwiki tags available on this system.
242
+*/
243
+void interwiki_append_map_table(Blob *out){
244
+ int n = 0;
245
+ Stmt q;
246
+ db_prepare(&q,
247
+ "SELECT substr(name,11), json_extract(value,'$.base')"
248
+ " FROM config WHERE name glob 'interwiki:*'"
249
+ " ORDER BY name;"
250
+ );
251
+ while( db_step(&q)==SQLITE_ROW ){
252
+ if( n==0 ){
253
+ blob_appendf(out, "<blockquote><table>\n");
254
+ }
255
+ blob_appendf(out,"<tr><td>%h</td><td>&nbsp;&rarr;&nbsp;</td>",
256
+ db_column_text(&q,0));
257
+ blob_appendf(out,"<td>%h</td></tr>\n",
258
+ db_column_text(&q,1));
259
+ n++;
260
+ }
261
+ db_finalize(&q);
262
+ if( n>0 ){
263
+ blob_appendf(out,"</table></blockquote>\n");
264
+ }else{
265
+ blob_appendf(out,"<i>None</i></blockquote>\n");
266
+ }
267
+}
236268
--- src/interwiki.c
+++ src/interwiki.c
@@ -131,21 +131,22 @@
131 /*
132 ** COMMAND: interwiki*
133 **
134 ** Usage: %fossil interwiki COMMAND ...
135 **
136 ** Manage interwiki labels using the following commands:
 
137 **
138 ** > fossil interwiki delete NAME ...
139 **
140 ** Delete one or more interwiki maps.
141 **
142 ** > fossil interwiki edit NAME --base URL --hash PATH --wiki PATH
143 **
144 ** Create a interwiki referenced call NAME. The base URL is
145 ** the --base option, which is required. The --hash and --wiki
146 ** paths are optional. The NAME must be lower-case alphanumeric
147 ** and must be unique. A new entry is created if it does not
148 ** already exit.
149 **
150 ** > fossil interwiki list
151 **
@@ -164,11 +165,11 @@
164 const char *zName;
165 const char *zBase = find_option("base",0,1);
166 const char *zHash = find_option("hash",0,1);
167 const char *zWiki = find_option("wiki",0,1);
168 verify_all_options();
169 if( g.argc!=4 ) usage("add NAME ?OPTIONS?");
170 zName = g.argv[3];
171 if( zBase){
172 fossil_fatal("the --base option is required");
173 }
174 if( !interwiki_valid_name(zName) ){
@@ -231,5 +232,36 @@
231 {
232 fossil_fatal("unknown command \"%s\" - should be one of: "
233 "delete edit list", zCmd);
234 }
235 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
--- src/interwiki.c
+++ src/interwiki.c
@@ -131,21 +131,22 @@
131 /*
132 ** COMMAND: interwiki*
133 **
134 ** Usage: %fossil interwiki COMMAND ...
135 **
136 ** Manage the "intermap" that defines the mapping from interwiki tags
137 ** to complete URLs for interwiki links.
138 **
139 ** > fossil interwiki delete TAG ...
140 **
141 ** Delete one or more interwiki maps.
142 **
143 ** > fossil interwiki edit TAG --base URL --hash PATH --wiki PATH
144 **
145 ** Create a interwiki referenced call TAG. The base URL is
146 ** the --base option, which is required. The --hash and --wiki
147 ** paths are optional. The TAG must be lower-case alphanumeric
148 ** and must be unique. A new entry is created if it does not
149 ** already exit.
150 **
151 ** > fossil interwiki list
152 **
@@ -164,11 +165,11 @@
165 const char *zName;
166 const char *zBase = find_option("base",0,1);
167 const char *zHash = find_option("hash",0,1);
168 const char *zWiki = find_option("wiki",0,1);
169 verify_all_options();
170 if( g.argc!=4 ) usage("add TAG ?OPTIONS?");
171 zName = g.argv[3];
172 if( zBase){
173 fossil_fatal("the --base option is required");
174 }
175 if( !interwiki_valid_name(zName) ){
@@ -231,5 +232,36 @@
232 {
233 fossil_fatal("unknown command \"%s\" - should be one of: "
234 "delete edit list", zCmd);
235 }
236 }
237
238
239 /*
240 ** Append text to the "Markdown" or "Wiki" rules pages that shows
241 ** a table of all interwiki tags available on this system.
242 */
243 void interwiki_append_map_table(Blob *out){
244 int n = 0;
245 Stmt q;
246 db_prepare(&q,
247 "SELECT substr(name,11), json_extract(value,'$.base')"
248 " FROM config WHERE name glob 'interwiki:*'"
249 " ORDER BY name;"
250 );
251 while( db_step(&q)==SQLITE_ROW ){
252 if( n==0 ){
253 blob_appendf(out, "<blockquote><table>\n");
254 }
255 blob_appendf(out,"<tr><td>%h</td><td>&nbsp;&rarr;&nbsp;</td>",
256 db_column_text(&q,0));
257 blob_appendf(out,"<td>%h</td></tr>\n",
258 db_column_text(&q,1));
259 n++;
260 }
261 db_finalize(&q);
262 if( n>0 ){
263 blob_appendf(out,"</table></blockquote>\n");
264 }else{
265 blob_appendf(out,"<i>None</i></blockquote>\n");
266 }
267 }
268
+6 -6
--- src/markdown.md
+++ src/markdown.md
@@ -44,15 +44,16 @@
4444
> it may optionally be written **\<URL\>** (format 4).
4545
> Other **URL** formats include:
4646
> <ul>
4747
> <li> A relative pathname.
4848
> <li> A pathname starting with "/" in which case the Fossil server
49
-> URL prefix is prepended
49
+> URL prefix is prepended
5050
> <li> A wiki page name, or a wiki page name preceded by "wiki:"
51
-> <li> An artifact or ticket hash or hash prefix
51
+> <li> An artifact or ticket hash or hash prefix
5252
> <li> A date and time stamp: "YYYY-MM-DD HH:MM:SS" or a subset that
53
-> includes at least the day of the month.</ul>
53
+> includes at least the day of the month.
54
+> <li> An [interwiki link](#intermap) of the form "<i>Tag</i><b>:</b><i>PageName</i>"</ul>
5455
5556
> In format 8, then the URL becomes the display text. This is useful for
5657
> hyperlinks that refer to wiki pages and check-in and ticket hashes.
5758
5859
## Fonts ##
@@ -153,8 +154,7 @@
153154
> the heading is omitted from the body of the document and becomes the
154155
> document title displayed at the top of the Fossil page.
155156
156157
[daringfireball.net]: http://daringfireball.net/projects/markdown/syntax
157158
158
-## See also:
159
-
160
- * [Fossil Wiki Formatting Rules](/wiki_rules)
159
+<a name="intermap"></a>
160
+## Interwiki Tag Map
161161
--- src/markdown.md
+++ src/markdown.md
@@ -44,15 +44,16 @@
44 > it may optionally be written **\<URL\>** (format 4).
45 > Other **URL** formats include:
46 > <ul>
47 > <li> A relative pathname.
48 > <li> A pathname starting with "/" in which case the Fossil server
49 > URL prefix is prepended
50 > <li> A wiki page name, or a wiki page name preceded by "wiki:"
51 > <li> An artifact or ticket hash or hash prefix
52 > <li> A date and time stamp: "YYYY-MM-DD HH:MM:SS" or a subset that
53 > includes at least the day of the month.</ul>
 
54
55 > In format 8, then the URL becomes the display text. This is useful for
56 > hyperlinks that refer to wiki pages and check-in and ticket hashes.
57
58 ## Fonts ##
@@ -153,8 +154,7 @@
153 > the heading is omitted from the body of the document and becomes the
154 > document title displayed at the top of the Fossil page.
155
156 [daringfireball.net]: http://daringfireball.net/projects/markdown/syntax
157
158 ## See also:
159
160 * [Fossil Wiki Formatting Rules](/wiki_rules)
161
--- src/markdown.md
+++ src/markdown.md
@@ -44,15 +44,16 @@
44 > it may optionally be written **\<URL\>** (format 4).
45 > Other **URL** formats include:
46 > <ul>
47 > <li> A relative pathname.
48 > <li> A pathname starting with "/" in which case the Fossil server
49 > URL prefix is prepended
50 > <li> A wiki page name, or a wiki page name preceded by "wiki:"
51 > <li> An artifact or ticket hash or hash prefix
52 > <li> A date and time stamp: "YYYY-MM-DD HH:MM:SS" or a subset that
53 > includes at least the day of the month.
54 > <li> An [interwiki link](#intermap) of the form "<i>Tag</i><b>:</b><i>PageName</i>"</ul>
55
56 > In format 8, then the URL becomes the display text. This is useful for
57 > hyperlinks that refer to wiki pages and check-in and ticket hashes.
58
59 ## Fonts ##
@@ -153,8 +154,7 @@
154 > the heading is omitted from the body of the document and becomes the
155 > document title displayed at the top of the Fossil page.
156
157 [daringfireball.net]: http://daringfireball.net/projects/markdown/syntax
158
159 <a name="intermap"></a>
160 ## Interwiki Tag Map
 
161
+2
--- src/wiki.c
+++ src/wiki.c
@@ -223,10 +223,11 @@
223223
style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
224224
}
225225
style_submenu_element("Wiki", "%R/wiki_rules");
226226
blob_init(&x, builtin_text("markdown.md"), -1);
227227
blob_materialize(&x);
228
+ interwiki_append_map_table(&x);
228229
safe_html_context(DOCSRC_TRUSTED);
229230
wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
230231
blob_reset(&x);
231232
style_footer();
232233
}
@@ -246,10 +247,11 @@
246247
style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
247248
}
248249
style_submenu_element("Markdown","%R/md_rules");
249250
blob_init(&x, builtin_text("wiki.wiki"), -1);
250251
blob_materialize(&x);
252
+ interwiki_append_map_table(&x);
251253
safe_html_context(DOCSRC_TRUSTED);
252254
wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
253255
blob_reset(&x);
254256
style_footer();
255257
}
256258
--- src/wiki.c
+++ src/wiki.c
@@ -223,10 +223,11 @@
223 style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
224 }
225 style_submenu_element("Wiki", "%R/wiki_rules");
226 blob_init(&x, builtin_text("markdown.md"), -1);
227 blob_materialize(&x);
 
228 safe_html_context(DOCSRC_TRUSTED);
229 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
230 blob_reset(&x);
231 style_footer();
232 }
@@ -246,10 +247,11 @@
246 style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
247 }
248 style_submenu_element("Markdown","%R/md_rules");
249 blob_init(&x, builtin_text("wiki.wiki"), -1);
250 blob_materialize(&x);
 
251 safe_html_context(DOCSRC_TRUSTED);
252 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
253 blob_reset(&x);
254 style_footer();
255 }
256
--- src/wiki.c
+++ src/wiki.c
@@ -223,10 +223,11 @@
223 style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
224 }
225 style_submenu_element("Wiki", "%R/wiki_rules");
226 blob_init(&x, builtin_text("markdown.md"), -1);
227 blob_materialize(&x);
228 interwiki_append_map_table(&x);
229 safe_html_context(DOCSRC_TRUSTED);
230 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
231 blob_reset(&x);
232 style_footer();
233 }
@@ -246,10 +247,11 @@
247 style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
248 }
249 style_submenu_element("Markdown","%R/md_rules");
250 blob_init(&x, builtin_text("wiki.wiki"), -1);
251 blob_materialize(&x);
252 interwiki_append_map_table(&x);
253 safe_html_context(DOCSRC_TRUSTED);
254 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
255 blob_reset(&x);
256 style_footer();
257 }
258
+5 -4
--- src/wiki.wiki
+++ src/wiki.wiki
@@ -43,11 +43,13 @@
4343
Use HTML for deeper indentation.
4444
4545
5. <b>Hyperlinks.</b>
4646
Text within square brackets <nowiki>("[...]")</nowiki> becomes a
4747
hyperlink. The target can be a wiki page name, the artifact ID of
48
- a check-in or ticket, the name of an image, or a URL.
48
+ a check-in or ticket, the name of an image, a URL, or an
49
+ [#intermap|interwiki link] of the form
50
+ "<i>Tag</i><b>:</b><i>PageName</i>".
4951
By default, the target is displayed as the text of the hyperlink.
5052
But you can specify alternative text after the target name
5153
separated by a "|" character.
5254
You can also link to internal anchor names using
5355
<nowiki>[#anchor-name],</nowiki> providing you have added the necessary
@@ -78,8 +80,7 @@
7880
The &lt;nowiki&gt; tag disables all wiki formatting rules through
7981
the matching &lt;/nowiki&gt; element. The &lt;verbatim&gt; tag works
8082
like &lt;pre&gt; with the addition that it also disables all wiki
8183
and HTML markup through the matching &lt;/verbatim&gt;.
8284
83
-<h2>See Also</h2>
84
-
85
- * [/md_rules|Markdown formatting rules]
85
+<a name="intermap"></a>
86
+<h2>Interwiki Tag Map</h2>
8687
--- src/wiki.wiki
+++ src/wiki.wiki
@@ -43,11 +43,13 @@
43 Use HTML for deeper indentation.
44
45 5. <b>Hyperlinks.</b>
46 Text within square brackets <nowiki>("[...]")</nowiki> becomes a
47 hyperlink. The target can be a wiki page name, the artifact ID of
48 a check-in or ticket, the name of an image, or a URL.
 
 
49 By default, the target is displayed as the text of the hyperlink.
50 But you can specify alternative text after the target name
51 separated by a "|" character.
52 You can also link to internal anchor names using
53 <nowiki>[#anchor-name],</nowiki> providing you have added the necessary
@@ -78,8 +80,7 @@
78 The &lt;nowiki&gt; tag disables all wiki formatting rules through
79 the matching &lt;/nowiki&gt; element. The &lt;verbatim&gt; tag works
80 like &lt;pre&gt; with the addition that it also disables all wiki
81 and HTML markup through the matching &lt;/verbatim&gt;.
82
83 <h2>See Also</h2>
84
85 * [/md_rules|Markdown formatting rules]
86
--- src/wiki.wiki
+++ src/wiki.wiki
@@ -43,11 +43,13 @@
43 Use HTML for deeper indentation.
44
45 5. <b>Hyperlinks.</b>
46 Text within square brackets <nowiki>("[...]")</nowiki> becomes a
47 hyperlink. The target can be a wiki page name, the artifact ID of
48 a check-in or ticket, the name of an image, a URL, or an
49 [#intermap|interwiki link] of the form
50 "<i>Tag</i><b>:</b><i>PageName</i>".
51 By default, the target is displayed as the text of the hyperlink.
52 But you can specify alternative text after the target name
53 separated by a "|" character.
54 You can also link to internal anchor names using
55 <nowiki>[#anchor-name],</nowiki> providing you have added the necessary
@@ -78,8 +80,7 @@
80 The &lt;nowiki&gt; tag disables all wiki formatting rules through
81 the matching &lt;/nowiki&gt; element. The &lt;verbatim&gt; tag works
82 like &lt;pre&gt; with the addition that it also disables all wiki
83 and HTML markup through the matching &lt;/verbatim&gt;.
84
85 <a name="intermap"></a>
86 <h2>Interwiki Tag Map</h2>
 
87
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,11 @@
11
<title>Change Log</title>
22
33
<a name='v2_13'></a>
44
<h2>Changes for Version 2.13 (pending)</h2>
55
6
- * <i>TBD...</i>
6
+ * Added support for [./interwiki.md|interwiki links].
77
88
<a name='v2_12'></a>
99
<h2>Changes for Version 2.12.1 (2020-08-20)</h2>
1010
1111
* (2.12.1): Fix client-side vulnerabilities discovered by Max Justicz.
1212
1313
ADDED www/interwiki.md
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,11 @@
1 <title>Change Log</title>
2
3 <a name='v2_13'></a>
4 <h2>Changes for Version 2.13 (pending)</h2>
5
6 * <i>TBD...</i>
7
8 <a name='v2_12'></a>
9 <h2>Changes for Version 2.12.1 (2020-08-20)</h2>
10
11 * (2.12.1): Fix client-side vulnerabilities discovered by Max Justicz.
12
13 DDED www/interwiki.md
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,11 @@
1 <title>Change Log</title>
2
3 <a name='v2_13'></a>
4 <h2>Changes for Version 2.13 (pending)</h2>
5
6 * Added support for [./interwiki.md|interwiki links].
7
8 <a name='v2_12'></a>
9 <h2>Changes for Version 2.12.1 (2020-08-20)</h2>
10
11 * (2.12.1): Fix client-side vulnerabilities discovered by Max Justicz.
12
13 DDED www/interwiki.md
--- a/www/interwiki.md
+++ b/www/interwiki.md
@@ -0,0 +1,104 @@
1
+Interwiki_links)
2
+ * [](httInterwiki_links)
3
+
4
+Another example: The Fossil Forum is hosted in a separate repository
5
+from the Fossil source code. This page is part of the
6
+source code repository. Interwiki links can be used to more easily
7
+refer to the forum repository:
8
+
9
+ * [](forum:d5508c3bf44c6393df09c)
10
+ * [](https://fossil-scm.org/forum/info/d5508c3bf44c6393df09c)
11
+
12
+## Advantages Over Full URL Targets
13
+
14
+ * Interwiki links are easier to write. There is less typing,
15
+ and fewer op?cmd=ortunities to make mistakes.
16
+
17
+ * Interwiki links are easier to read. With well-chosen
18
+ intermap tags, the links are easier to understand.
19
+
20
+ * Interwiki links continue to work after a domain change on the
21
+ target. If the target of a link moves to a different domain,
22
+ an interwiki link will continue to work, if the intermap is adjusted,
23
+ but a hard-coded link will be permanently broken.
24
+
25
+ * Interwiki links allow clones to use a different target domain from the
26
+ original repository.
27
+
28
+## Details
29
+
30
+Fossil supports interwiki links in both the
31
+[Fossil Wiki](/wiki_rules) and [Markdown](/md_rules) markup
32
+styles. An interwiki link consists of a tag followed by a colon
33
+and the link target:
34
+
35
+> <i>Tag</i><b>:</b><i>PageName</i>
36
+
37
+The Tag must consist of ASCII alphanumeric characters only - no
38
+punctuation or whitespace or characters greater than U+007A.
39
+The PageName is the link notation on the target wiki.
40
+Th different classes of PageNames are recognized by Fossil:
41
+
42
+ 1. <b>Path Links</b> &rarr; the PageName begins with the "/" character
43
+ or is an empty string.
44
+
45
+ 2. <b>Hash Links</b> &rarr; the PageName is a hexadecimal number with
46
+ at least four digits.
47
+
48
+ n 3. <b>Wiki Links</b> &rarr; A PageName that is not a Path or Hash.
49
+
50
+The Intermap defiisg. Path links are appended
51
+directly to the URL contained in the Intermap. The Intermap can define
52
+additional text to put in between the base URL and the PageName for
53
+Hash and Wiki links, respectively.
54
+
55
+<a id="intermap"></a>
56
+## Intermap
57
+
58
+The intermap defines a mapping from interwiki Tags to full URLs. The
59
+Intermap can be viewed and managed using the [fossil s. fors) markup
60
+styles. An interwiki link consists of a tag followed by a colon
61
+and the link tanameet:
62
+
63
+> <i>Tag</i><b>:</b><i>PageName</i>
64
+
65
+The Tag must consist of ASCII alphanumeric characters only - no
66
+punctuation or whitespace or characters greater than U+007A.
67
+The PageName is the link notation on the targeiki link willhelp?cmd=/intermapki links in both the
68
+[Fossil Wiki](/wiki_rules) and [Markdown](/md_rules) markup
69
+styles. An interwiki link consists of a tag followed by a colon
70
+and the link target:
71
+
72
+> <i>Tag</i><b>:</b><i>PageName</i>
73
+
74
+The Tag must consist of ASCII alphanumeric characters only - no
75
+punctuation or whitespace or characters greater than U+007A.
76
+The PageName is the link notation on the target wiki.
77
+Three different classes of PageNames are recognized by Fossil:
78
+
79
+ 1. <b>Path Links</b> &rarr; the PageName begins with the "/" character
80
+ or is an empty string.
81
+
82
+ 2. <b>Hash Links</b> &rarr; the PageName is a hexadecimal number with
83
+ at least four digits.
84
+
85
+ n 3. <b>Wiki Links</b> &rarr; A PageName that is not a Path or Hash.
86
+
87
+The Intermap defines a base URL for each Tag. Path links are appended
88
+directly to the URL contained in the Intermap. The Intermap can define
89
+additional text to put in between the base URL and the PageName for
90
+Hash and Wiki links, respectively.
91
+
92
+<a id="intermap"></a>
93
+## Intermap
94
+
95
+The intermap defines a mapping from interwiki Tags to full URLs. The
96
+Intermap can be viewed and managed using the [fossil s. fors) markup
97
+styles. An interwiki link consists of a tag followed by a colon
98
+and the link tanameet:
99
+
100
+> <i>Tag</i><b>:</b><i>PageName</i>
101
+
102
+The Tag must consist of ASCII alphanumeric characters only - no
103
+punctuation or whitespace or characters greater than U+007A.
104
+The PageName is the link notation on knowing scanning the source
--- a/www/interwiki.md
+++ b/www/interwiki.md
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/interwiki.md
+++ b/www/interwiki.md
@@ -0,0 +1,104 @@
1 Interwiki_links)
2 * [](httInterwiki_links)
3
4 Another example: The Fossil Forum is hosted in a separate repository
5 from the Fossil source code. This page is part of the
6 source code repository. Interwiki links can be used to more easily
7 refer to the forum repository:
8
9 * [](forum:d5508c3bf44c6393df09c)
10 * [](https://fossil-scm.org/forum/info/d5508c3bf44c6393df09c)
11
12 ## Advantages Over Full URL Targets
13
14 * Interwiki links are easier to write. There is less typing,
15 and fewer op?cmd=ortunities to make mistakes.
16
17 * Interwiki links are easier to read. With well-chosen
18 intermap tags, the links are easier to understand.
19
20 * Interwiki links continue to work after a domain change on the
21 target. If the target of a link moves to a different domain,
22 an interwiki link will continue to work, if the intermap is adjusted,
23 but a hard-coded link will be permanently broken.
24
25 * Interwiki links allow clones to use a different target domain from the
26 original repository.
27
28 ## Details
29
30 Fossil supports interwiki links in both the
31 [Fossil Wiki](/wiki_rules) and [Markdown](/md_rules) markup
32 styles. An interwiki link consists of a tag followed by a colon
33 and the link target:
34
35 > <i>Tag</i><b>:</b><i>PageName</i>
36
37 The Tag must consist of ASCII alphanumeric characters only - no
38 punctuation or whitespace or characters greater than U+007A.
39 The PageName is the link notation on the target wiki.
40 Th different classes of PageNames are recognized by Fossil:
41
42 1. <b>Path Links</b> &rarr; the PageName begins with the "/" character
43 or is an empty string.
44
45 2. <b>Hash Links</b> &rarr; the PageName is a hexadecimal number with
46 at least four digits.
47
48 n 3. <b>Wiki Links</b> &rarr; A PageName that is not a Path or Hash.
49
50 The Intermap defiisg. Path links are appended
51 directly to the URL contained in the Intermap. The Intermap can define
52 additional text to put in between the base URL and the PageName for
53 Hash and Wiki links, respectively.
54
55 <a id="intermap"></a>
56 ## Intermap
57
58 The intermap defines a mapping from interwiki Tags to full URLs. The
59 Intermap can be viewed and managed using the [fossil s. fors) markup
60 styles. An interwiki link consists of a tag followed by a colon
61 and the link tanameet:
62
63 > <i>Tag</i><b>:</b><i>PageName</i>
64
65 The Tag must consist of ASCII alphanumeric characters only - no
66 punctuation or whitespace or characters greater than U+007A.
67 The PageName is the link notation on the targeiki link willhelp?cmd=/intermapki links in both the
68 [Fossil Wiki](/wiki_rules) and [Markdown](/md_rules) markup
69 styles. An interwiki link consists of a tag followed by a colon
70 and the link target:
71
72 > <i>Tag</i><b>:</b><i>PageName</i>
73
74 The Tag must consist of ASCII alphanumeric characters only - no
75 punctuation or whitespace or characters greater than U+007A.
76 The PageName is the link notation on the target wiki.
77 Three different classes of PageNames are recognized by Fossil:
78
79 1. <b>Path Links</b> &rarr; the PageName begins with the "/" character
80 or is an empty string.
81
82 2. <b>Hash Links</b> &rarr; the PageName is a hexadecimal number with
83 at least four digits.
84
85 n 3. <b>Wiki Links</b> &rarr; A PageName that is not a Path or Hash.
86
87 The Intermap defines a base URL for each Tag. Path links are appended
88 directly to the URL contained in the Intermap. The Intermap can define
89 additional text to put in between the base URL and the PageName for
90 Hash and Wiki links, respectively.
91
92 <a id="intermap"></a>
93 ## Intermap
94
95 The intermap defines a mapping from interwiki Tags to full URLs. The
96 Intermap can be viewed and managed using the [fossil s. fors) markup
97 styles. An interwiki link consists of a tag followed by a colon
98 and the link tanameet:
99
100 > <i>Tag</i><b>:</b><i>PageName</i>
101
102 The Tag must consist of ASCII alphanumeric characters only - no
103 punctuation or whitespace or characters greater than U+007A.
104 The PageName is the link notation on knowing scanning the source
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -61,10 +61,11 @@
6161
/help {Lists of Commands and Webpages}
6262
hints.wiki {Fossil Tips And Usage Hints}
6363
history.md {The Purpose And History Of Fossil}
6464
index.wiki {Home Page}
6565
inout.wiki {Import And Export To And From Git}
66
+ interwiki.md {Interwiki Links}
6667
image-format-vs-repo-size.md {Image Format vs Fossil Repo Size}
6768
javascript.md {Use of JavaScript in Fossil}
6869
makefile.wiki {The Fossil Build Process}
6970
mirrorlimitations.md {Limitations On Git Mirrors}
7071
mirrortogithub.md {How To Mirror A Fossil Repository On GitHub}
7172
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -61,10 +61,11 @@
61 /help {Lists of Commands and Webpages}
62 hints.wiki {Fossil Tips And Usage Hints}
63 history.md {The Purpose And History Of Fossil}
64 index.wiki {Home Page}
65 inout.wiki {Import And Export To And From Git}
 
66 image-format-vs-repo-size.md {Image Format vs Fossil Repo Size}
67 javascript.md {Use of JavaScript in Fossil}
68 makefile.wiki {The Fossil Build Process}
69 mirrorlimitations.md {Limitations On Git Mirrors}
70 mirrortogithub.md {How To Mirror A Fossil Repository On GitHub}
71
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -61,10 +61,11 @@
61 /help {Lists of Commands and Webpages}
62 hints.wiki {Fossil Tips And Usage Hints}
63 history.md {The Purpose And History Of Fossil}
64 index.wiki {Home Page}
65 inout.wiki {Import And Export To And From Git}
66 interwiki.md {Interwiki Links}
67 image-format-vs-repo-size.md {Image Format vs Fossil Repo Size}
68 javascript.md {Use of JavaScript in Fossil}
69 makefile.wiki {The Fossil Build Process}
70 mirrorlimitations.md {Limitations On Git Mirrors}
71 mirrortogithub.md {How To Mirror A Fossil Repository On GitHub}
72
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -184,14 +184,16 @@
184184
<li><a href="inout.wiki"><b>Import And Export To And From Git</b></a></li>
185185
<li><a href="build.wiki">Installing Fossil &mdash; Compiling and</a></li>
186186
<li><a href="fossil-from-msvc.wiki"><b>Integrating Fossil in the Microsoft Express 2010 IDE</b></a></li>
187187
<li><a href="selfcheck.wiki">Integrity Self Checks &mdash; Fossil Repository</a></li>
188188
<li><a href="webui.wiki">Interface &mdash; The Fossil Web</a></li>
189
+<li><a href="interwiki.md"><b>Interwiki Links</b></a></li>
189190
<li><a href="javascript.md">JavaScript in Fossil &mdash; Use of</a></li>
190191
<li><a href="th1.md">Language &mdash; The TH1 Scripting</a></li>
191192
<li><a href="copyright-release.html">License Agreement &mdash; Contributor</a></li>
192193
<li><a href="mirrorlimitations.md"><b>Limitations On Git Mirrors</b></a></li>
194
+<li><a href="interwiki.md">Links &mdash; Interwiki</a></li>
193195
<li><a href="../../../help"><b>Lists of Commands and Webpages</b></a></li>
194196
<li><a href="password.wiki">Management And Authentication &mdash; Password</a></li>
195197
<li><a href="../../../sitemap">Map &mdash; Site</a></li>
196198
<li><a href="../../../md_rules"><b>Markdown Formatting Rules</b></a></li>
197199
<li><a href="backoffice.md">mechanism of Fossil &mdash; The Backoffice</a></li>
198200
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -184,14 +184,16 @@
184 <li><a href="inout.wiki"><b>Import And Export To And From Git</b></a></li>
185 <li><a href="build.wiki">Installing Fossil &mdash; Compiling and</a></li>
186 <li><a href="fossil-from-msvc.wiki"><b>Integrating Fossil in the Microsoft Express 2010 IDE</b></a></li>
187 <li><a href="selfcheck.wiki">Integrity Self Checks &mdash; Fossil Repository</a></li>
188 <li><a href="webui.wiki">Interface &mdash; The Fossil Web</a></li>
 
189 <li><a href="javascript.md">JavaScript in Fossil &mdash; Use of</a></li>
190 <li><a href="th1.md">Language &mdash; The TH1 Scripting</a></li>
191 <li><a href="copyright-release.html">License Agreement &mdash; Contributor</a></li>
192 <li><a href="mirrorlimitations.md"><b>Limitations On Git Mirrors</b></a></li>
 
193 <li><a href="../../../help"><b>Lists of Commands and Webpages</b></a></li>
194 <li><a href="password.wiki">Management And Authentication &mdash; Password</a></li>
195 <li><a href="../../../sitemap">Map &mdash; Site</a></li>
196 <li><a href="../../../md_rules"><b>Markdown Formatting Rules</b></a></li>
197 <li><a href="backoffice.md">mechanism of Fossil &mdash; The Backoffice</a></li>
198
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -184,14 +184,16 @@
184 <li><a href="inout.wiki"><b>Import And Export To And From Git</b></a></li>
185 <li><a href="build.wiki">Installing Fossil &mdash; Compiling and</a></li>
186 <li><a href="fossil-from-msvc.wiki"><b>Integrating Fossil in the Microsoft Express 2010 IDE</b></a></li>
187 <li><a href="selfcheck.wiki">Integrity Self Checks &mdash; Fossil Repository</a></li>
188 <li><a href="webui.wiki">Interface &mdash; The Fossil Web</a></li>
189 <li><a href="interwiki.md"><b>Interwiki Links</b></a></li>
190 <li><a href="javascript.md">JavaScript in Fossil &mdash; Use of</a></li>
191 <li><a href="th1.md">Language &mdash; The TH1 Scripting</a></li>
192 <li><a href="copyright-release.html">License Agreement &mdash; Contributor</a></li>
193 <li><a href="mirrorlimitations.md"><b>Limitations On Git Mirrors</b></a></li>
194 <li><a href="interwiki.md">Links &mdash; Interwiki</a></li>
195 <li><a href="../../../help"><b>Lists of Commands and Webpages</b></a></li>
196 <li><a href="password.wiki">Management And Authentication &mdash; Password</a></li>
197 <li><a href="../../../sitemap">Map &mdash; Site</a></li>
198 <li><a href="../../../md_rules"><b>Markdown Formatting Rules</b></a></li>
199 <li><a href="backoffice.md">mechanism of Fossil &mdash; The Backoffice</a></li>
200

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button