Fossil SCM

Change the special $SELF substitution used by Markdown and HTML embedded documentation into $CURRENT. See the [https://www.fossil-scm.org/forum/forumpost/69cf42b0c9|forum discussion] for details.

drh 2020-02-12 16:35 trunk
Commit 45427ae1c9312bd81f272dfe8c080a0bc42e1fa30c9b660a1088020f0daba84b
+5 -5
--- src/doc.c
+++ src/doc.c
@@ -685,13 +685,13 @@
685685
** Transfer content to the output. During the transfer, when text of
686686
** the following form is seen:
687687
**
688688
** href="$ROOT/..."
689689
** action="$ROOT/..."
690
-** href=".../doc/$SELF/..."
690
+** href=".../doc/$CURRENT/..."
691691
**
692
-** Convert $ROOT to the root URI of the repository, and $SELF to the
692
+** Convert $ROOT to the root URI of the repository, and $CURRENT to the
693693
** version number of the /doc/ document currently being displayed (if any).
694694
** Allow ' in place of " and any case for href or action.
695695
**
696696
** Efforts are made to limit this translation to cases where the text is
697697
** fully contained with an HTML markup element.
@@ -712,20 +712,20 @@
712712
blob_append(cgi_output_blob(), &z[base], i-base);
713713
blob_appendf(cgi_output_blob(), "%R");
714714
base = i+5;
715715
}else
716716
if( z[i]=='$'
717
- && strncmp(&z[i-5],"/doc/$SELF/", 11)==0
717
+ && strncmp(&z[i-5],"/doc/$CURRENT/", 11)==0
718718
&& isWithinHref(z,i-5)
719719
&& isWithinHtmlMarkup(z, i-5)
720720
&& strncmp(g.zPath, "doc/",4)==0
721721
){
722722
int j;
723
- for(j=4; g.zPath[j] && g.zPath[j]!='/'; j++){}
723
+ for(j=7; g.zPath[j] && g.zPath[j]!='/'; j++){}
724724
blob_append(cgi_output_blob(), &z[base], i-base);
725725
blob_appendf(cgi_output_blob(), "%.*s", j-4, g.zPath+4);
726
- base = i+5;
726
+ base = i+8;
727727
}
728728
}
729729
blob_append(cgi_output_blob(), &z[base], i-base);
730730
}
731731
732732
--- src/doc.c
+++ src/doc.c
@@ -685,13 +685,13 @@
685 ** Transfer content to the output. During the transfer, when text of
686 ** the following form is seen:
687 **
688 ** href="$ROOT/..."
689 ** action="$ROOT/..."
690 ** href=".../doc/$SELF/..."
691 **
692 ** Convert $ROOT to the root URI of the repository, and $SELF to the
693 ** version number of the /doc/ document currently being displayed (if any).
694 ** Allow ' in place of " and any case for href or action.
695 **
696 ** Efforts are made to limit this translation to cases where the text is
697 ** fully contained with an HTML markup element.
@@ -712,20 +712,20 @@
712 blob_append(cgi_output_blob(), &z[base], i-base);
713 blob_appendf(cgi_output_blob(), "%R");
714 base = i+5;
715 }else
716 if( z[i]=='$'
717 && strncmp(&z[i-5],"/doc/$SELF/", 11)==0
718 && isWithinHref(z,i-5)
719 && isWithinHtmlMarkup(z, i-5)
720 && strncmp(g.zPath, "doc/",4)==0
721 ){
722 int j;
723 for(j=4; g.zPath[j] && g.zPath[j]!='/'; j++){}
724 blob_append(cgi_output_blob(), &z[base], i-base);
725 blob_appendf(cgi_output_blob(), "%.*s", j-4, g.zPath+4);
726 base = i+5;
727 }
728 }
729 blob_append(cgi_output_blob(), &z[base], i-base);
730 }
731
732
--- src/doc.c
+++ src/doc.c
@@ -685,13 +685,13 @@
685 ** Transfer content to the output. During the transfer, when text of
686 ** the following form is seen:
687 **
688 ** href="$ROOT/..."
689 ** action="$ROOT/..."
690 ** href=".../doc/$CURRENT/..."
691 **
692 ** Convert $ROOT to the root URI of the repository, and $CURRENT to the
693 ** version number of the /doc/ document currently being displayed (if any).
694 ** Allow ' in place of " and any case for href or action.
695 **
696 ** Efforts are made to limit this translation to cases where the text is
697 ** fully contained with an HTML markup element.
@@ -712,20 +712,20 @@
712 blob_append(cgi_output_blob(), &z[base], i-base);
713 blob_appendf(cgi_output_blob(), "%R");
714 base = i+5;
715 }else
716 if( z[i]=='$'
717 && strncmp(&z[i-5],"/doc/$CURRENT/", 11)==0
718 && isWithinHref(z,i-5)
719 && isWithinHtmlMarkup(z, i-5)
720 && strncmp(g.zPath, "doc/",4)==0
721 ){
722 int j;
723 for(j=7; g.zPath[j] && g.zPath[j]!='/'; j++){}
724 blob_append(cgi_output_blob(), &z[base], i-base);
725 blob_appendf(cgi_output_blob(), "%.*s", j-4, g.zPath+4);
726 base = i+8;
727 }
728 }
729 blob_append(cgi_output_blob(), &z[base], i-base);
730 }
731
732
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,23 +7,26 @@
77
* Rework the "[/help?cmd=grep|fossil grep]" command to be more useful.
88
* Expose the [/help?cmd=redirect-to-https|redirect-to-https]
99
setting to the [/help?cmd=settings|settings] command.
1010
* Improve support for CGI on IIS web servers.
1111
* The [/help?cmd=/ext|/ext page] can now render index files,
12
- analog to how the embedded docs do.
12
+ in the same way as the embedded docs.
1313
* Most commands now support the Unix-conventional "<tt>--</tt>"
1414
flag to treat all following arguments as filenames
1515
instead of flags.
1616
* Added the [/help?cmd=mimetypes|mimetypes config setting]
1717
(versionable) to enable mimetype overrides and custom definitions.
18
- * Add the ability to set a default timeline style other than
19
- "Modern".
18
+ * Add an option on the /Admin/Timeline setup page to set a default
19
+ timeline style other than "Modern".
20
+ * In [./embeddeddoc.wiki|embedded documentation], hyperlink URLs
21
+ of the form "/doc/$CURRENT/..." the "$CURRENT" text is translated
22
+ into the check-in hash for the document currently being viewed.
2023
* Proactive security: Fossil now assumes that the schema of every
2124
database it opens has been tampered with by an adversary and takes
2225
extra precautions to ensure that such tampering is harmless.
2326
* Bug fix: the "fossil git export" command is now working on Windows
24
- * Bug fix: display of Technote items on the timeline correctly
27
+ * Bug fix: display Technote items on the timeline correctly
2528
* Bug fix: fix the capability summary matrix of the Security Audit
2629
page so that it does not add "anonymous" capabilities to the
2730
"nobody" user.
2831
* Many documentation enhancements.
2932
* Several minor enhancements to existing features.
3033
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,23 +7,26 @@
7 * Rework the "[/help?cmd=grep|fossil grep]" command to be more useful.
8 * Expose the [/help?cmd=redirect-to-https|redirect-to-https]
9 setting to the [/help?cmd=settings|settings] command.
10 * Improve support for CGI on IIS web servers.
11 * The [/help?cmd=/ext|/ext page] can now render index files,
12 analog to how the embedded docs do.
13 * Most commands now support the Unix-conventional "<tt>--</tt>"
14 flag to treat all following arguments as filenames
15 instead of flags.
16 * Added the [/help?cmd=mimetypes|mimetypes config setting]
17 (versionable) to enable mimetype overrides and custom definitions.
18 * Add the ability to set a default timeline style other than
19 "Modern".
 
 
 
20 * Proactive security: Fossil now assumes that the schema of every
21 database it opens has been tampered with by an adversary and takes
22 extra precautions to ensure that such tampering is harmless.
23 * Bug fix: the "fossil git export" command is now working on Windows
24 * Bug fix: display of Technote items on the timeline correctly
25 * Bug fix: fix the capability summary matrix of the Security Audit
26 page so that it does not add "anonymous" capabilities to the
27 "nobody" user.
28 * Many documentation enhancements.
29 * Several minor enhancements to existing features.
30
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,23 +7,26 @@
7 * Rework the "[/help?cmd=grep|fossil grep]" command to be more useful.
8 * Expose the [/help?cmd=redirect-to-https|redirect-to-https]
9 setting to the [/help?cmd=settings|settings] command.
10 * Improve support for CGI on IIS web servers.
11 * The [/help?cmd=/ext|/ext page] can now render index files,
12 in the same way as the embedded docs.
13 * Most commands now support the Unix-conventional "<tt>--</tt>"
14 flag to treat all following arguments as filenames
15 instead of flags.
16 * Added the [/help?cmd=mimetypes|mimetypes config setting]
17 (versionable) to enable mimetype overrides and custom definitions.
18 * Add an option on the /Admin/Timeline setup page to set a default
19 timeline style other than "Modern".
20 * In [./embeddeddoc.wiki|embedded documentation], hyperlink URLs
21 of the form "/doc/$CURRENT/..." the "$CURRENT" text is translated
22 into the check-in hash for the document currently being viewed.
23 * Proactive security: Fossil now assumes that the schema of every
24 database it opens has been tampered with by an adversary and takes
25 extra precautions to ensure that such tampering is harmless.
26 * Bug fix: the "fossil git export" command is now working on Windows
27 * Bug fix: display Technote items on the timeline correctly
28 * Bug fix: fix the capability summary matrix of the Security Audit
29 page so that it does not add "anonymous" capabilities to the
30 "nobody" user.
31 * Many documentation enhancements.
32 * Several minor enhancements to existing features.
33
--- www/embeddeddoc.wiki
+++ www/embeddeddoc.wiki
@@ -24,11 +24,11 @@
2424
on the nature of your project.)
2525
2626
We will call documentation that is included as files in the source tree
2727
"embedded documentation".
2828
29
-<h2>Fossil Support For Embedded Documentation</h2>
29
+<h1>1.0 Fossil Support For Embedded Documentation</h1>
3030
3131
The fossil web interface supports embedded documentation using
3232
the "/doc" page. To access embedded documentation, one points
3333
a web browser to a fossil URL of the following form:
3434
@@ -79,10 +79,12 @@
7979
Documentation files ending in ".txt" are plain text.
8080
Wiki, markdown, and plain text documentation files
8181
are rendered with the standard fossil header and footer added.
8282
Most other mimetypes are delivered directly to the requesting
8383
web browser without interpretation, additions, or changes.
84
+
85
+<h2>1.1 HTML Rendering With Fossil Headers And Footers</h2>
8486
8587
<a name="html"></a>Files with the mimetype "text/html" (the .html or .htm suffix) are
8688
usually rendered directly to the browser without interpretation.
8789
However, if the file begins with a &lt;div&gt; element like this:
8890
@@ -104,46 +106,78 @@
104106
Security Policy] error in your browser with the default CSP as served by
105107
Fossil. See the documentation on [./customskin.md#headfoot | Header and
106108
Footer Processing] and [./defcsp.md | The Default CSP].
107109
108110
109
-<h2>Server-Side Text Substitution</h2>
111
+<h1>2.0 Server-Side Text Substitution</h1>
110112
111113
Fossil can do a few types of substitution of server-side information
112114
into the embedded document.
113115
114
-<h3>1. $ROOT</h3>
115
-
116
-To allow for repositories [./server/ | served deeper than the root of the
117
-URL hierarchy], Fossil can substitute the repository's root in the URL
118
-scheme into HTML <tt>href</tt> and <tt>action</tt> attributes. For
119
-example:
120
-
121
-<nowiki><pre>
122
- [$ROOT/doc.wiki | doc at project root]
123
-</pre></nowiki>
124
-
125
-might become this in the rendered HTML:
126
-
127
-<nowiki><pre>
128
- &lt;a href="/project/root/doc.wiki"&gt;doc at project root&lt;/a&gt;
129
-</pre></nowiki>
130
-
131
-As you can see, this happens for all source document types that end up
132
-rendering as HTML, not just source documents in the HTML
133
-<tt>fossil-doc</tt> format described at the end of the prior section.
134
-
135
-
136
-<h3 id="th1">2. TH1 Documents</h3>
116
+<h2>2.1 "$ROOT" In HTML and Markdown Hyperlinks</h2>
117
+
118
+Hyperlinks in Markdown and HTML embedded documents can reference
119
+the root of the Fossil repository using the special text "$ROOT"
120
+at the beginning of a URL. For example, a Markdown hyperlink to
121
+the Markdown formatting rules might be
122
+written in the embedded document like this:
123
+
124
+<nowiki><pre>
125
+ [Markdown formatting rules]($ROOT/wiki_rules)
126
+</pre></nowiki>
127
+
128
+Depending on how the how the Fossil server is configured, that hyperlink
129
+might be renderer like one of the following:
130
+
131
+<nowiki><pre>
132
+ &lt;a href="/wiki_rules"&gt;Wiki formatting rules&lt;/a&gt;
133
+ &lt;a href="/cgi-bin/fossil/wiki_rules"&gt;Wiki formatting rules&lt;/a&gt;
134
+</pre></nowiki>
135
+
136
+So, in other words, the "$ROOT" text is converted into whatever
137
+the "&lt;baseurl&gt;" is for the document.
138
+
139
+This substitution works for HTML and Markdown documents.
140
+It does not work for Wiki embedded documents, since with
141
+Wiki you can just begin a URL with "/" and it automatically knows
142
+to prepend the $ROOT.
143
+
144
+<h2>2.2 "$CURRENT" In "/doc/" Hyperlinks</h2>
145
+
146
+Similarly, URLs of the form "/doc/$CURRENT/..." have the check-in
147
+hash of the check-in currently being viewed substituted in place of
148
+the "$CURRENT" text. This feature, in combination with the "$ROOT"
149
+substitution above, allows an absolute path to be used for hyperlinks.
150
+
151
+For example, if an embedded document documented wanted to reference
152
+some other document in a separate file named "www/otherdoc.md",
153
+it could use a URL like this:
154
+
155
+<nowiki><pre>
156
+ [Other Document]($ROOT/doc/$CURRENT/www/otherdoc.md)
157
+</pre></nowiki>
158
+
159
+As with "$ROOT", this substitution only works for Markdown and HTML
160
+documents. For Wiki documents, you would need to use a relative URL.
161
+
162
+<h2 id="th1">2.3 TH1 Documents</h2>
137163
138164
Fossil will substitute the value of [./th1.md | TH1 expressions] within
139165
<tt>{</tt> curly braces <tt>}</tt> into the output HTML if you have
140166
configured it with the <tt>--with-th1-docs</tt> option, which is
141167
disabled by default.
142168
169
+Since TH1 is a full scripting language, this feature essential grants
170
+the ability to execute code on the server to any with check-in
171
+privilege for the project.
172
+This is a security risk that needs to be carefully managed.
173
+The feature is off by default.
174
+Administrators should understand and carefully assess the risks
175
+before enabling the use of TH1 within embedded documentation.
176
+
143177
144
-<h2>Examples</h2>
178
+<h1>3.0 Examples</h1>
145179
146180
This file that you are currently reading is an example of
147181
embedded documentation. The name of this file in the fossil
148182
source tree is "<b>www/embeddeddoc.wiki</b>".
149183
You are perhaps looking at this
150184
--- www/embeddeddoc.wiki
+++ www/embeddeddoc.wiki
@@ -24,11 +24,11 @@
24 on the nature of your project.)
25
26 We will call documentation that is included as files in the source tree
27 "embedded documentation".
28
29 <h2>Fossil Support For Embedded Documentation</h2>
30
31 The fossil web interface supports embedded documentation using
32 the "/doc" page. To access embedded documentation, one points
33 a web browser to a fossil URL of the following form:
34
@@ -79,10 +79,12 @@
79 Documentation files ending in ".txt" are plain text.
80 Wiki, markdown, and plain text documentation files
81 are rendered with the standard fossil header and footer added.
82 Most other mimetypes are delivered directly to the requesting
83 web browser without interpretation, additions, or changes.
 
 
84
85 <a name="html"></a>Files with the mimetype "text/html" (the .html or .htm suffix) are
86 usually rendered directly to the browser without interpretation.
87 However, if the file begins with a &lt;div&gt; element like this:
88
@@ -104,46 +106,78 @@
104 Security Policy] error in your browser with the default CSP as served by
105 Fossil. See the documentation on [./customskin.md#headfoot | Header and
106 Footer Processing] and [./defcsp.md | The Default CSP].
107
108
109 <h2>Server-Side Text Substitution</h2>
110
111 Fossil can do a few types of substitution of server-side information
112 into the embedded document.
113
114 <h3>1. $ROOT</h3>
115
116 To allow for repositories [./server/ | served deeper than the root of the
117 URL hierarchy], Fossil can substitute the repository's root in the URL
118 scheme into HTML <tt>href</tt> and <tt>action</tt> attributes. For
119 example:
120
121 <nowiki><pre>
122 [$ROOT/doc.wiki | doc at project root]
123 </pre></nowiki>
124
125 might become this in the rendered HTML:
126
127 <nowiki><pre>
128 &lt;a href="/project/root/doc.wiki"&gt;doc at project root&lt;/a&gt;
129 </pre></nowiki>
130
131 As you can see, this happens for all source document types that end up
132 rendering as HTML, not just source documents in the HTML
133 <tt>fossil-doc</tt> format described at the end of the prior section.
134
135
136 <h3 id="th1">2. TH1 Documents</h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
138 Fossil will substitute the value of [./th1.md | TH1 expressions] within
139 <tt>{</tt> curly braces <tt>}</tt> into the output HTML if you have
140 configured it with the <tt>--with-th1-docs</tt> option, which is
141 disabled by default.
142
 
 
 
 
 
 
 
 
143
144 <h2>Examples</h2>
145
146 This file that you are currently reading is an example of
147 embedded documentation. The name of this file in the fossil
148 source tree is "<b>www/embeddeddoc.wiki</b>".
149 You are perhaps looking at this
150
--- www/embeddeddoc.wiki
+++ www/embeddeddoc.wiki
@@ -24,11 +24,11 @@
24 on the nature of your project.)
25
26 We will call documentation that is included as files in the source tree
27 "embedded documentation".
28
29 <h1>1.0 Fossil Support For Embedded Documentation</h1>
30
31 The fossil web interface supports embedded documentation using
32 the "/doc" page. To access embedded documentation, one points
33 a web browser to a fossil URL of the following form:
34
@@ -79,10 +79,12 @@
79 Documentation files ending in ".txt" are plain text.
80 Wiki, markdown, and plain text documentation files
81 are rendered with the standard fossil header and footer added.
82 Most other mimetypes are delivered directly to the requesting
83 web browser without interpretation, additions, or changes.
84
85 <h2>1.1 HTML Rendering With Fossil Headers And Footers</h2>
86
87 <a name="html"></a>Files with the mimetype "text/html" (the .html or .htm suffix) are
88 usually rendered directly to the browser without interpretation.
89 However, if the file begins with a &lt;div&gt; element like this:
90
@@ -104,46 +106,78 @@
106 Security Policy] error in your browser with the default CSP as served by
107 Fossil. See the documentation on [./customskin.md#headfoot | Header and
108 Footer Processing] and [./defcsp.md | The Default CSP].
109
110
111 <h1>2.0 Server-Side Text Substitution</h1>
112
113 Fossil can do a few types of substitution of server-side information
114 into the embedded document.
115
116 <h2>2.1 "$ROOT" In HTML and Markdown Hyperlinks</h2>
117
118 Hyperlinks in Markdown and HTML embedded documents can reference
119 the root of the Fossil repository using the special text "$ROOT"
120 at the beginning of a URL. For example, a Markdown hyperlink to
121 the Markdown formatting rules might be
122 written in the embedded document like this:
123
124 <nowiki><pre>
125 [Markdown formatting rules]($ROOT/wiki_rules)
126 </pre></nowiki>
127
128 Depending on how the how the Fossil server is configured, that hyperlink
129 might be renderer like one of the following:
130
131 <nowiki><pre>
132 &lt;a href="/wiki_rules"&gt;Wiki formatting rules&lt;/a&gt;
133 &lt;a href="/cgi-bin/fossil/wiki_rules"&gt;Wiki formatting rules&lt;/a&gt;
134 </pre></nowiki>
135
136 So, in other words, the "$ROOT" text is converted into whatever
137 the "&lt;baseurl&gt;" is for the document.
138
139 This substitution works for HTML and Markdown documents.
140 It does not work for Wiki embedded documents, since with
141 Wiki you can just begin a URL with "/" and it automatically knows
142 to prepend the $ROOT.
143
144 <h2>2.2 "$CURRENT" In "/doc/" Hyperlinks</h2>
145
146 Similarly, URLs of the form "/doc/$CURRENT/..." have the check-in
147 hash of the check-in currently being viewed substituted in place of
148 the "$CURRENT" text. This feature, in combination with the "$ROOT"
149 substitution above, allows an absolute path to be used for hyperlinks.
150
151 For example, if an embedded document documented wanted to reference
152 some other document in a separate file named "www/otherdoc.md",
153 it could use a URL like this:
154
155 <nowiki><pre>
156 [Other Document]($ROOT/doc/$CURRENT/www/otherdoc.md)
157 </pre></nowiki>
158
159 As with "$ROOT", this substitution only works for Markdown and HTML
160 documents. For Wiki documents, you would need to use a relative URL.
161
162 <h2 id="th1">2.3 TH1 Documents</h2>
163
164 Fossil will substitute the value of [./th1.md | TH1 expressions] within
165 <tt>{</tt> curly braces <tt>}</tt> into the output HTML if you have
166 configured it with the <tt>--with-th1-docs</tt> option, which is
167 disabled by default.
168
169 Since TH1 is a full scripting language, this feature essential grants
170 the ability to execute code on the server to any with check-in
171 privilege for the project.
172 This is a security risk that needs to be carefully managed.
173 The feature is off by default.
174 Administrators should understand and carefully assess the risks
175 before enabling the use of TH1 within embedded documentation.
176
177
178 <h1>3.0 Examples</h1>
179
180 This file that you are currently reading is an example of
181 embedded documentation. The name of this file in the fossil
182 source tree is "<b>www/embeddeddoc.wiki</b>".
183 You are perhaps looking at this
184
--- www/mdtest/test1.md
+++ www/mdtest/test1.md
@@ -35,25 +35,25 @@
3535
3636
* Help: [](/help?cmd=help)
3737
3838
* Site-map: [](/sitemap)
3939
40
-## The Magic $SELF Document Version Translation
40
+## The Magic $CURRENT Document Version Translation
4141
42
-In URI text of the form `.../doc/$SELF/...` the
43
-$SELF value is converted to the version number of the document
42
+In URI text of the form `.../doc/$CURRENT/...` the
43
+$CURRENT value is converted to the version number of the document
4444
currently being displayed. This conversion happens after translation
4545
into HTML and only occurs on href='...' attributes so it does not occur
4646
for plain text.
4747
48
- * Document index: [](/doc/$SELF/www/index.wiki)
48
+ * Document index: [](/doc/$CURRENT/www/index.wiki)
4949
50
-Both the $ROOT and the $SELF conversions can occur on the same link.
50
+Both the $ROOT and the $CURRENT conversions can occur on the same link.
5151
52
- * Document index: []($ROOT/doc/$SELF/www/index.wiki)
52
+ * Document index: []($ROOT/doc/$CURRENT/www/index.wiki)
5353
5454
The translations must be contained within HTML markup in order to work.
5555
They do not work for ordinary text that appears to be an href= attribute.
5656
5757
* `x href='$ROOT/timeline'`
5858
* `x action="$ROOT/whatever"`
59
- * `x href="https://some-other-site.com/doc/$SELF/tail"`
59
+ * `x href="https://some-other-site.com/doc/$CURRENT/tail"`
6060
--- www/mdtest/test1.md
+++ www/mdtest/test1.md
@@ -35,25 +35,25 @@
35
36 * Help: [](/help?cmd=help)
37
38 * Site-map: [](/sitemap)
39
40 ## The Magic $SELF Document Version Translation
41
42 In URI text of the form `.../doc/$SELF/...` the
43 $SELF value is converted to the version number of the document
44 currently being displayed. This conversion happens after translation
45 into HTML and only occurs on href='...' attributes so it does not occur
46 for plain text.
47
48 * Document index: [](/doc/$SELF/www/index.wiki)
49
50 Both the $ROOT and the $SELF conversions can occur on the same link.
51
52 * Document index: []($ROOT/doc/$SELF/www/index.wiki)
53
54 The translations must be contained within HTML markup in order to work.
55 They do not work for ordinary text that appears to be an href= attribute.
56
57 * `x href='$ROOT/timeline'`
58 * `x action="$ROOT/whatever"`
59 * `x href="https://some-other-site.com/doc/$SELF/tail"`
60
--- www/mdtest/test1.md
+++ www/mdtest/test1.md
@@ -35,25 +35,25 @@
35
36 * Help: [](/help?cmd=help)
37
38 * Site-map: [](/sitemap)
39
40 ## The Magic $CURRENT Document Version Translation
41
42 In URI text of the form `.../doc/$CURRENT/...` the
43 $CURRENT value is converted to the version number of the document
44 currently being displayed. This conversion happens after translation
45 into HTML and only occurs on href='...' attributes so it does not occur
46 for plain text.
47
48 * Document index: [](/doc/$CURRENT/www/index.wiki)
49
50 Both the $ROOT and the $CURRENT conversions can occur on the same link.
51
52 * Document index: []($ROOT/doc/$CURRENT/www/index.wiki)
53
54 The translations must be contained within HTML markup in order to work.
55 They do not work for ordinary text that appears to be an href= attribute.
56
57 * `x href='$ROOT/timeline'`
58 * `x action="$ROOT/whatever"`
59 * `x href="https://some-other-site.com/doc/$CURRENT/tail"`
60

Keyboard Shortcuts

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