| | @@ -192,10 +192,30 @@ |
| 192 | 192 | blob_init(&x, builtin_text("markdown.md"), -1); |
| 193 | 193 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown"); |
| 194 | 194 | blob_reset(&x); |
| 195 | 195 | style_footer(); |
| 196 | 196 | } |
| 197 | + |
| 198 | +/* |
| 199 | +** WEBPAGE: wiki_rules |
| 200 | +** |
| 201 | +** Show a summary of the wiki formatting rules. |
| 202 | +*/ |
| 203 | +void wiki_rules_page(void){ |
| 204 | + Blob x; |
| 205 | + int fTxt = P("txt")!=0; |
| 206 | + style_header("Wiki Formatting Rules"); |
| 207 | + if( fTxt ){ |
| 208 | + style_submenu_element("Formatted", "%R/wiki_rules"); |
| 209 | + }else{ |
| 210 | + style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1"); |
| 211 | + } |
| 212 | + blob_init(&x, builtin_text("wiki.wiki"), -1); |
| 213 | + wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki"); |
| 214 | + blob_reset(&x); |
| 215 | + style_footer(); |
| 216 | +} |
| 197 | 217 | |
| 198 | 218 | /* |
| 199 | 219 | ** Returns non-zero if moderation is required for wiki changes and wiki |
| 200 | 220 | ** attachments. |
| 201 | 221 | */ |
| | @@ -990,83 +1010,10 @@ |
| 990 | 1010 | const char *zName = db_column_text(&q, 0); |
| 991 | 1011 | @ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li> |
| 992 | 1012 | } |
| 993 | 1013 | db_finalize(&q); |
| 994 | 1014 | @ </ul> |
| 995 | | - style_footer(); |
| 996 | | -} |
| 997 | | - |
| 998 | | -/* |
| 999 | | -** WEBPAGE: wiki_rules |
| 1000 | | -** |
| 1001 | | -** Show the formatting rules for Fossil wiki. |
| 1002 | | -*/ |
| 1003 | | -void wikirules_page(void){ |
| 1004 | | - style_header("Wiki Formatting Rules"); |
| 1005 | | - @ <h2>Formatting Rule Summary</h2> |
| 1006 | | - @ <ol> |
| 1007 | | - @ <li>Blank lines are paragraph breaks</li> |
| 1008 | | - @ <li>Bullets are "*" surrounded by two spaces at the beginning of the |
| 1009 | | - @ line.</li> |
| 1010 | | - @ <li>Enumeration items are "#" surrounded by two spaces at the beginning of |
| 1011 | | - @ a line.</li> |
| 1012 | | - @ <li>Indented paragraphs begin with a tab or two spaces.</li> |
| 1013 | | - @ <li>Hyperlinks are contained with square brackets: "[target]" or |
| 1014 | | - @ "[target|name]".</li> |
| 1015 | | - @ <li>Most ordinary HTML works.</li> |
| 1016 | | - @ <li><verbatim> and <nowiki>.</li> |
| 1017 | | - @ </ol> |
| 1018 | | - @ <p>We call the first five rules above "wiki" formatting rules. The |
| 1019 | | - @ last two rules are the HTML formatting rule.</p> |
| 1020 | | - @ <h2>Formatting Rule Details</h2> |
| 1021 | | - @ <ol> |
| 1022 | | - @ <li> <p><span class="wikiruleHead">Paragraphs</span>. |
| 1023 | | - @ Any sequence of one or more blank lines forms |
| 1024 | | - @ a paragraph break. Centered or right-justified paragraphs are not |
| 1025 | | - @ supported by wiki markup, but you can do these things if you need them |
| 1026 | | - @ using HTML.</p></li> |
| 1027 | | - @ <li> <p><span class="wikiruleHead">Bullet Lists</span>. |
| 1028 | | - @ A bullet list item is a line that begins with a single "*" character |
| 1029 | | - @ surrounded on |
| 1030 | | - @ both sides by two or more spaces or by a tab. Only a single level |
| 1031 | | - @ of bullet list is supported by wiki. For nested lists, use HTML.</p></li> |
| 1032 | | - @ <li> <p><span class="wikiruleHead">Enumeration Lists</span>. |
| 1033 | | - @ An enumeration list item is a line that begins with a single "#" character |
| 1034 | | - @ surrounded on both sides by two or more spaces or by a tab. Only a single |
| 1035 | | - @ level of enumeration list is supported by wiki. For nested lists or for |
| 1036 | | - @ enumerations that count using letters or roman numerials, use HTML.</p></li> |
| 1037 | | - @ <li> <p><span class="wikiruleHead">Indented Paragraphs</span>. |
| 1038 | | - @ Any paragraph that begins with two or more spaces or a tab and |
| 1039 | | - @ which is not a bullet or enumeration list item is rendered |
| 1040 | | - @ indented. Only a single level of indentation is supported by wiki; use |
| 1041 | | - @ HTML for deeper indentation.</p></li> |
| 1042 | | - @ <li> <p><span class="wikiruleHead">Hyperlinks</span>. |
| 1043 | | - @ Text within square brackets ("[...]") becomes a hyperlink. The |
| 1044 | | - @ target can be a wiki page name, the artifact ID of a check-in or ticket, |
| 1045 | | - @ the name of an image, or a URL. By default, the target is displayed |
| 1046 | | - @ as the text of the hyperlink. But you can specify alternative text |
| 1047 | | - @ after the target name separated by a "|" character.</p> |
| 1048 | | - @ <p>You can also link to internal anchor names using [#anchor-name], |
| 1049 | | - @ providing |
| 1050 | | - @ you have added the necessary "<a name='anchor-name'></a>" |
| 1051 | | - @ tag to your wiki page.</p></li> |
| 1052 | | - @ <li> <p><span class="wikiruleHead">HTML</span>. |
| 1053 | | - @ The following standard HTML elements may be used: |
| 1054 | | - show_allowed_wiki_markup(); |
| 1055 | | - @ . There are two non-standard elements available: |
| 1056 | | - @ <verbatim> and <nowiki>. |
| 1057 | | - @ No other elements are allowed. All attributes are checked and |
| 1058 | | - @ only a few benign attributes are allowed on each element. |
| 1059 | | - @ In particular, any attributes that specify javascript or CSS |
| 1060 | | - @ are elided.</p></li> |
| 1061 | | - @ <li><p><span class="wikiruleHead">Special Markup.</span> |
| 1062 | | - @ The <nowiki> tag disables all wiki formatting rules |
| 1063 | | - @ through the matching </nowiki> element. |
| 1064 | | - @ The <verbatim> tag works like <pre> with the addition |
| 1065 | | - @ that it also disables all wiki and HTML markup |
| 1066 | | - @ through the matching </verbatim>.</p></li> |
| 1067 | | - @ </ol> |
| 1068 | 1015 | style_footer(); |
| 1069 | 1016 | } |
| 1070 | 1017 | |
| 1071 | 1018 | /* |
| 1072 | 1019 | ** Add a new wiki page to the repository. The page name is |
| 1073 | 1020 | |
| 1074 | 1021 | ADDED src/wiki.wiki |