Show More
@@ -1463,3 +1463,36 b' The full set of options is:' | |||||
1463 |
|
1463 | |||
1464 | ``templates`` |
|
1464 | ``templates`` | |
1465 | Where to find the HTML templates. Default is install path. |
|
1465 | Where to find the HTML templates. Default is install path. | |
|
1466 | ||||
|
1467 | ``websub`` | |||
|
1468 | ---------- | |||
|
1469 | ||||
|
1470 | Web substitution filter definition. You can use this section to | |||
|
1471 | define a set of regular expression substitution patterns which | |||
|
1472 | let you automatically modify the hgweb server output. | |||
|
1473 | ||||
|
1474 | The default hgweb templates only apply these substitution patterns | |||
|
1475 | on the revision description fields. You can apply them anywhere | |||
|
1476 | you want when you create your own templates by adding calls to the | |||
|
1477 | "websub" filter (usually after calling the "escape" filter). | |||
|
1478 | ||||
|
1479 | This can be used, for example, to convert issue references to links | |||
|
1480 | to your issue tracker, or to convert "markdown-like" syntax into | |||
|
1481 | HTML (see the examples below). | |||
|
1482 | ||||
|
1483 | Each entry in this section names a substitution filter. | |||
|
1484 | The value of each entry defines the substitution expression itself. | |||
|
1485 | The websub expressions follow the old interhg extension syntax, | |||
|
1486 | which in turn imitates the Unix sed replacement syntax:: | |||
|
1487 | ||||
|
1488 | pattername = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] | |||
|
1489 | ||||
|
1490 | You can use any separator other than "/". The final "i" is optional | |||
|
1491 | and indicates that the search must be case insensitive. | |||
|
1492 | ||||
|
1493 | Examples:: | |||
|
1494 | ||||
|
1495 | [websub] | |||
|
1496 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i | |||
|
1497 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ | |||
|
1498 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ |
@@ -8,7 +8,7 b'' | |||||
8 | <i>{author|obfuscate} [{date|rfc822date}] rev {rev}</i><br/> |
|
8 | <i>{author|obfuscate} [{date|rfc822date}] rev {rev}</i><br/> | |
9 | </div> |
|
9 | </div> | |
10 | <div class="log_body"> |
|
10 | <div class="log_body"> | |
11 | {desc|strip|escape|addbreaks|nonempty} |
|
11 | {desc|strip|escape|websub|addbreaks|nonempty} | |
12 | <br/> |
|
12 | <br/> | |
13 | <br/> |
|
13 | <br/> | |
14 | </div> |
|
14 | </div> |
@@ -41,7 +41,7 b' changeset |' | |||||
41 | </table></div> |
|
41 | </table></div> | |
42 |
|
42 | |||
43 | <div class="page_body"> |
|
43 | <div class="page_body"> | |
44 | {desc|strip|escape|addbreaks|nonempty} |
|
44 | {desc|strip|escape|websub|addbreaks|nonempty} | |
45 | </div> |
|
45 | </div> | |
46 | <div class="list_head"></div> |
|
46 | <div class="list_head"></div> | |
47 | <div class="title_text"> |
|
47 | <div class="title_text"> |
@@ -56,7 +56,7 b' annotate |' | |||||
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | <div class="page_path"> |
|
58 | <div class="page_path"> | |
59 | {desc|strip|escape|addbreaks|nonempty} |
|
59 | {desc|strip|escape|websub|addbreaks|nonempty} | |
60 | </div> |
|
60 | </div> | |
61 | <div class="page_body"> |
|
61 | <div class="page_body"> | |
62 | <table> |
|
62 | <table> |
@@ -56,7 +56,7 b' file |' | |||||
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | <div class="page_path"> |
|
58 | <div class="page_path"> | |
59 | {desc|strip|escape|addbreaks|nonempty} |
|
59 | {desc|strip|escape|websub|addbreaks|nonempty} | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <div class="page_body"> |
|
62 | <div class="page_body"> |
@@ -2,5 +2,5 b'' | |||||
2 | <ul class="changelog-entry"> |
|
2 | <ul class="changelog-entry"> | |
3 | <li class="age">{date|rfc822date}</li> |
|
3 | <li class="age">{date|rfc822date}</li> | |
4 | <li>by <span class="name">{author|obfuscate}</span> <span class="revdate">[{date|rfc822date}] rev {rev}</span></li> |
|
4 | <li>by <span class="name">{author|obfuscate}</span> <span class="revdate">[{date|rfc822date}] rev {rev}</span></li> | |
5 | <li class="description">{desc|strip|escape|addbreaks|nonempty}</li> |
|
5 | <li class="description">{desc|strip|escape|websub|addbreaks|nonempty}</li> | |
6 | </ul> |
|
6 | </ul> |
@@ -52,7 +52,7 b'' | |||||
52 | {child%changesetchild} |
|
52 | {child%changesetchild} | |
53 | </dl> |
|
53 | </dl> | |
54 |
|
54 | |||
55 | <p class="description">{desc|strip|escape|addbreaks|nonempty}</p> |
|
55 | <p class="description">{desc|strip|escape|websub|addbreaks|nonempty}</p> | |
56 |
|
56 | |||
57 | <table> |
|
57 | <table> | |
58 | {files} |
|
58 | {files} |
@@ -57,7 +57,7 b'' | |||||
57 | <dd>{permissions|permissions}</dd> |
|
57 | <dd>{permissions|permissions}</dd> | |
58 | </dl> |
|
58 | </dl> | |
59 |
|
59 | |||
60 | <p class="description">{desc|strip|escape|addbreaks|nonempty}</p> |
|
60 | <p class="description">{desc|strip|escape|websub|addbreaks|nonempty}</p> | |
61 |
|
61 | |||
62 | <table class="annotated"> |
|
62 | <table class="annotated"> | |
63 | {annotate%annotateline} |
|
63 | {annotate%annotateline} |
@@ -57,7 +57,7 b'' | |||||
57 | <dd>{permissions|permissions}</dd> |
|
57 | <dd>{permissions|permissions}</dd> | |
58 | </dl> |
|
58 | </dl> | |
59 |
|
59 | |||
60 | <p class="description">{desc|strip|escape|addbreaks|nonempty}</p> |
|
60 | <p class="description">{desc|strip|escape|websub|addbreaks|nonempty}</p> | |
61 |
|
61 | |||
62 | <div class="source"> |
|
62 | <div class="source"> | |
63 | {text%fileline} |
|
63 | {text%fileline} |
@@ -40,7 +40,7 b'' | |||||
40 | files, or words in the commit message</div> |
|
40 | files, or words in the commit message</div> | |
41 | </form> |
|
41 | </form> | |
42 |
|
42 | |||
43 | <div class="description">{desc|strip|escape|nonempty}</div> |
|
43 | <div class="description">{desc|strip|escape|websub|nonempty}</div> | |
44 |
|
44 | |||
45 | <table id="changesetEntry"> |
|
45 | <table id="changesetEntry"> | |
46 | <tr> |
|
46 | <tr> |
@@ -46,7 +46,7 b'' | |||||
46 | files, or words in the commit message</div> |
|
46 | files, or words in the commit message</div> | |
47 | </form> |
|
47 | </form> | |
48 |
|
48 | |||
49 | <div class="description">{desc|strip|escape|nonempty}</div> |
|
49 | <div class="description">{desc|strip|escape|websub|nonempty}</div> | |
50 |
|
50 | |||
51 | <table id="changesetEntry"> |
|
51 | <table id="changesetEntry"> | |
52 | <tr> |
|
52 | <tr> |
@@ -45,7 +45,7 b'' | |||||
45 | files, or words in the commit message</div> |
|
45 | files, or words in the commit message</div> | |
46 | </form> |
|
46 | </form> | |
47 |
|
47 | |||
48 | <div class="description">{desc|strip|escape|nonempty}</div> |
|
48 | <div class="description">{desc|strip|escape|websub|nonempty}</div> | |
49 |
|
49 | |||
50 | <table id="changesetEntry"> |
|
50 | <table id="changesetEntry"> | |
51 | <tr> |
|
51 | <tr> |
@@ -45,7 +45,7 b'' | |||||
45 | files, or words in the commit message</div> |
|
45 | files, or words in the commit message</div> | |
46 | </form> |
|
46 | </form> | |
47 |
|
47 | |||
48 | <div class="description">{desc|strip|escape|nonempty}</div> |
|
48 | <div class="description">{desc|strip|escape|websub|nonempty}</div> | |
49 |
|
49 | |||
50 | <table id="changesetEntry"> |
|
50 | <table id="changesetEntry"> | |
51 | <tr> |
|
51 | <tr> |
@@ -44,7 +44,7 b'' | |||||
44 | files, or words in the commit message</div> |
|
44 | files, or words in the commit message</div> | |
45 | </form> |
|
45 | </form> | |
46 |
|
46 | |||
47 | <div class="description">{desc|strip|escape|nonempty}</div> |
|
47 | <div class="description">{desc|strip|escape|websub|nonempty}</div> | |
48 |
|
48 | |||
49 | <table id="changesetEntry"> |
|
49 | <table id="changesetEntry"> | |
50 | <tr> |
|
50 | <tr> |
@@ -39,7 +39,7 b'' | |||||
39 | </tr> |
|
39 | </tr> | |
40 | <tr> |
|
40 | <tr> | |
41 | <th class="description">description:</th> |
|
41 | <th class="description">description:</th> | |
42 | <td class="description">{desc|strip|escape|addbreaks|nonempty}</td> |
|
42 | <td class="description">{desc|strip|escape|websub|addbreaks|nonempty}</td> | |
43 | </tr> |
|
43 | </tr> | |
44 | </table> |
|
44 | </table> | |
45 |
|
45 |
@@ -38,7 +38,7 b'' | |||||
38 | </tr> |
|
38 | </tr> | |
39 | <tr> |
|
39 | <tr> | |
40 | <td class="metatag">description:</td> |
|
40 | <td class="metatag">description:</td> | |
41 | <td>{desc|strip|escape|addbreaks|nonempty}</td> |
|
41 | <td>{desc|strip|escape|websub|addbreaks|nonempty}</td> | |
42 | </tr> |
|
42 | </tr> | |
43 | </table> |
|
43 | </table> | |
44 |
|
44 |
@@ -36,7 +36,7 b'' | |||||
36 | <td>{permissions|permissions}</td></tr> |
|
36 | <td>{permissions|permissions}</td></tr> | |
37 | <tr> |
|
37 | <tr> | |
38 | <td class="metatag">description:</td> |
|
38 | <td class="metatag">description:</td> | |
39 | <td>{desc|strip|escape|addbreaks|nonempty}</td> |
|
39 | <td>{desc|strip|escape|websub|addbreaks|nonempty}</td> | |
40 | </tr> |
|
40 | </tr> | |
41 | </table> |
|
41 | </table> | |
42 |
|
42 |
General Comments 0
You need to be logged in to leave comments.
Login now